Created
August 4, 2017 10:11
-
-
Save tasdikrahman/5f7448c6ca6a279afbdcdd8fddc35bde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ssh [email protected] | |
| [root@dwhdb ~]# hostname | |
| dwhdb.ovirt.org | |
| [root@dwhdb ~]# yum install postgresql-server -y > /dev/null | |
| [root@dwhdb ~]# su -l postgres -c "/usr/bin/initdb --locale=en_US.UTF8 --auth='ident' --pgdata=/var/lib/pgsql/data/" | |
| The files belonging to this database system will be owned by user "postgres". | |
| This user must also own the server process. | |
| The database cluster will be initialized with locale "en_US.UTF8". | |
| The default database encoding has accordingly been set to "UTF8". | |
| The default text search configuration will be set to "english". | |
| fixing permissions on existing directory /var/lib/pgsql/data ... ok | |
| creating subdirectories ... ok | |
| selecting default max_connections ... 100 | |
| selecting default shared_buffers ... 32MB | |
| creating configuration files ... ok | |
| creating template1 database in /var/lib/pgsql/data/base/1 ... ok | |
| initializing pg_authid ... ok | |
| initializing dependencies ... ok | |
| creating system views ... ok | |
| loading system objects' descriptions ... ok | |
| creating collations ... ok | |
| creating conversions ... ok | |
| creating dictionaries ... ok | |
| setting privileges on built-in objects ... ok | |
| creating information schema ... ok | |
| loading PL/pgSQL server-side language ... ok | |
| vacuuming database template1 ... ok | |
| copying template1 to template0 ... ok | |
| copying template1 to postgres ... ok | |
| Success. You can now start the database server using: | |
| /usr/bin/postgres -D /var/lib/pgsql/data | |
| or | |
| /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start | |
| [root@dwhdb ~]# | |
| [root@dwhdb ~]# systemctl start postgresql.service | |
| [root@dwhdb ~]# systemctl enable postgresql.service | |
| Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql.service to /usr/lib/systemd/system/postgresql.service. | |
| [root@dwhdb ~]# su - postgres | |
| -bash-4.2$ psql | |
| psql (9.2.18) | |
| Type "help" for help. | |
| postgres=# create role ovirt_engine_history with login encrypted password 'password'; | |
| CREATE ROLE | |
| postgres=# create database ovirt_engine_history owner ovirt_engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8'; | |
| postgres=# \q | |
| -bash-4.2$ exit | |
| [root@dwhdb ~]# tail -3 /var/lib/pgsql/data/pg_hba.conf | |
| host ovirt_engine_history ovirt_engine_history xxx.xx.3.0/24 md5 # engine | |
| host ovirt_engine_history ovirt_engine_history xxx.xx.11.0/24 md5 # dwhservice | |
| [root@dwhdb ~]# | |
| [root@dwhdb ~]# sed -n '59,66p' /var/lib/pgsql/data/postgresql.conf | |
| listen_addresses = '*' # what IP address(es) to listen on; | |
| # comma-separated list of addresses; | |
| # defaults to 'localhost'; use '*' for all | |
| # (change requires restart) | |
| #port = 5432 # (change requires restart) | |
| # Note: In RHEL/Fedora installations, you can't set the port number here; | |
| # adjust it in the service file instead. | |
| max_connections = 150 # (change requires restart) | |
| [root@dwhdb ~]# systemctl start firewalld | |
| [root@dwhdb ~]# firewall-cmd --zone=public --add-port=5432/tcp --permanent | |
| success | |
| [root@dwhdb ~]# firewall-cmd --reload | |
| success | |
| [root@dwhdb ~]# iptables -S | grep 5432 | |
| -A IN_public_allow -p tcp -m tcp --dport 5432 -m conntrack --ctstate NEW -j ACCEPT | |
| [root@dwhdb ~]# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment