* Pacemaker 설정(방법 2)
* Configuring Stonith
* Disable Stonith (node 1)
crm configure property stonith-enabled=false
* checking the cluster configuration, we should get no errors:
crm_verify -L
* Cluster General Configuration
* Configuring quorum to 2 nodes. For more information, look at pacemaker configuration.
crm configure property no-quorum-policy=ignore
crm configure rsc_defaults resource-stickiness=100
crm configure show
* Configuring DBIP
crm configure primitive DBIP ocf:heartbeat:IPaddr2 params ip=192.168.21.160 cidr_netmask=24 op monitor interval=30s
* Configuring DRBD on Cluster
crm configure primitive drbd_postgres ocf:linbit:drbd params drbd_resource="postgres" op monitor interval="15s"
crm configure ms ms_drbd_postgres drbd_postgres meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
crm configure primitive postgres_fs ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/var/lib/pgsql" fstype="ext4"
* Configuring PostgreSQL on Cluster
crm configure primitive postgresql ocf:heartbeat:pgsql op monitor depth="0" timeout="30" interval="30"
-> 이건 PostgreSQL 용이고 PPAS 용으로 아래와 같이 해야 될 것 같음
crm configure primitive postgresql ocf:heartbeat:pgsql params \
pgctl=/opt/PostgresPlus/9.4AS/bin/pg_ctl \
psql=/opt/PostgresPlus/9.4AS/bin/psql \
pgdata=/var/lib/pgsql/data pgdba=enterprisedb pgport=5444 pgdb=edb \
op monitor depth="0" timeout="30" interval="10" \
op start timeout=120 interval=0 \
op stop timeout=120 interval=0
(위 파라미터에서 ocf:heartbeat:pgsql 로 한다는 것은 실제 /usr/lib/ocf/resource.d/heartbeat/pgsql 의 설정값을 사용한다는 것이므로 실제 양쪽 노드에서 파일을 열어 값이 정상인지 확인한다)
아마 아래 6줄과 같이 변경해야 할 것이다.
OCF_RESKEY_pgctl_default=/opt/PostgresPlus/9.4AS/bin/pg_ctl
OCF_RESKEY_psql_default=/opt/PostgresPlus/9.4AS/bin//psql
OCF_RESKEY_pgdata_default=/var/lib/pgsql/data
OCF_RESKEY_pgdba_default=enterprisedb
OCF_RESKEY_pghost_default=""
OCF_RESKEY_pgport_default=5444
crm configure group postgres postgres_fs DBIP postgresql
crm configure coasdflocation postgres_on_drbd inf: postgres ms_drbd_postgres:Master
crm configure order postgres_after_drbd inf: ms_drbd_postgres:promote postgres:start
crm configure show
* Setting the Preferential Node
crm configure location master-prefer-node1 DBIP 50: cos1.local
* Cluster managment
* Acessing from network
echo "host all all 192.168.21.0/24 md5">> /var/lib/pgsql/data/pg_hba.conf
* restart postgres to reload configuration:
crm resource stop postgresql
crm resource start postgresql
* 문제가 있어 postgresql resource 지우고 아래 명령어로 다시 세팅
crm configure primitive postgresql ocf:heartbeat:pgsql params \
pgctl=/opt/PostgresPlus/9.4AS/bin/pg_ctl \
psql=/opt/PostgresPlus/9.4AS/bin/psql \
pgdata=/var/lib/ppas/data pgdba=enterprisedb pgport=5444 pgdb=edb \
op monitor depth="0" timeout="30" interval="10" \
op start timeout=120 interval=0 \
op stop timeout=120 interval=0
* # crm resource cleanup [resource 명]
(한쪽 노드에서 실행해도 모든 노드에 적용되지만 잘 안 될 경우 모든 노드에서 명령어 실행)
* cat /proc/drbd 해서 primary/unknown 으로 나오는 경우 아래와 같이 한다.
On primary node
drbdadm connect all
On secondary node
drbdadm -- --discard-my-data connect all
Should work
댓글 없음:
댓글 쓰기