LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [CentOs - Cluster Suite] It works for IP but not for Tomcat or Postgresql (http://www.linuxquestions.org/questions/linux-newbie-8/%5Bcentos-cluster-suite%5D-it-works-for-ip-but-not-for-tomcat-or-postgresql-808542/)

zdric83 05-18-2010 03:15 AM

[CentOs - Cluster Suite] It works for IP but not for Tomcat or Postgresql
 
Hello everybody!

At first sorry for my english which is not perfect :p

I have made a cluster between two server.

In luci I can see that my cluster is green and the two nodes to.
I have make an IP resource and associate it to a service : green : I can relocate the service from a node to the other one and the IP appears in the list of IP addresses

The problem is that I have made the same in order to configure tomcat and postgresql and it does not work...

I put my configuration only for ip and tomcat:

My host configuration:
Code:

127.0.0.1              localhost.localdomain localhost
::1            localhost6.localdomain6 localhost6

10.0.0.1 server1.domain.com server1
10.0.0.2 server2.domain.com server2

My cluster configuration

Code:

<?xml version="1.0"?>
<cluster alias="my_cluster" config_version="21" name="my_cluster">
        <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="server1.domain.com" nodeid="1" votes="1">
                        <fence/>
                </clusternode>
                <clusternode name="server2.domain.com" nodeid="2" votes="1">
                        <fence/>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices/>
        <rm>
                <failoverdomains/>
                <resources>
                        <ip address="x.x.x.151" monitor_link="1"/>
                        <tomcat-5 catalina_base="/usr/share/tomcat5" catalina_options="" config_file="/etc/tomcat5/tomcat5.conf" name="tomcatres" shutdown_wait="30" tomcat_user="root"/>
                </resources>
                <service autostart="1" exclusive="0" name="ipservice" recovery="relocate">
                        <ip ref="x.x.x.151"/>
                </service>
                <service autostart="0" max_restarts="0" name="tomtom" recovery="restart" restart_expire_time="0">
                        <tomcat-5 ref="tomcatres"/>
                </service>
        </rm>
</cluster>

(I have tried with user tomcat but it's the same)

The error I obtain in the luci log is :

Code:

Tue May 18 10:07:40 2010 clurgmgrd[3878]:  Service service:tomtom is recovering
Tue May 18 10:07:40 2010 clurgmgrd[3878]:  Starting stopped service service:tomtom
Tue May 18 10:07:40 2010 clurgmgrd[3878]:  Stopping service service:tomtom
Tue May 18 10:07:40 2010 clurgmgrd[3878]:  start on tomcat-5 "tomcatres" returned 1 (generic error)
Tue May 18 10:07:40 2010 clurgmgrd[3878]:  #68: Failed to start service:tomtom; return value: 1
Tue May 18 10:07:40 2010 clurgmgrd: [3878]:  Checking Existence Of File /var/run/cluster/tomcat-5/tomcat-5:tomcatres.pid [tomcat-5:tomcatres] > Failed - File Doesn't Exist
Tue May 18 10:07:40 2010 clurgmgrd: [3878]:  Looking For IP Addresses [tomcat-5:tomcatres] > Failed - No IP Addresses Found
Tue May 18 10:07:40 2010 luci[4724]: Unable to retrieve batch 511027733 status from server1.domain.com:11111: module scheduled for execution
Tue May 18 10:07:41 2010 clurgmgrd[3878]:  Service service:tomtom is stopped
Tue May 18 10:07:41 2010 clurgmgrd[3878]:  #71: Relocating failed service service:tomtom
Tue May 18 10:07:46 2010 luci[4724]: Unable to retrieve batch 511027733 status from server1.domain.com:11111: clusvcadm start failed to start tomtom:

The first thing his that I do not understand why he search this PID file (I have the default tomcat configuration). The second one is the IP addresses not found...

FYI : when I start tomcat with "service tomcat start" it works

Thank you :)

zdric83 05-18-2010 04:06 AM

Ok it seems it works now :

Code:

<?xml version="1.0"?>
<cluster alias="mss_cluster" config_version="32" name="mss_cluster">
        <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="server1.domain.com" nodeid="1" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="humanfencing" nodename="server1.domain.com"/>
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="server2.domain.com" nodeid="2" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="humanfencing" nodename="server2.domain.com"/>
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices>
                <fencedevice agent="fence_manual" name="humanfencing"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="failoverDom" nofailback="0" ordered="0" restricted="0">
                                <failoverdomainnode name="server1.domain.com" priority="1"/>
                                <failoverdomainnode name="server2.domain.com" priority="1"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <ip address="x.x.x.151" monitor_link="1"/>
                        <tomcat-5 catalina_base="/usr/share/tomcat5" config_file="/etc/tomcat5/tomcat5.conf" name="tomcat5" shutdown_wait="30" tomcat_user="root"/>
                </resources>
                <service autostart="1" domain="failoverDom" exclusive="0" name="ipservice" recovery="relocate">
                        <ip ref="x.x.x.151">
                                <tomcat-5 ref="tomcat5"/>
                        </ip>
                </service>
        </rm>
</cluster>

I'll check and if all OK I close subject :-D

zdric83 05-18-2010 06:23 AM

To resume with a failover domain it works for postgres but not for tomcat.
Tomcat is still relocate from a node to the other one...

Code:

<?xml version="1.0"?>
<cluster alias="mss_cluster" config_version="43" name="mss_cluster">
        <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="server1.domain.com" nodeid="1" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="humanfencing" nodename="server1.domain.com"/>
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="server2.domain.com" nodeid="2" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="humanfencing" nodename="server2.domain.com"/>
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices>
                <fencedevice agent="fence_manual" name="humanfencing"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="failoverDom" nofailback="1" ordered="0" restricted="0">
                                <failoverdomainnode name="server1.domain.com" priority="1"/>
                                <failoverdomainnode name="server2.domain.com" priority="1"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <ip address="x.x.x.151" monitor_link="1"/>
                        <postgres-8 config_file="/var/lib/pgsql/data/postgresql.conf" name="postgresql" postmaster_user="postgres" shutdown_wait="30"/>
                        <tomcat-5 catalina_base="/usr/share/tomcat5" config_file="/etc/tomcat5/tomcat5.conf" name="tomcat5" shutdown_wait="30" tomcat_user="tomcat"/>
                </resources>
                <service autostart="1" domain="failoverDom" exclusive="0" name="ipservice" recovery="relocate">
                        <ip ref="x.x.x.151">
                                <tomcat-5 ref="tomcat5"/>
                        </ip>
                </service>
        </rm>
</cluster>

Any idea?

zdric83 05-20-2010 04:39 AM

I still have this problem in catalina.out :

Code:

su: invalid option -- D
Try `su --help' for more information.

Maybe there is a problem with the configuration?

Thanks.

zdric83 05-20-2010 08:02 AM

Arf I have found.....

The problem comes from /usr/share/cluster/tomcat-5.sh :
they make this command :

Code:

su "$TOMCAT_USER" -c "$JAVA_HOME/bin/java" $JAVA_OPTS $OCF_RESKEY_catalina_options \
                -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
                -Dcatalina.base="$TOMCAT_gen_catalina_base" \
                -Dcatalina.home="$CATALINA_HOME" \
                -Djava.io.tmpdir="$CATALINA_TMPDIR" \
                org.apache.catalina.startup.Bootstrap "$@" start \
                >> "$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &

instead of :
Code:

su "$TOMCAT_USER" -c "$JAVA_HOME/bin/java $JAVA_OPTS $OCF_RESKEY_catalina_options -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH -Dcatalina.base=$TOMCAT_gen_catalina_base -Dcatalina.home=$CATALINA_HOME -Djava.io.tmpdir=$CATALINA_TMPDIR org.apache.catalina.startup.Bootstrap $@ start">>"$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &

Closed ;)
Thanks


All times are GMT -5. The time now is 04:00 AM.