Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Created October 28, 2019 16:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwjohnston/d9b59e701266b69470aa60132815027d to your computer and use it in GitHub Desktop.
Save cwjohnston/d9b59e701266b69470aa60132815027d to your computer and use it in GitHub Desktop.
Setting up postgres on Centos 7 for Sensu Go
# postgres setup on centos 7
```
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.7-x86_64/pgdg-redhat10-10-2.noarch.rpm
yum install postgresql10-server postgresql10
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl start postgresql-10
systemctl enable postgresql-10
systemctl status postgresql-10
sudo -u postgres psql
```
Once in the psql command line:
```
postgres=# CREATE DATABASE sensu_events;
CREATE DATABASE
postgres=# CREATE USER sensu WITH ENCRYPTED PASSWORD 'mypass';
CREATE ROLE
postgres=# GRANT ALL PRIVILEGES ON DATABASE sensu_events TO sensu;
GRANT
```
Add sensu user to the pg_hba.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment