[Linux-ha-jp] tomcatのリソース定義ファイル記述方法に関しまして

Back to archive index

よしばー kitab****@gmail*****
2015年 2月 10日 (火) 11:19:40 JST


$B>>EgMM(B

$B8f@$OC$K$J$C$F$*$j$^$9!#(B
$BKLNS$G$9!#(B

$B?=$7Lu$"$j$^$;$s!"(B
$B>>EgMM$N<j=g$r;29M$K$5$;$FD:$-$^$7$?$,!"(B
tomcat$B$rG'<1$5$;$k$3$H$,=PMh$^$;$s$G$7$?!#(B

$B$H$F$bCzG+$K$o$+$j0W$/2r @ b$7$F$/$@$5$C$F$$$k$N$K!"(B
$BNOITB-$G$*CQ$:$+$7$$$G$9!#(B

$B2?EY$b$*<j?t$r$*$+$1$7?=$7Lu$J$$$N$G$9$,!"(B
$B0J2<$K;d$,9T$C$?@_DjFbMF$H<j=g$r5-:\CW$7$^$9!#(B
$B4V0c$C$F$$$kE @ Ey!"$4;XE&$$$?$@$1$J$$$G$7$g$&$+!#(B
$B!J$9$_$^$;$s!"D9$/$J$j$^$9(B;;$B!K(B

$B!Z(BOS$B![(B
RHEL6.5

$B!Z%[%9%HL>![(B
$B%5!<%P(B1$B!'(Bfirst
$B%5!<%P(B2$B!'(Bsecond

$B!Z(BNIC$B![(B
$B%5!<%P(B1
$B!!%5!<%S%9(B(eth0)$B!'(B172.16.87.233
  $B;`3h4F;k(B(eth1)$B!'(B192.168.1.1
$B%5!<%P(B2
$B!!%5!<%S%9(B(eth0)$B!'(B172.16.87.234
  $B;`3h4F;k(B(eth1)$B!'(B192.168.1.2

$B2>A[(BIP:172.16.87.235

$B"((B2$BBf$H$b!"(BSELINUX$B!&(Biptables$B$ODd;_(B
$B"((Bping$B$K$h$k@\B33NG':Q(B


$B!c-!(Bpacemaker$B$G%/%i%9%?9=@.!J(Bfirst$B!&(Bsecond$BN>%5!<%P$G @ _Dj!K!d(B

1.pacemaker-repo-1.1.12-1.1.el6.x86_64.rpm$B$r(B/opt$B2<$KG[CV(B

2.#rpm -ivh pacemaker-repo-1.1.12-1.1.el6.x86_64.rpm

3.#yum install pacemaker-all -y

4.#vi /etc/corosync/corosync.conf

(/etc/corosync/corosync.conf$B @ _DjFbMF!K(B
# Please read the corosync.conf.5 manual page
totem {
        version: 2

        crypto_cipher: none
        crypto_hash: none

        interface {
                ringnumber: 0
                bindnetaddr: 192.168.1.0
                mcastport: 5405
                ttl: 1
        }
        transport: udpu
}

logging {
        fileline: off
        to_logfile: yes
        to_syslog: no
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: QUORUM
                debug: off
        }
}

nodelist {
        node {
                ring0_addr: 192.168.1.1
                nodeid: 1
        }

        node {
                ring0_addr: 192.168.1.2
                nodeid: 2
        }
}

quorum {
        # Enable and configure quorum subsystem (default: off)
        # see also corosync.conf.5 and votequorum.5
        provider: corosync_votequorum
        expected_votes: 2
}

5.#corosync-keygen -l (first$B%5!<%P$N$_(B)

6.#scp -p /etc/corosync/authkey second:/etc/corosync/authkey$B!!!J(Bfirst$B%5!<%P$N$_!K(B

7.# vi /etc/sysconfig/pacemaker
$B!J(Bexport PCMK_fail_fast=yes$B"+%3%a%s%H%"%&%H$r30$7!"@_DjCM$r!V(Byes$B!W$K!K(B

8. vi /etc/init/pacemaker.combined.conf
$B!J(Bstop on runlevel [0123456] $B"+0l9TDI2C!K(B
 (pidof corosync || false $B"+%3%a%s%H%"%&%H$r$O$:$9(B)

9.# initctl start pacemaker.combined

10.#crm_mon -fAD1

($B=PNO7k2L(B)
Online: [ first second ]


Node Attributes:
* Node first:
* Node second:

Migration summary:
* Node second:
* Node first:

$B!c-"(Btomcat$BF3F~!J(Bfirst$B!&(Bsecond$BN>%5!<%P$G @ _Dj!K!d(B

1$B!%(Byum install java-1.8.0-openjdk-devel -y

2.#java -version
$B!J=PNO7k2L!K(B
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.0.el6_6-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
$B"((B"java1.8.0"$B$r%$%s%9%H!<%k$7$^$7$?$,!"(B#java -version$B=PNO7k2L$,(B"1.7.0_75"$B$G$7$?!#(B
$B$=$N$^$^@_Dj$r?J$a$^$7$?!#(B

3$B!%(Bapache-tomcat-8.0.18.tar.gz$B$r(B/opt$B$KG[CV$9$k!#(B

4.#tar -zxf apache-tomcat-8.0.18.tar.gz

5.#useradd -s /sbin/nologin tomcat

6.# pwd
$B!!(B/opt

7.#mv apache-tomcat-8.0.18 /var/lib/tomcat

8.#chown tomcat. -R /var/lib/tomcat

9.#/var/lib/tomcat/bin/startup.sh $B"M%V%i%&%6$G(Btomcat$B5/F03NG'(B

10.#/var/lib/tomcat/bin/shutdown.sh


$B!c-#(BApache$BF3F~!J(Bfirst$B!&(Bsecond$BN>%5!<%P$G @ _Dj!K!d(B

1.yum install -y httpd

2.service httpd start $B"M%V%i%&%6$G(BApache$BF0:n3NG'(B

3.service httpd stop

$B"((Btomcat,Apache$BO"7H$O9T$C$F$*$j$^$;$s!#(B


$B!c-$(BPacemaker$B$N%j%=!<%9 @ _Dj!J(Bfirst$B%5!<%P$G$N$_ @ _Dj!K!d(B

1$B!%(B/opt$B$K$F!"(B"20150209crm.txt"$B:n @ .!&JT=8(B

$B!J(B20150209crm.txt$B @ _DjFbMF!K(B
node 1: first
node 2: second
primitive vipcheck ocf:heartbeat:VIPcheck \
        params \
                target_ip="172.16.87.235" \
                count=3 \
                wait=5 \
        op start   interval=0  timeout=60 on-fail="restart" \
        op stop    interval=0  timeout=60 on-fail="ignore" \
        op monitor interval=10 timeout=60 on-fail="restart" start-delay=0
primitive tomcat ocf:heartbeat:tomcat \
        params \
                java_home="/usr/lib/jvm/java-1.7.0-openjdk.x86_64" \$B"+JQ99$7$^$7$?(B
                catalina_home="/var/lib/tomcat" \
                tomcat_user="tomcat" \
        op start   interval=0  timeout=60  on-fail="restart" \
        op stop    interval=0  timeout=120 on-fail="ignore" \
        op monitor interval=10 timeout=30  on-fail="restart"
primitive apache ocf:heartbeat:apache \
        op start   interval=0  timeout=40 on-fail="restart" \
        op stop    interval=0  timeout=60 on-fail="ignore" \
        op monitor interval=10 timeout=20 on-fail="restart"
primitive vip ocf:heartbeat:IPaddr2 \
        params \
$B!!!!!!(B  ip="172.16.87.235 \
        op start   interval=0  timeout=20 on-fail="restart" \
        op stop    interval=0  timeout=20 on-fail="ignore" \
        op monitor interval=10 timeout=20 on-fail="restart"
group web-group \
        vipcheck tomcat apache vip
property cib-bootstrap-options: \
        (dc-version=1.1.12-561c4cf \)$B"+:o=|$7$^$7$?(B
        cluster-infrastructure=corosync \
        no-quorum-policy=ignore \
        stonith-enabled=false \
        pe-input-series-max=3000 \
        pe-error-series-max=3000 \
        pe-warn-series-max=3000
rsc_defaults rsc-options: \
        resource-stickiness=INFINITY \
        migration-threshold=1

2.# crm configure load update 20150209crm.txt

3.# crm_mon -fAD1

($B=PNO7k2L(B)
online: [ first second ]

 Resource Group: web-group
     vipcheck   (ocf::heartbeat:VIPcheck):      Started first
     tomcat     (ocf::heartbeat:tomcat):        Stopped
     apache     (ocf::heartbeat:apache):        Stopped
     vip        (ocf::heartbeat:IPaddr2):       Stopped

Node Attributes:
* Node first:
* Node second:

Migration summary:
* Node second:
   tomcat: migration-threshold=1 fail-count=1000000 last-failure='Tue
Feb 10 10:50:55 2015'
* Node first:
   tomcat: migration-threshold=1 fail-count=1000000 last-failure='Tue
Feb 10 11:01:04 2015'
Failed actions:
tomcat_start_0 on second 'unknown error' (1): call=20, status=Timed Out,
last-rc-change='Tue Feb 10 10:49:55 2015', queued=0ms, exec=60002ms
    tomcat_start_0 on first 'unknown error' (1): call=20, status=Timed Out,
last-rc-change='Tue Feb 10 11:00:04 2015', queued=0ms, exec=60002ms



$B0J>e$G$9!#(B
tomcat,apache,vip$B$b5/F0$7$J$$$H$$$&>uBV$K$J$C$F$7$^$$$^$7$?!#(B

$B$*<j?t$r$*$+$1$7?=$7Lu$"$j$^$;$s!#(B
$B=$@5$9$Y$-E@$r65$($FD:$1$J$$$G$7$g$&$+!#(B
$B$h$m$7$/$*4j$$CW$7$^$9!#(B


2015/02/09 Takehiro Matsushima <takeh****@gmail*****>:
> $BKLNS(B $B$5$s(B
>
> $B>>Eg$G$9!#(B
> $B:#2s$N7o$G!"BgJQJY6/$K$J$j$^$7$?!#(B
> Tomcat$B$b$[$H$s$I=i$a$F?($C$?$N$GLLGr$+$C$?$G$9!#(B
>
> RHEL6.5 vs CentOS6.6$B$G0[$J$j$^$9$,!"$*$=$i$/:#2s$NHOaF$G$O(B
> $BBg$-$J:9$O$J$$$H9M$($^$7$?!#(B
> $B$^$?!"(BPacemaker$B$G@)8f$9$k$3$H$,A0Ds$G$7$?$N$G!"(B/etc/init.d/tomcat$B$r(B
> $B:n$i$:$K?J$a$^$7$?!#(B
>
> $BLdBj$N7P2a$K$D$-$^$7$F!"$*BT$A$7$F$*$j$^$9!#(B
>
> ----
> Takehiro Matsushima
> _______________________________________________
> Linux-ha-japan mailing list
> Linux****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/linux-ha-japan
>





Linux-ha-japan メーリングリストの案内
Back to archive index