亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 6068 | 回復: 9
打印 上一主題 下一主題

rhcs floating IP 的問題 [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-11-21 14:34 |只看該作者 |倒序瀏覽
有2臺HP DL580,均安裝了RHEL5.1及其自帶的rhcs相關(guān)rpm,
分配的資源有:
floating1: ip:10.82.114.4
floating2: ip:10.30.7.185
script1: 默認的vsftpd腳本
script2: my_sample腳本  (這個腳本是起一個簡單的perl script,去create 一個 port,bind到floating ip 1上面,然后listen等連接,用于演示問題)

在cluster 管理界面創(chuàng)建2個service
service1:scrpit1,floating ip1,floating ip2
service2:script2, floating ip1
不同時enable,第一次enable service1,vsftpd服務(wù)正常起來,能夠通過floating IP連接,實驗成功。
diable了service1,enable service2,發(fā)現(xiàn)bind不到floating ip,報錯退出。

對比兩個service的輸出的/var/log/messages消息,發(fā)現(xiàn)起vsftpd服務(wù)的時候,avahi-daemon會現(xiàn)Register 兩個floating ip到相應的interface,而起sample服務(wù)的時候,則沒有做這個動作,導致my_sample腳本調(diào)用的時候,floating IP是不存在的,后面的bind肯定是失敗的了,實驗了mysqld,tomcat的服務(wù),也是因為沒有Register floating IP造成失敗。

問題是:為什只有vsftpd服務(wù)的時候,rhcs回去讓avahi-daemon register floating IP?
反復對比了cluster.conf文件,看不出哪里不一樣的。

論壇徽章:
0
2 [報告]
發(fā)表于 2008-11-21 14:50 |只看該作者

回復 #1 PinkOrient 的帖子

補充1:
/etc/cluster/cluster.conf

<?xml version="1.0"?>
<cluster config_version="32" name="eadb_cluster">
        <quorumd interval="2" label="quodisk" min_score="1" tko="10" votes="3">
                <heuristic interval="2" program="ping 10.82.114.1 -c1 -t1" score="1"/>
        </quorumd>
        <fence_daemon post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="eadb01.smartone.com" nodeid="1" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="eadb01_ilo"/>
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="eadb02.smartone.com" nodeid="2" votes="1">
                        <fence>
                                <method name="1">
                                        <device name="eadb02_ilo"/>
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <cman/>
        <fencedevices>
                <fencedevice agent="fence_ilo" hostname="192.168.0.10" login="Administrator" name="eadb01_ilo" passwd="password"/>
                <fencedevice agent="fence_ilo" hostname="192.168.0.11" login="Administrator" name="eadb02_ilo" passwd="password"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="eadb_fd" ordered="0" restricted="0">
                                <failoverdomainnode name="eadb01.smartone.com" priority="1"/>
                                <failoverdomainnode name="eadb02.smartone.com" priority="1"/>
                        </failoverdomain>
                        <failoverdomain name="eadb_service" ordered="0" restricted="0">
                                <failoverdomainnode name="eadb01.smartone.com" priority="1"/>
                                <failoverdomainnode name="eadb02.smartone.com" priority="1"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <ip address="10.82.114.4" monitor_link="1"/>
                        <script file="/etc/rc.d/init.d/vsftpd" name="vsftpd"/>
                        <clusterfs device="/dev/VolGroup00/LogVol00" force_unmount="1" fsid="53287" fstype="gfs" mountpoint="/gfs1" name="gfs_db_space" options=""/>
                        <clusterfs device="/dev/VolGroup01/LogVol01" force_unmount="1" fsid="1552" fstype="gfs" mountpoint="/gfs2" name="gfs_eadb_space" options=""/>
                        <mysql config_file="/etc/my.cnf" listen_address="0.0.0.0" mysql_options="" name="mysql_eadb" shutdown_wait="0"/>
                        <script file="/etc/init.d/tomcat_eadb" name="tomcat_eadb"/>
                        <tomcat-5 catalina_base="eadbmgr" catalina_options="/gfs2/eadb/jakarta-tomcat-5.0.30/conf" config_file="eadb_tomcat" name="/gfs2/eadb/jakarta-tomcat-5.0.30/conf/Catalina" shutdown_wait="" tomcat_user=""/>
                        <script file="/etc/init.d/tomcat5" name="tomcat"/>
                        <ip address="10.30.7.185" monitor_link="1"/>
                        <script file="/etc/init.d/my_sample" name="my_sample"/>
                </resources>
                <service autostart="1" domain="eadb_fd" name="vsftpd">
                        <script ref="vsftpd"/>
                        <ip ref="10.82.114.4"/>
                        <ip ref="10.30.7.185"/>
                </service>
                <service autostart="1" domain="eadb_service" exclusive="1" name="eadb">
                        <ip ref="10.82.114.4"/>
                        <clusterfs ref="gfs_db_space"/>
                        <clusterfs ref="gfs_eadb_space"/>
                        <mysql ref="mysql_eadb"/>
                        <script ref="tomcat_eadb"/>
                        <ip ref="10.30.7.185"/>
                </service>
                <service autostart="1" domain="eadb_service" name="tc">
                        <ip ref="10.82.114.4"/>
                        <script ref="tomcat"/>
                </service>
                <service autostart="1" exclusive="1" name="mysql">
                        <ip ref="10.82.114.4"/>
                        <ip ref="10.30.7.185"/>
                        <clusterfs ref="gfs_db_space"/>
                        <mysql ref="mysql_eadb"/>
                </service>
                <service autostart="1" domain="eadb_fd" name="sample" recovery="restart">
                        <ip ref="10.82.114.4"/>
                        <script ref="my_sample"/>
                </service>
        </rm>
</cluster>
==================
補充2:
my_sample service腳本調(diào)用的 perl script, eadb_sm.pl

#!/usr/bin/perl
use Socket;


# make the socket
socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
# so we can restart our server quickly
setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1);
# build up my socket address
$ip="10.82.114.4";
$port=9999;
#$my_addr = sockaddr_in($port, INADDR_ANY);
$my_addr = sockaddr_in($port, inet_aton($ip));
bind(SERVER, $my_addr)
        or die "Couldn't bind to port $server_port : $!\n";
