From 8c2e4e9dd5cdd30a81cbf349a4eda1d834a28032 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Wed, 6 Apr 2016 08:43:34 -0500 Subject: [PATCH] add postgresql setup instructions --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8048f944..2e15b8c9 100644 --- a/README.md +++ b/README.md @@ -148,12 +148,27 @@ $ pip install tacc_stats/ $ nohup listend.py > /tmp/listend.log ``` Raw stats files will now be generated in the `archive_dir`. -5. A PostgreSQL database must be setup on the host. To do this, after installation -run +5. A PostgreSQL database must be setup on the host. To do this, after installation of PostgreSQL +and the `tacc_stats` Python module +``` +$ sudo su - postgresql +$ psql +# CREATE DATABASE machinename_db; +# CREATE USER taccstats WITH PASSWORD 'taccstats'; +# ALTER ROLE taccstats SET client_encoding TO 'utf8'; +# ALTER ROLE taccstats SET default_transaction_isolation TO 'read committed'; +# ALTER ROLE taccstats SET timezone TO 'UTC'; +# GRANT ALL PRIVILEGES ON DATABASE machinename_db TO taccstats; +# \q +``` + +then + ``` $ python manage.py migrate ``` -This will generate a table named `machine_db` in your database. +This will generate a table named `machinename_db` in your database. + 6. Setup cron jobs to process raw data and ingest into database. Add the following to your cron file ```