Instructions for Admin¶
Installation on Ubuntu 18.04. LTS¶
Run the following instructions as root
(this means, type sudo
in front of every command) in order to have the root rights.
If a file needs to be opened/modified, use the editor “nano” (type nano
in front of the filename).
Ubuntu packages
$ apt install git r-base postgresql python3-pip python3-psycopg2Install julia 1.0.1 and create a symbolic link: (Ubuntu offers julia 0.4.x only):
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.1-linux-x86_64.tar.gz $ tar xzf julia-1.0.1-linux-x86_64.tar.gz $ mv julia-1.0.1 /opt $ ln -s /opt/julia-1.0.1/bin/julia /usr/local/bin/ $ julia --versionCreate data base users and database
We create a user
whdp
who owns thewhdp
database and thus has all permissions to modify tables and data in this database. In addition to that we create awhdp_reader
user which only has read access.$ sudo -u postgres createuser -P whdp $ sudo -u postgres createuser -P whdp_readerNote down the choosen passwords for both users.
Then create the database and restrict the permissions of
whdp_reader
.$ sudo -u postgres createdb -O whdp whdp $ sudo -u postgres psql -c "REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM whdp_reader;" $ sudo -u postgres psql -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO whdp_reader;"Now check:
$ psql -U whdp -h 127.0.0.1 whdp $ ^D (control-D to exit postgress shell)Next, the database must be configured to allow for remote access.
In the file
/etc/postgresql/10/main/pg_hba.conf
edit the linehost all all 127.0.0.1/32 md5
tohost all all 0.0.0.0/0 md5
.In the file
/etc/postgresql/10/main/postgresql.conf
change# listen_addresses = 'localhost'
tolisten_addresses = '*'
.Restart the data base:
$ service postgresql restart
Install WHDP
$ cd /opt $ git clone https://sissource.ethz.ch/sispub/whdp.git $ apt install python3-pip $ pip3 install -e whdpCheck installation:
$ whdp --helpInstall needed packages for demo scripts:
$ /opt/whdp/scripts/setup_julia_et_al.shCreate user account for data provider:
$ addgroup whdp $ useradd -m -G whdp,systemd-journal -s /bin/bash whdp-providerAssign password:
$ passwd whdp-providerInitialize WHDP configuration and setup landing zone:
We assume that the landing zone will be located on a shared drive mounted at
/nfsmount
, but you are free to choose any other folder.Create the landing zone and link it to the WHDP:
$ mkdir -p /nfsmount/landing_zone $ whdp init-config /nfsmount/landing_zoneSet the correct permissions:
$ chgrp -R whdp /nfsmount/landing_zone $ chmod -R g+w /nfsmount/landing_zoneAdapt configuration:
$ /etc/whdp/whdp.iniAdd the database user and password. Replace
DB_USER
andDB_PASSWORD
with the one selected in step 3.... [db] connection_string = postgresql://DB_USER:DB_PASSWORD@127.0.0.1:5432/whdpIf necessary adapt also the path to the landing zone, define a backup landingzone, or change software versions.
Then check:
$ whdp check-configCreate the central management tool service for controlling the init system:
$ ln -s /opt/whdp/scripts/whdp.service /etc/systemd/system $ systemctl daemon-reload
- Start service:
$ systemctl start whdp.service $ systemctl status whdp.service
- Observe running service:
can be stopped with ^C), can be used without
-f
:$ journalctl -u whdp -fKeep this terminal window open if you want observe the whdp activities.
- Install julia packages:
Login as user
whdp-provider
first.Install needed Julia packages (these are installed per user) to be able to run the test scripts:
$ /opt/whdp/scripts/setup_julia.sh