# establish a queue for incoming connections
listen(SERVER, SOMAXCONN)
        or die "Couldn't listen on port $server_port : $!\n";
# accept and process connections
        while (accept(CLIENT, SERVER)) {
# do something with CLIENT
                while(1) {
                        print stderr "Someone connected\n";
                        $bs = sysread(CLIENT, $buff, 204;
                        if ($bs) {
                                ($l, $s) = unpack("na*", $buff);
                                print stderr "Received: $l bytes, content:\n $s\n";

                                $tmp = "Received!!!";
                                $tosend = pack("na*", length($tmp), $tmp);
                                $bs = syswrite(CLIENT, $tosend);
                                if ($bs) {
                                        print stderr "Sent: $tmp\n";
                                        print stderr "=======================================\n";
                                } else {
                                        print stderr "failed to send, exit";
                                }
                                last;
                        } else {
                                #print stderr "Nothing comes sleep for a while\n";
                                #sleep(1);
                                next;
                        }
                }
                close(CLIENT);
                print stderr "Disconnected\n";
        }
close(SERVER);
==================
補充3:
/var/log/messages信息
起vsftpd之前有注冊floating ip,起另外一個沒有
=====================
Nov 20 17:26:52 eadb01 clurgmgrd[1577]: <notice> Starting disabled service service:vsftpd
Nov 20 17:26:52 eadb01 avahi-daemon[7970]: Registering new address record for 10.82.114.4 on bond0.
Nov 20 17:26:53 eadb01 avahi-daemon[7970]: Registering new address record for 10.30.7.185 on bond1.
Nov 20 17:26:55 eadb01 clurgmgrd[1577]: <notice> Service service:vsftpd started
Nov 20 17:26:57 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33631
Nov 20 17:27:28 eadb01 last message repeated 3 times
Nov 20 17:27:45 eadb01 last message repeated 2 times
Nov 20 17:28:00 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:28:00 eadb01 snmpd[5659]: Received SNMP packet(s) from UDP: [127.0.0.1]:33632
Nov 20 17:28:10 eadb01 clurgmgrd[1577]: <notice> Stopping service service:vsftpd
Nov 20 17:28:11 eadb01 avahi-daemon[7970]: Withdrawing address record for 10.30.7.185 on bond1.
Nov 20 17:28:15 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:28:16 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:28:21 eadb01 avahi-daemon[7970]: Withdrawing address record for 10.82.114.4 on bond0.
Nov 20 17:28:31 eadb01 clurgmgrd[1577]: <notice> Service service:vsftpd is disabled
Nov 20 17:28:31 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:28:35 eadb01 clurgmgrd[1577]: <notice> Starting disabled service service:sample
Nov 20 17:28:35 eadb01 clurgmgrd[1577]: <notice> Service service:sample started
Nov 20 17:28:43 eadb01 clurgmgrd: [1577]: <err> script:my_sample: status of /etc/init.d/my_sample failed (returned 2)
Nov 20 17:28:43 eadb01 clurgmgrd[1577]: <notice> status on script "my_sample" returned 1 (generic error)
Nov 20 17:28:43 eadb01 clurgmgrd[1577]: <notice> Stopping service service:sample
Nov 20 17:28:43 eadb01 clurgmgrd[1577]: <notice> Service service:sample is recovering
Nov 20 17:28:44 eadb01 clurgmgrd[1577]: <notice> Service service:sample is now running on member 2
Nov 20 17:28:46 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:29:17 eadb01 last message repeated 3 times
Nov 20 17:29:33 eadb01 last message repeated 2 times
Nov 20 17:29:43 eadb01 clurgmgrd[1577]: <notice> Stopping service service:sample
Nov 20 17:29:43 eadb01 clurgmgrd[1577]: <notice> Service service:sample is disabled
Nov 20 17:29:48 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:29:49 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33632
Nov 20 17:30:04 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33634
Nov 20 17:30:04 eadb01 snmpd[5659]: Received SNMP packet(s) from UDP: [127.0.0.1]:33634
Nov 20 17:30:05 eadb01 clurgmgrd[1577]: <notice> Starting disabled service service:sample
Nov 20 17:30:05 eadb01 clurgmgrd[1577]: <notice> Service service:sample started
Nov 20 17:30:13 eadb01 clurgmgrd: [1577]: <err> script:my_sample: status of /etc/init.d/my_sample failed (returned 2)
Nov 20 17:30:13 eadb01 clurgmgrd[1577]: <notice> status on script "my_sample" returned 1 (generic error)
Nov 20 17:30:13 eadb01 clurgmgrd[1577]: <notice> Stopping service service:sample
Nov 20 17:30:13 eadb01 clurgmgrd[1577]: <notice> Service service:sample is recovering
Nov 20 17:30:14 eadb01 clurgmgrd[1577]: <notice> Service service:sample is now running on member 2
Nov 20 17:30:19 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33634
Nov 20 17:30:20 eadb01 snmpd[5659]: Connection from UDP: [127.0.0.1]:33634
Nov 20 17:30:27 eadb01 clurgmgrd[1577]: <notice> Stopping service service:sample
Nov 20 17:30:27 eadb01 clurgmgrd[1577]: <notice> Service service:sample is stopped
Nov 20 17:30:27 eadb01 clurgmgrd[1577]: <notice> Starting stopped service service:sample
Nov 20 17:30:27 eadb01 clurgmgrd[1577]: <notice> Service service:sample started
Nov 20 17:30:30 eadb01 clurgmgrd[1577]: <notice> Stopping service service:sample
Nov 20 17:30:30 eadb01 clurgmgrd[1577]: <notice> Service service:sample is disabled

論壇徽章:
0
3 [報告]
發(fā)表于 2008-11-21 20:20 |只看該作者

回復 #1 PinkOrient 的帖子

從你的實現(xiàn)目的上分析要考慮資源組
status on script "my_sample" returned 1 (generic error)
這個說明腳步本身存在問題,啟動失敗
同時你要主機fw的規(guī)則是否禁止了數(shù)據(jù)包的傳送

論壇徽章:
0
4 [報告]
發(fā)表于 2008-11-22 00:37 |只看該作者

回復 #3 kns1024wh 的帖子

多謝回復,請再浪費點時間看看我的/var/log/messages.

腳本在rhcs外面用service my_sample start/stop/status 測試是OK的,當然這時候bind的IP指定的是一個static的IP。
如果我在rhcs里面指定bind IP到0.0.0.0的話,也是跑的沒問題的,但是這個時候通過floating IP connect不到我的sample服務(wù)。

你這里指出來的出錯,是因為我讓服務(wù)bind到floating IP上,而rhcs在起我的script之前,卻沒有通過avahi-daemon去register floating IP到interface上,所以進程被start之后,bind 失敗,自然是die掉了,接著rhcs通過status去monitor進程,自然是看到進程不到,就報出這個錯了。

我想問的就是,為什么只有vsftpd這個service的時候,rhcs回去通過avahi-daemon吧floating IP做register,而其他的service卻沒有做這一步,造成bind floating IP失?

論壇徽章:
0
5 [報告]
發(fā)表于 2008-11-22 00:38 |只看該作者

回復 #3 kns1024wh 的帖子

多謝回復,請再浪費點時間看看我的/var/log/messages.

腳本在rhcs外面用service my_sample start/stop/status 測試是OK的,當然這時候bind的IP指定的是一個static的IP。
如果我在rhcs里面指定bind IP到0.0.0.0的話,也是跑的沒問題的,但是這個時候通過floating IP connect不到我的sample服務(wù)。

你這里指出來的出錯,是因為我讓服務(wù)bind到floating IP上,而rhcs在起我的script之前,卻沒有通過avahi-daemon去register floating IP到interface上,所以進程被start之后,bind 失敗,自然是die掉了,接著rhcs通過status去monitor進程,自然是看到進程不到,就報出這個錯了。

我想問的就是,為什么只有vsftpd這個service的時候,rhcs回去通過avahi-daemon吧floating IP做register,而其他的service卻沒有做這一步,造成bind floating IP失?

論壇徽章:
0
6 [報告]
發(fā)表于 2008-11-22 20:38 |只看該作者
有人幫忙解釋一下rhcs的float IP的原理以及如何配置嗎?

未解決,頂一下不要沉了。

論壇徽章:
0
7 [報告]
發(fā)表于 2008-11-24 21:50 |只看該作者
再次頂起。。。。。

昨天用兩臺vmware做試驗,情況依然如此,也是只有vsftpd的那個service會有register floating IP的動作,
后來想了個辦法,在vsftpd的service的基礎(chǔ)上,加上我要的服務(wù)的script,比如httpd,居然可以了,
非常奇怪,難道rhcs一定要帶著vsftpd才能玩?百思不得其解。

論壇徽章:
0
8 [報告]
發(fā)表于 2008-11-25 23:24 |只看該作者
這次搞定了,有同事幫我找到showrun之前發(fā)的經(jīng)驗,然后經(jīng)過試驗,解決了。

總結(jié)的經(jīng)驗就是,加到Service的resource應該是分層次的,之前的誤區(qū)在于,把

IP 和 scripts這些resource當做相同層次的,都用“Add a Shared Resource to this service",

正確的做法應該是先用這個按鈕添加script,然后選中scripts,點擊”Attach a  Shared/Private Resource to the selection",

把script要用到的其他resource Attach到腳本上面,呈樹狀關(guān)系。




這樣rhcs startup這個service的時候,會從樹葉開始把resource分配好或者運行好

Nov 21 08:05:05 node0 clurgmgrd[2755]: <notice> Starting disabled service service:httpd
Nov 21 08:05:10 node0 avahi-daemon[2604]: Registering new address record for 192.168.0.80 on eth0.
Nov 21 08:05:12 node0 avahi-daemon[2604]: Registering new address record for 192.168.0.15 on eth0.
Nov 21 08:05:13 node0 clurgmgrd[2755]: <notice> Service service:httpd started
Nov 21 08:05:32 node0 clurgmgrd[2755]: <notice> Stopping service service:httpd
Nov 21 08:05:32 node0 avahi-daemon[2604]: Withdrawing address record for 192.168.0.15 on eth0.
Nov 21 08:05:43 node0 avahi-daemon[2604]: Withdrawing address record for 192.168.0.80 on eth0.
Nov 21 08:05:56 node0 clurgmgrd[2755]: <notice> Service service:httpd is disabled

我的理解和showrun的相反,他的例子是把floating IP作為第一個加入service的resource,然后在上面attach上
gfs和script,但是我把script attache在floating IP下的時候發(fā)現(xiàn)rhcs并沒有register 這個IP,反之則OK了。

[ 本帖最后由 PinkOrient 于 2008-11-25 23:30 編輯 ]

rhcs.jpg (95.76 KB, 下載次數(shù): 18)

rhcs.jpg

論壇徽章:
0
9 [報告]
發(fā)表于 2008-11-25 23:29 |只看該作者
附上 cluster.conf 文件和測試結(jié)果
配置了4個service做試驗
httpd             可以正常工作,rhcs register了2個floating IP,然后運行script
httpd2           可以正常工作
httpd3           不能正常工作,沒有register floating IP
httpd4           不能正常工作,沒有register floating IP
=========================

<?xml version="1.0"?>
<cluster alias="new_cluster" config_version="40" name="new_cluster">
        <fence_daemon post_fail_delay="0" post_join_delay="3"/>
        <clusternodes>
                <clusternode name="node0" nodeid="1" votes="1">
                        <fence/>
                </clusternode>
                <clusternode name="node1" nodeid="2" votes="1">
                        <fence/>
                </clusternode>
        </clusternodes>
        <cman expected_votes="1" two_node="1"/>
        <fencedevices>
                <fencedevice agent="fence_manual" name="mf"/>
        </fencedevices>
        <rm>
                <failoverdomains>
                        <failoverdomain name="ftpd" ordered="1" restricted="0">
                                <failoverdomainnode name="node0" priority="1"/>
                                <failoverdomainnode name="node1" priority="2"/>
                        </failoverdomain>
                </failoverdomains>
                <resources>
                        <ip address="192.168.0.15" monitor_link="1"/>
                        <script file="/etc/init.d/httpd" name="httpd"/>
                        <ip address="192.168.0.80" monitor_link="1"/>
                </resources>
                <service autostart="1" domain="ftpd" exclusive="1" name="httpd" recovery="relocate">
                        <script ref="httpd">
                                <ip ref="192.168.0.80"/>
                                <ip ref="192.168.0.15"/>
                        </script>
                </service>
                <service autostart="1" domain="ftpd" name="httpd2" recovery="restart">
                        <script ref="httpd">
                                <ip address="192.168.0.200" monitor_link="1"/>
                        </script>
                </service>
                <service autostart="1" domain="ftpd" name="httpd3" recovery="restart">
                        <ip ref="192.168.0.80"/>
                        <script ref="httpd"/>
                </service>
                <service autostart="1" name="httpd4">
                        <ip ref="192.168.0.15">
                                <script ref="httpd"/>
                        </ip>
                </service>
        </rm>
</cluster>

論壇徽章:
0
10 [報告]
發(fā)表于 2010-11-19 08:58 |只看該作者
你的script沒有status的輸出
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP