[Linux-ha-jp] pacemakerからpostgresqlを起動出来ない件

アーカイブの一覧に戻る

海藤 廣一 kaido****@jp*****
2015年 8月 25日 (火) 11:27:54 JST


$B$O$8$a$^$7$F!"3$F#$H?=$7$^$9!#(B

$B8=:_!"(BDebian+PostgreSQL$B$G(BDatabaseServer$B$r8!F$Cf$G$9!#(B
$B$=$3$G!"(Bpacemaker+corosync$B$rMQ$$$F%/%i%9%?%j%s%0$r9=C[$7$F(B
$B>c32;~$N%U%'%$%k%*!<%P!<$r9T$$$?$$$N$G$9$,!"(Bpacemaker$B$+$i(B
postgresql$B$r5/F0$G$-$:$K:$$C$F$*$j$^$9!#(B
$B$I$J$?$+!"$*CN7C$rGR<Z$G$-$J$$$G$7$g$&$+!)(B


$B!c3NG':Q$_FbMF!d(B
$B!&N>%N!<%I$K2>A[(BIP$B$N$_$r @ _Dj$9$k(Bcrm$B$N>l9g!"4|BTDL$j$KF0:n$9$k!#(B
$B!!!J2>A[(BIP$B$,?6$i$l$I$A$i$+%@%&%s$9$k$HF0:nCf$N%N!<%I$,2>A[(BIP$B$r0z$-7Q$0!K(B
$B!&(BPostgreSQL$B$r<jF0$G5/F0$7$?>l9g!"%l%W%j%1!<%7%g%sF0:n$9$k!#(B
$B!!-!(B/etc/init.d/postgresql start
$B!!-"(B/usr/lib/pgostgresql/9.1/bin/pg_ctl start -D /var/lib/pgostgresql/9.1/main
$B!!"(-!$G$O(B/etc/postgresql/9.1/main/posgresql.conf($BF0:n3NG'MQ(B)$B$r;2>H$7$FF0:n(B
$B!!!!-"$G$O(B/var/lib/pgostgresql/9.1/main/posgresql.conf(pacemaker$BMQ(B)$B$r;2>H$7$FF0:n(B


$B3F4D6-$O2<5-$NMM$K$J$C$F$*$j$^$9!#(B
Debian 7.8.0 amd64
PostgreSQL 9.1
pacemaker 1.1.7-1
corosync 1.4.2-3

$B8=:_$O @ _Dj!&F0:n3NG'$rL\E*$K$7$F$^$9$N$G!"(BKVM$B>e$K2>A[(BPC
$B$r#2Bf9=@.$7$F%F%9%H$7$F$$$^$9!#(B
$B#2%N!<%I$N$_$G(BPrimary$B$H(BStandby$B$H$7$F(B/etc/hostname$B$K$O(B
$B$=$l$>$l(B"DBS_PRI"$B$H(B"DBS_STB"$B$r @ _Dj$7$F$$$^$9!#(B

$B%j%=!<%9%(!<%8%'%s%H(B(pgsql)$B$O(B
https://raw.githubusercontent.com/ClusterLabs/resource-agents/master/heartbeat/pgsql
$B$+$i%@%&%s%m!<%I$7$?$b$KN>%N!<%I$H$bF~49$($^$7$?!#(B

$B4pK\E*$J @ _Dj$O2<5-$r;29M$K=$@5$7$FF0:n3NG'$r$7$F$$$^$9!#(B
https://github.com/t-matsuo/resource-agents/wiki/PostgreSQL-9.1-%E3%82%B9%E3%83%88%E3%83%AA%E3%83%BC%E3%83%9F%E3%83%B3%E3%82%B0%E3%83%AC%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E5%AF%BE%E5%BF%9C-%E3%83%AA%E3%82%BD%E3%83%BC%E3%82%B9%E3%82%A8%E3%83%BC%E3%82%B8%E3%82%A7%E3%83%B3%E3%83%88


[crm]
property no-quorum-policy="ignore" stonith-enabled="false"
rsc_defaults resource-stickiness="INFINITY" migration-threshold="1"

ms msPostgresql pg_sql \
    meta \
        master-max="1"        master-node-max="1" \
        clone-max="2"         clone-node-max="1" \
        notify="true"

group master-group vip-pri \
    meta \
          ordered="false"

primitive vip-pri ocf:heartbeat:IPaddr2 \
params ip="192.168.255.253" nic="eth0:1" cidr_netmask="16" \
    op start   timeout="60s" interval="0s"  on-fail="restart" \
    op monitor timeout="60s" interval="10s" on-fail="restart" \
    op stop    timeout="60s" interval="0s"  on-fail="block"

primitive vip-stb ocf:heartbeat:IPaddr2 \
params ip="192.168.255.252" nic="eth0:2" cidr_netmask="16" \
    op start   timeout="60s" interval="0s"  on-fail="restart" \
    op monitor timeout="60s" interval="10s" on-fail="restart" \
    op stop    timeout="60s" interval="0s"  on-fail="block"

primitive pg_sql ocf:heartbeat:pgsql \
    params \
        pgctl="/usr/lib/pgostgresql/9.1/bin/pg_ctl" \
        psql="/usr/lib/pgostgresql/9.1/bin/psql" \
        pgdata="/var/lib/pgostgresql/9.1/main" \
        rep_mode="sync" \
        node_list="DBS_PRI DBS_STB" \
        restore_command="cp /mnt/wal_archive/%f %p" \
        master_ip="192.168.255.243" \
        primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5" \
        stop_escalate="0" \
    op start   timeout="30s" interval="0s"  on-fail="restart" \
    op monitor timeout="30s" interval="4s"  on-fail="restart" \
    op monitor timeout="30s" interval="2s"  on-fail="restart" role="Master" \
    op promote timeout="30s" interval="0s"  on-fail="restart" \
    op demote  timeout="30s" interval="0s"  on-fail="stop" \
    op stop    timeout="30s" interval="0s"  on-fail="block" \
    op notify  timeout="60s" interval="0s"

location rsc_location-1 vip-pri \
    rule 200: #uname eq DBS_PRI \
    rule 100: #uname eq DBS_STB

location rsc_location-2 vip-stb \
    rule  200: pgsql-status eq "HS:sync" \
    rule  100: pgsql-status eq "PRI"

colocation rsc_colocation-1 inf: master-group msPostgresql:Master

order rsc_order-2 inf: msPostgresql:promote  master-group:start   symmetrical=false
order rsc_order-3   0: msPostgresql:demote   master-group:stop    symmetrical=false


[/etc/corosync/corosync.conf]
# Please read the openais.conf.5 manual page
quorum {
    # Enable and configure quorum subsystem (default: off)
    # see also corosync.conf.5 and votequorum.5
    provider: corosync_votequorum
    expected_votes: 2
}

aisexec {
    user:   root
    group:  root
}

service {
    name: pacemaker
    ver: 0             
    use_mgmtd: yes
}

totem {
  version: 2

  # How long before declaring a token lost (ms)
  token: 3000

  # How many token retransmits before forming a new configuration
  token_retransmits_before_loss_const: 10

  # How long to wait for join messages in the membership protocol (ms)
  join: 60

  # How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
  consensus: 3600

  # Turn off the virtual synchrony filter
  vsftype: none

  # Number of messages that may be sent by one processor on receipt of the token
  max_messages: 20

  # Limit generated nodeids to 31-bits (positive signed integers)
  clear_node_high_bit: yes

  # Disable encryption
  secauth: off
    #crypto_cipher: none
    #crypto_hash: none

  # How many threads to use for encryption/decryption
  threads: 0

  # Optionally assign a fixed node id (integer)
  # nodeid: 1234

  # This specifies the mode of redundant ring, which may be none, active, or passive.
    # rrp_mode: none
  rrp_mode: active

  interface {
    ringnumber: 0
    # The following values need to be set based on your environment 
    member {
      memberaddr: 192.168.255.243
      }
    member {
      memberaddr: 192.168.255.242
      }
    bindnetaddr: 192.168.0.0 
    broadcast: yes
    mcastport: 5405
    ttl: 1
    }
  transport: udpu
}

amf {
  mode: disabled
}

logging {
  fileline: off
  to_stderr: yes
  to_logfile: no
  to_syslog: yes
  syslog_facility: daemon
  debug: off
  timestamp: on
  logger_subsys {
    subsys: AMF
    debug: off
    tags: enter|leave|trace1|trace2|trace3|trace4|trace6
    }
}




Linux-ha-japan メーリングリストの案内
アーカイブの一覧に戻る