Update pg_hba.conf as described in the previous section:
sudo vim /etc/postgresql/9.1/main/pg_hba.conf
Update the bottom of the file, which will read something like this, by default:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
To read this:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
Update postgresql.conf as in the previous section
sudo vim /etc/postgresql/9.1/main/postgresql.conf
Uncomment line 59:
#listen_addresses = 'localhost' # what IP address(es) to listen on;
And update the line to enable connections from any IP address:
listen_addresses='*'
And uncomment line 63:
#port = 5432
So it reads
port = 5432
Then restart PostgreSQL:
sudo /etc/init.d/postgresql restart
Log into PostgreSQL:
$ sudo su - postgres
$ psql
Update your Postres user credentials:
Now we need to create user credentials for our different users. Power users will be able to do anything (these are really admins.) "Other users" will be suitable for analysts who wish to query the data. We also create a particular user with limited access for the storageloader - these credentials will be used just to load Snowplow data into Postgres.
CREATE USER power_user SUPERUSER;
ALTER USER power_user WITH PASSWORD '$poweruserpassword';
CREATE USER other_user NOSUPERUSER;
ALTER USER other_user WITH PASSWORD '$otheruserpassword';
CREATE DATABASE snowplow WITH OWNER other_user;
CREATE USER storageloader PASSWORD '$storageloaderpassword';
\q
READ MORE at: https://github.com/snowplow/snowplow/wiki/Setting-up-PostgreSQL