How To Set Up A Load-Balanced MySQL Cluster - Part 2
来源:互联网 发布:eclipse java ee 插件 编辑:程序博客网 时间:2024/04/29 20:59
3 Set Up The MySQL Cluster Nodes (Storage Nodes)
Now we install mysql-max-5.0.19 on both sql1.example.com and sql2.example.com:
sql1.example.com / sql2.example.com:
groupadd mysql
useradd -g mysql mysql
cd /usr/local/
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-max-5.0.19-linux-i686-/
glibc23.tar.gz/from/http://www.mirrorservice.org/sites/ftp.mysql.com/
tar xvfz mysql-max-5.0.19-linux-i686-glibc23.tar.gz
ln -s mysql-max-5.0.19-linux-i686-glibc23 mysql
cd mysql
scripts/mysql_install_db --user=mysql
chown -R root:mysql .
chown -R mysql data
cp support-files/mysql.server /etc/init.d/
chmod 755 /etc/init.d/mysql.server
update-rc.d mysql.server defaults
cd /usr/local/mysql/bin
mv * /usr/bin
cd ../
rm -fr /usr/local/mysql/bin
ln -s /usr/bin /usr/local/mysql/bin
Then we create the MySQL configuration file /etc/my.cnf on both nodes:
sql1.example.com / sql2.example.com:
vi /etc/my.cnf
[mysqld]
ndbcluster
# IP address of the cluster management node
ndb-connectstring=192.168.0.103
[mysql_cluster]
# IP address of the cluster management node
ndb-connectstring=192.168.0.103
Make sure you fill in the correct IP address of the MySQL cluster management server.
Next we create the data directories and start the MySQL server on both cluster nodes:
sql1.example.com / sql2.example.com:
mkdir /var/lib/mysql-cluster
cd /var/lib/mysql-cluster
ndbd --initial
/etc/init.d/mysql.server start
(Please note: we have to run ndbd --initial only when the start MySQL for the first time, and if /var/lib/mysql-cluster/config.ini on loadb1.example.com changes.)
Now is a good time to set a password for the MySQL root user:
sql1.example.com / sql2.example.com:
mysqladmin -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
- How To Set Up A Load-Balanced MySQL Cluster - Part 2
- How To Set Up A Load-Balanced MySQL Cluster - Part 8
- How To Set Up A Load-Balanced MySQL Cluster - Part 7
- How To Set Up A Load-Balanced MySQL Cluster - Part 6
- How To Set Up A Load-Balanced MySQL Cluster - Part 5
- How To Set Up A Load-Balanced MySQL Cluster - Part 4
- How To Set Up A Load-Balanced MySQL Cluster - Part 3
- How To Set Up A Load-Balanced MySQL Cluster --Part 1
- How to configure a low-cost load-balanced LAMP cluster
- how to clean up a cluster .
- How to Set Up a Cron Job
- how to set up a plan
- How to Set Up a Cron Job
- How to Set Up Replication--MySQL Concept
- HOWTO set up a MySQL Cluster for two servers
- How to Set Up a USB Key to Install CentOS
- How To: Set Up SSL on a Web Server
- How to set up a Linux OpenVPN client
- How To Set Up A Load-Balanced MySQL Cluster - Part 7
- How To Set Up A Load-Balanced MySQL Cluster - Part 6
- How To Set Up A Load-Balanced MySQL Cluster - Part 5
- How To Set Up A Load-Balanced MySQL Cluster - Part 4
- How To Set Up A Load-Balanced MySQL Cluster - Part 3
- How To Set Up A Load-Balanced MySQL Cluster - Part 2
- 随机生成验证码
- How To Set Up A Load-Balanced MySQL Cluster --Part 1
- Running .Net applications on Linux with Mono
- How to configure a low-cost load-balanced LAMP cluster
- 在Solaris 10 X86上安装Oracle 10g RAC详解 (2)
- 在Solaris 10 X86上安装Oracle 10g RAC详解 (1)
- CSDN被微软收购 OR CSDN收购微软
- Exchange 2003 OWA中修改密码[from http://www.msexchange.org]