cleanup docs, extract scripts for postgresql
[edozvola] / edozvola-dpavlin.txt
index c6877e0..c248649 100644 (file)
@@ -1,4 +1,7 @@
-yum install etckeeper\r
+# instalirati etckeeper da čuva /etc/ direktorij u git-u\r
+# (nije na produkcijskom enviromentu)\r
+\r
+yum install etckeeper\r
 cd /etc/\r
 git config --global user.email "dpavlin@rot13.org"\r
 git config --global user.name "Dobrica Pavlinusic"\r
@@ -26,7 +29,7 @@ bash-4.2$ cp -v .ssh/id_rsa.pub .ssh/authorized_keys
 ‘.ssh/id_rsa.pub’ -> ‘.ssh/authorized_keys’\r
 \r
 \r
-prekopirati isti kljuc i authoriorized keys na slave:\r
+## prekopirati isti kljuc i authoriorized keys na slave:\r
 \r
 \r
 [root@edozvola-db-01 pgsql]# rsync -rav .ssh edozvola-db-02:`pwd`\r
@@ -108,40 +111,27 @@ https://www.postgresql.org/docs/9.6/static/continuous-archiving.html
 \r
 [root@edozvola-db-01 ~]# vi /var/lib/pgsql/9.6/data/postgresql.conf\r
 wal_level = replica\r
-archive_mode = on\r
-max_wal_senders = 3 \r
-max_replication_slots = 3\r
-archive_command = 'test ! -f /shared/pgsql/%f && cp %p /shared/pgsql/%f'\r
-hot_standby = on\r
-\r
-\r
 \r
+# https://www.postgresql.org/docs/9.6/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT\r
+synchronous_commit = on\r
 \r
+archive_mode = on\r
+archive_command = 'test ! -f /shared/pgsql/%f && cp %p /shared/pgsql/%f'\r
 \r
+max_wal_senders = 3 \r
+max_replication_slots = 3\r
 \r
+hot_standby = on\r
 \r
 \r
 [root@edozvola-db-01 ~]# systemctl restart postgresql-9.6.service\r
 \r
 \r
 \r
+# kreirati replication korisnika\r
 \r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-kreirati replication korisnika\r
 [root@edozvola-db-01 ~]# sudo -u postgres psql\r
 \r
-\r
 postgres=# create user replication with password 'replication123' login replication ;\r
 CREATE ROLE\r
 \r
@@ -151,15 +141,13 @@ CREATE ROLE
 \r
 host    replication     replication     10.200.1.62/24          md5\r
 \r
-\r
-netmask je /24 da mozemo imati istu konfiguraciju na oba node-a\r
+## netmask je /24 da mozemo imati istu konfiguraciju na oba node-a\r
 \r
 \r
 \r
 \r
 \r
-\r
-testirati replikaciju\r
+# testirati replikaciju\r
 [root@edozvola-db-01 ~]# sudo -u postgres psql test\r
 test=# insert into test1 (a,b) values ('baz',3);\r
 INSERT 0 1\r
@@ -231,26 +219,22 @@ archive_cleanup_command = 'pg_archivecleanup /shared/pgsql %r'
 \r
 \r
 \r
-skripte\r
-promoviranje slave-a u master\r
+# skripte\r
 \r
 \r
 [root@edozvola-db-01 pgsql]# pwd\r
 /var/lib/pgsql\r
-[root@edozvola-db-01 pgsql]# cat promote-slave-to-master.sh\r
-#!/bin/sh -xe\r
-\r
 \r
 \r
+## promoviranje slave-a u master\r
 \r
+[root@edozvola-db-01 pgsql]# cat promote-slave-to-master.sh\r
+#!/bin/sh -xe\r
 /usr/pgsql-9.6/bin/pg_ctl --pgdata=/var/lib/pgsql/9.6/data promote\r
 \r
 \r
+## kreiranje slave instance od mastera\r
 \r
-\r
-\r
-\r
-kreiranje slave instance od mastera\r
 [root@edozvola-db-01 pgsql]# cat create-pgsql-slave.sh\r
 #!/bin/sh -e\r
 \r