bcast eth1
|
# /usr/lib/heartbeat/haresources2cib.py --stout -c /etc/ha.d/ha.cf /etc/ha.d/haresources.bak
|
db_cluster1 IPaddr::
Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs
db_cluster1 IPaddr::
Filesystem::192.168.0.34:/mnt/da0/db2::/var/mysql/db2::nfs
|
db_cluster1IPaddr::192.168.0.32 Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs
db_cluster1IPaddr::192.168.0.33 Filesystem::192.168.0.34:/mnt/da0/db2::/var/mysql/db2::nfs
|
db_cluster1IPaddr::192.168.0.32/24/eth0 Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs
db_cluster1IPaddr::192.168.0.33/24/eth0 Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs
|
|
db_cluster1(
节点
1)
|
db_cluster2(
节点
2)
|
mysqld_1
|
basedir: /usr/local/mysql
datadir: /var/mysql/db1
|
basedir: /usr/local/mysql
datadir: /var/mysql/db1
|
Mysqld_2
|
basedir: /usr/local/mysql
datadir: /var/mysql/db2
|
basedir: /usr/local/mysql
datadir: /var/mysql/db2
|
# cp –r –p /usr/local/mysql/var /var/mysql/db1/
# cd /usr/local/mysql
# cp share/mysql/my-medium.cnf /etc/my.cnf
# more /etc/my.cnf
-----------------------------my.cnf 开始 ----------------------------------------------
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = root
[mysqld1]
port = 3306
socket = /tmp/mysql.sock
pid-file = /var/mysql/db1/var/db_cluster1.pid
datadir = /var/mysql/db1/var
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#log-bin=mysql-bin
server-id = 1
[mysqld2]
port = 3307
socket = /tmp/mysql2.sock
pid-file = /var/mysql/db2/var/db_cluster1.pid
datadir = /var/mysql/db2/var
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#log-bin=mysql-bin
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
-------------------------------------my.cnf
结束
------------------------------------------------------------
#
export PATH=$PATH:/usr/local/mysql/bin:.
(
可以将其放置于
/etc/profile
文件
)
|
# more /etc/ha.d/haresources.bak
db_cluster1 IPaddr::192.168.0.32 Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs mysqld_m::1
db_cluster2 IPaddr::192.168.0.33 Filesystem::192.168.0.34:/mnt/da0/db2::/var/mysql/db2::nfs mysqld_m::2
#
/usr/lib/heartbeat/haresources2cib.py --stout -c /etc/ha.d/ha.cf /etc/ha.d/haresources.bak
重新生成
cib.xml
|
# cp –r –p /usr/local/mysql/var /var/mysql/db2/
# cd /usr/local/mysql
# cp share/mysql/my-medium.cnf /etc/my.cnf
# more /etc/my.cnf
-----------------------------my.cnf 开始 ---------------------------------------------- # 与 db_cluster1 机器上的配置是一样的 , 从上边拷贝一下即可 # 可以这样 : # scp 192.168.0.30:/etc/my.cnf /etc/
-------------------------------------my.cnf
结束
---------------------------------------
#
export PATH=$PATH:/usr/local/mysql/bin:.
(
可以将其放置于
/etc/profile
文件
)
|
# more /etc/ha.d/haresources.bak
db_cluster1 IPaddr::192.168.0.32 Filesystem::192.168.0.34:/mnt/da0/db1::/var/mysql/db1::nfs mysqld_m::1
db_cluster2 IPaddr::192.168.0.33 Filesystem::192.168.0.34:/mnt/da0/db2::/var/mysql/db2::nfs mysqld_m::2
#
/usr/lib/heartbeat/haresources2cib.py --stout -c /etc/ha.d/ha.cf /etc/ha.d/haresources.bak
重新生成
cib.xml,
建议先把原来的删除
(/var/lib/heartbeat/crm/)
|