文章分类 | 推荐文章 | 最新文章 | 热点文章 | 最新软件 | 精品软件 | 下载排行 | 推荐下载 | WPS | 杀毒软件
清风网络
首 页 软件下载 网络学院
QQ 电脑入门 游戏 操作系统 图形处理 办公软件 媒体动画 精文荟萃 工具软件 网络编程 程序开发 网络技术 认证考试 网站建设 文章专栏
当前位置:清风网络网络编程MYSQLHow To Set Up A Load-Balanced MySQL Cluster - Part 7
精品推荐
特别推荐
·MYSQL数据的导出导入与版本的转换
·MySQL数据库简介
·安全的配置和应用MySQL数据库
·修改MySQL的默认密码
·初学MYSQL应知道:Mysql参数优化
·数据库安全应用 使用MySQL的23个注意事项
·入门:MYSQL基础
·轻松描述Windows上安装多个Mysql的步骤
·安装与卸载MySQL数据库系统服务的常见问题
·Mysql 安全注意事项
热点TOP10
·MYSQL数据的导出导入与版本的转换
·工作笔记:配置MySQL为高可用集群
·轻松八句话 教会你完全搞定MySQL数据库
·MySQL数据库简介
·强烈推荐,MySQL服务维护笔记
·MySQL数据库系统的常规管理介绍
·MySQL数据库学习手册之用MySQL解决一些常见问题
·安装与卸载MySQL数据库系统服务的常见问题
·Oracle 中使用层次查询方便处理财务报表
·Mysql的distinct语句和group by,order by

How To Set Up A Load-Balanced MySQL Cluster - Part 7

日期:2007年7月2日 作者: 查看:[大字体 中字体 小字体]

6.4 Create A Database Called ldirector

Next we create the ldirector database on our MySQL cluster nodes sql1.example.com and sql2.example.com. This database will be used by our load balancers to check the availability of the MySQL cluster nodes.

sql1.example.com:

mysql -u root -p
GRANT ALL ON ldirectordb.* TO 'ldirector'@'%' IDENTIFIED BY 'ldirectorpassword';
FLUSH PRIVILEGES;
CREATE DATABASE ldirectordb;
USE ldirectordb;
CREATE TABLE connectioncheck (i INT) ENGINE=NDBCLUSTER;
INSERT INTO connectioncheck () VALUES (1);
quit;

sql2.example.com:

mysql -u root -p
GRANT ALL ON ldirectordb.* TO 'ldirector'@'%' IDENTIFIED BY 'ldirectorpassword';
FLUSH PRIVILEGES;
CREATE DATABASE ldirectordb;
quit;

 

6.5 Prepare The MySQL Cluster Nodes For Load Balancing

Finally we must configure our MySQL cluster nodes sql1.example.com and sql2.example.com to accept requests on the virtual IP address 192.168.0.105.

sql1.example.com / sql2.example.com:

apt-get install iproute

Add the following to /etc/sysctl.conf:

sql1.example.com / sql2.example.com:

vi /etc/sysctl.conf

# Enable configuration of arp_ignore option
net.ipv4.conf.all.arp_ignore = 1

# When an arp request is received on eth0, only respond if that address is
# configured on eth0. In particular, do not respond if the address is
# configured on lo
net.ipv4.conf.eth0.arp_ignore = 1

# Ditto for eth1, add for all ARPing interfaces
#net.ipv4.conf.eth1.arp_ignore = 1


# Enable configuration of arp_announce option
net.ipv4.conf.all.arp_announce = 2

# When making an ARP request sent through eth0 Always use an address that
# is configured on eth0 as the source address of the ARP request. If this
# is not set, and packets are being sent out eth0 for an address that is on
# lo, and an arp request is required, then the address on lo will be used.
# As the source IP address of arp requests is entered into the ARP cache on
# the destination, it has the effect of announcing this address. This is
# not desirable in this case as adresses on lo on the real-servers should
# be announced only by the linux-director.
net.ipv4.conf.eth0.arp_announce = 2

# Ditto for eth1, add for all ARPing interfaces
#net.ipv4.conf.eth1.arp_announce = 2

sysctl -p


[1] [2] 下一页 



上一篇:MS-SQL数据库开发常用汇总

下一篇:How To Set Up A Load-Balanced MySQL Cluster - Part 4

相关文章:
·Windows XP下PHP+MySQL环境搭建
·MYSQL数据的导出导入与版本的转换
·工作笔记:配置MySQL为高可用集群
·轻松八句话 教会你完全搞定MySQL数据库
·MySQL数据库简介
·强烈推荐,MySQL服务维护笔记
·MySQL数据库系统的常规管理介绍
·MySQL数据库学习手册之用MySQL解决一些常见问题
·PHP+MySQL 购物车程序实例
·安装与卸载MySQL数据库系统服务的常见问题
相关软件:

特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
[打印本页] [关闭窗口] 转载请注明来源:http://www.vipcn.net
| 帮助(?) | 版权声明 | 友情连接 | 关于我们 | 信息发布
Copyright 2007 www.vipcn.net All Rights Reserved. 鄂ICP备05000083号Powered by:viphot