全部博文(368)
分类: Mysql/postgreSQL
2011-04-01 14:14:43
NDB Cluster的硬件需求:
管理节点:对硬件没什么要求,差 一点的机器完全能够胜任
数据节点:可以选择大内存,cpu也相对来讲不错 的,尤其是以后ndbmtd对多核Cpu的支持
Mysql节 点:对cpu要求较高,选择多核,高频CPU较好环境:
Role IP OS Cpu Mem
管理节点(LVS) 192.168.100.223 CentOS 5.5 64bit E5405 @ 2.00GHz 3G
Ndb节点1 192.168.100.231 CentOS 5.5 64bit E5506 @ 2.13GHz 16G
Ndb节点2 192.168.100.232 CentOS 5.5 64bit E5506 @ 2.13GHz 16G
Mysql节点1 192.168.100.225 CentOS 5.5 64bit E5506 @ 2.13GHz 16G
Mysql节点2 192.168.100.226 CentOS 5.5 64bit E5506 @ 2.13GHz 16G
Mysql版本:mysql-5.1.51
NDB版本:ndb-7.1.10
#新建config.ini文件,添加如下内容:
global_defs {
notification_email {
zhangxy@zhang.com
}
notification_email_from zhangxy@zhang.com
smtp_server 192.168.1.250
smtp_connect_timeout 30
router_id LVS_DEV
}
vrrp_instance VI_9 {
state MASTER
interface eth0
virtual_router_id 100
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 2209
}
virtual_ipaddress {
192.168.100.229/24 dev eth0 label eth0:1
}
}
virtual_server 192.168.100.229 3306 {
delay_loop 2
lb_algo wrr
lb_kind DR
nat_mask 255.255.255.0
# persistence_timeout 60
protocol TCP
real_server 192.168.100.225 3306 {
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 3306
}
}
real_server 192.168.100.226 3306 {
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 3306
}
}
}
#!/bin/bash
# description: Config realserver lo and apply noarp
SNS_VIP=192.168.100.229
/etc/rc.d/init.d/functions
case "$1" in
start)
ifconfig lo:0 $SNS_VIP netmask 255.255.255.255 broadcast $SNS_VIP
/sbin/route add -host $SNS_VIP dev lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
sysctl -p >/dev/null 2>&1
echo "RealServer Start OK"
;;
stop)
ifconfig lo:0 down
route del $SNS_VIP >/dev/null 2>&1
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce
echo "RealServer Stoped"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
chenxingzhen0012012-06-13 14:42:29
chenxingzhen0012012-05-29 15:09:57
弄了半天还是没解决,不知道是哪里原因,只好向楼主求救了。
现在是客户端realserver.sh启动后,再启动keepalived的服务端后,服务端就ping不通客户端了,只要把客户端realserver.sh停止或者服务端的keepalived服务停止 后 服务端就能ping通客户端了。
chenxingzhen0012012-05-29 13:55:11
我的keepalived.conf配置如下:
! Configuration File for keepalived
global_defs {
notification_email {
chenxz@chen.com
}
notification_email_from chenxz@chen.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interf
chenxingzhen0012012-05-29 13:52:27
谢谢楼主的回复,我已经改过来了。现在启动keepalived后用tail查看日志信息如下:
[root@sg204 mysql-cluster]# tail -f /var/log/messages
May 29 13:50:11 sg204 Keepalived_healthcheckers: Activating healtchecker for service [172.16.48.208:3306]
May 29 13:50:11 sg204 Keepalived_healthcheckers: Activating healtchecker for service [172.16.48.211:3306]
May 29 13:50:11 sg204 Keepalived_vrrp: VRRP sockpool: [ifindex(3), proto(112), fd(10,11)]
May 29 13:50:12 sg204 Keepalived_vrrp: VRRP_Instance(VI_1) Tran