How To Set Up A Load-Balanced MySQL Cluster - Part 2
2007-11-11 15:44:35 来源:WEB开发网3 Set Up The MySQL(和PHP搭配之最佳组合) Cluster Nodes (Storage Nodes)
Now we install MySQL(和PHP搭配之最佳组合)-max-5.0.19 on both sql1.example.com and sql2.example.com:
sql1.example.com / sql2.example.com:
groupadd MySQL(和PHP搭配之最佳组合)
useradd -g MySQL(和PHP搭配之最佳组合) MySQL(和PHP搭配之最佳组合)
cd /usr/local/
wget http://dev.MySQL(和PHP搭配之最佳组合).com/get/Downloads/MySQL(和PHP搭配之最佳组合)-5.0/MySQL(和PHP搭配之最佳组合)-max-5.0.19-linux-i686-\
glibc23.tar.gz/from/http://www.mirrorservice.org/sites/ftp.MySQL(和PHP搭配之最佳组合).com/
tar xvfz MySQL(和PHP搭配之最佳组合)-max-5.0.19-linux-i686-glibc23.tar.gz
ln -s MySQL(和PHP搭配之最佳组合)-max-5.0.19-linux-i686-glibc23 MySQL(和PHP搭配之最佳组合)
cd MySQL(和PHP搭配之最佳组合)
scripts/MySQL(和PHP搭配之最佳组合)_install_db --user=MySQL(和PHP搭配之最佳组合)
chown -R root:MySQL(和PHP搭配之最佳组合) .
chown -R MySQL(和PHP搭配之最佳组合) data
cp support-files/MySQL(和PHP搭配之最佳组合).server /etc/init.d/
chmod 755 /etc/init.d/MySQL(和PHP搭配之最佳组合).server
update-rc.d MySQL(和PHP搭配之最佳组合).server defaults
cd /usr/local/MySQL(和PHP搭配之最佳组合)/bin
mv * /usr/bin
cd ../
rm -fr /usr/local/MySQL(和PHP搭配之最佳组合)/bin
ln -s /usr/bin /usr/local/MySQL(和PHP搭配之最佳组合)/bin
Then we create the MySQL(和PHP搭配之最佳组合) configuration file /etc/my.cnf on both nodes:
sql1.example.com / sql2.example.com:
vi /etc/my.cnf
[MySQL(和PHP搭配之最佳组合)d] |
Make sure you fill in the correct IP address of the MySQL(和PHP搭配之最佳组合) cluster management server.
Next we create the data directories and start the MySQL(和PHP搭配之最佳组合) server on both cluster nodes:
sql1.example.com / sql2.example.com:
mkdir /var/lib/MySQL(和PHP搭配之最佳组合)-cluster
cd /var/lib/MySQL(和PHP搭配之最佳组合)-cluster
ndbd --initial
/etc/init.d/MySQL(和PHP搭配之最佳组合).server start
(Please note: we have to run ndbd --initial only when the start MySQL(和PHP搭配之最佳组合) for the first time, and if /var/lib/MySQL(和PHP搭配之最佳组合)-cluster/config.ini on loadb1.example.com changes.)
Now is a good time to set a password for the MySQL(和PHP搭配之最佳组合) root user:
sql1.example.com / sql2.example.com:
MySQL(和PHP搭配之最佳组合)admin -u root password yourrootsqlpassword
We want to start the cluster nodes at boot time, so we create an ndbd init script and the appropriate system startup links:
sql1.example.com / sql2.example.com:
echo 'ndbd' > /etc/init.d/ndbd
chmod 755 /etc/init.d/ndbd
update-rc.d ndbd defaults
- ››setpref轻松修改preferences文件
- ››TOscilloscope 仿Windows任务管理器CPU使用记录组...
- ››How to Make a Dark, Post-Apocalyptic City Illu...
- ››tomcat不支持TCP/IP6协议
- ››setTimeout()在js类中的使用方法
- ››tomcat 下的 url 大小写问题
- ››tomcat6.0.28 内存溢出PermGen Space
- ››Setting up proxy for Android Emulator
- ››Tomcat 系统架构与设计模式,第 2 部分: 设计模式...
- ››Tomcat 系统架构与设计模式,第 1 部分: 工作原理...
- ››How to (almost) create your own iPhone OS fram...
- ››TOMCAT和IIS整合
更多精彩
赞助商链接