mysql cluster 簡單配置
----主機資訊
os:cent os 6.5
host: ct6505/192.108.56.115 管理節點,SQL節點,NDB儲存節點
ct6506/192.108.56.116 SQL節點,NDB儲存節點
MySQL-Cluster:7.4.6
----安裝MySQL-Cluster
--ct6505,ct6506
[root@ct6505/6 ~]# yum remove mysql-libs-5.1.71-1.el6.x86_64
[root@ct6505/6 ~]# yum install libaio
[root@ct6505/6 ~]# yum install perl
[root@ct6505/6 ~]# ls MySQL-Cluster-*
MySQL-Cluster-client-advanced-7.4.6-1.el6.x86_64.rpm
MySQL-Cluster-server-advanced-7.4.6-1.el6.x86_64.rpm
[root@ct6505/6 ~]# rpm -ivh MySQL-Cluster-*
----配置MySQL-Cluster
--管理節點
--ct6505
[root@ct6505 mysql-cluster]# mkdir -p /var/lib/mysql-cluster
[root@ct6505 mysql-cluster]# cat /var/lib/mysql-cluster/config.ini
[computer]
Id=mgr-server-01
HostName=192.108.56.115
[mgm default]
datadir=/var/lib/mysql-cluster
[mgm]
HostName=192.108.56.115
NodeId=60
ExecuteOnComputer=mgr-server-01
PortNumber=1186
ArbitrationRank=2
[ndbd default]
NoOfReplicas=2
DataMemory=512M
IndexMemory=512M
[ndbd]
HostName=192.108.56.115
DataDir=/var/lib/mysql
NodeId=1
[ndbd]
HostName=192.108.56.116
DataDir=/var/lib/mysql
NodeId=2
[mysqld]
HostName=192.108.56.115
NodeId=81
[mysqld]
HostName=192.108.56.116
NodeId=82
--NDB儲存節點
--ct6505,ct6506
[root@ct6505/6 mysql-cluster]# cat /etc/my.cnf
[mysql_cluster]
ndb-connectstring=192.108.56.115
--SQL節點
--ct6505,ct6506
[root@ct6505/6 mysql-cluster]# cat /usr/my.cnf
[client]
socket=/var/lib/mysql/mysql.sock
[mysqld]
datadir=/var/lib/mysql
ndbcluster
[mysql_cluster]
ndb-connectstring=192.108.56.115
----啟動
--ct6505
[root@ct6505 ~]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
--ct6505,ct6506
[root@ct6505/6 ~]# ndbd --initial /* --initial只在第一次啟動使用 */
[root@ct6505/6 ~]# mysqld_safe &
----修改密碼
--ct6505,ct6506
[root@ct6505/6 ~]# cat /root/.mysql_secret
# The random password set for the root user at Fri Jun 19 13:25:21 2015 (local time): Igi1I1PJxfzOdRLq
[root@ct6505/6 mysql]# mysql -uroot -p
mysql> SET PASSWORD = PASSWORD('system');
mysql> use mysql;
mysql> update user set host='%' where host='localhost';
mysql> flush privileges;
----關閉
[root@ct6505/6 ~]# mysqladmin -uroot -p shutdown
[root@ct6505 ~]# ndb_mgm -e shutdown
----管理工具
[root@ct6505/6 ~]# ndb_mgm
os:cent os 6.5
host: ct6505/192.108.56.115 管理節點,SQL節點,NDB儲存節點
ct6506/192.108.56.116 SQL節點,NDB儲存節點
MySQL-Cluster:7.4.6
----安裝MySQL-Cluster
--ct6505,ct6506
[root@ct6505/6 ~]# yum remove mysql-libs-5.1.71-1.el6.x86_64
[root@ct6505/6 ~]# yum install libaio
[root@ct6505/6 ~]# yum install perl
[root@ct6505/6 ~]# ls MySQL-Cluster-*
MySQL-Cluster-client-advanced-7.4.6-1.el6.x86_64.rpm
MySQL-Cluster-server-advanced-7.4.6-1.el6.x86_64.rpm
[root@ct6505/6 ~]# rpm -ivh MySQL-Cluster-*
----配置MySQL-Cluster
--管理節點
--ct6505
[root@ct6505 mysql-cluster]# mkdir -p /var/lib/mysql-cluster
[root@ct6505 mysql-cluster]# cat /var/lib/mysql-cluster/config.ini
[computer]
Id=mgr-server-01
HostName=192.108.56.115
[mgm default]
datadir=/var/lib/mysql-cluster
[mgm]
HostName=192.108.56.115
NodeId=60
ExecuteOnComputer=mgr-server-01
PortNumber=1186
ArbitrationRank=2
[ndbd default]
NoOfReplicas=2
DataMemory=512M
IndexMemory=512M
[ndbd]
HostName=192.108.56.115
DataDir=/var/lib/mysql
NodeId=1
[ndbd]
HostName=192.108.56.116
DataDir=/var/lib/mysql
NodeId=2
[mysqld]
HostName=192.108.56.115
NodeId=81
[mysqld]
HostName=192.108.56.116
NodeId=82
--NDB儲存節點
--ct6505,ct6506
[root@ct6505/6 mysql-cluster]# cat /etc/my.cnf
[mysql_cluster]
ndb-connectstring=192.108.56.115
--SQL節點
--ct6505,ct6506
[root@ct6505/6 mysql-cluster]# cat /usr/my.cnf
[client]
socket=/var/lib/mysql/mysql.sock
[mysqld]
datadir=/var/lib/mysql
ndbcluster
[mysql_cluster]
ndb-connectstring=192.108.56.115
----啟動
--ct6505
[root@ct6505 ~]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
--ct6505,ct6506
[root@ct6505/6 ~]# ndbd --initial /* --initial只在第一次啟動使用 */
[root@ct6505/6 ~]# mysqld_safe &
----修改密碼
--ct6505,ct6506
[root@ct6505/6 ~]# cat /root/.mysql_secret
# The random password set for the root user at Fri Jun 19 13:25:21 2015 (local time): Igi1I1PJxfzOdRLq
[root@ct6505/6 mysql]# mysql -uroot -p
mysql> SET PASSWORD = PASSWORD('system');
mysql> use mysql;
mysql> update user set host='%' where host='localhost';
mysql> flush privileges;
----關閉
[root@ct6505/6 ~]# mysqladmin -uroot -p shutdown
[root@ct6505 ~]# ndb_mgm -e shutdown
----管理工具
[root@ct6505/6 ~]# ndb_mgm
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-1720636/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 1. MySQL Galera Cluster全解析 Part 1 Galera Cluster 簡介MySql
- [20181226]簡單探究cluster table.txt
- MySQL ClusterMySql
- Mysql Master-slave複製簡單配置記錄MySqlAST
- Webapck 簡單配置Web
- [20180129]簡單探究cluster table(補充)4.txt
- [20181229]簡單探究cluster table(補充)3.txt
- [20181227]簡單探究cluster table(補充)2.txt
- VS code 簡單配置
- logback的簡單配置
- spingMVC框架簡單配置MVC框架
- MySQL簡單總結MySql
- mysql 簡單安裝MySql
- Docker簡單使用MySQLDockerMySql
- mysql簡單脫敏MySql
- Mysql 簡單入門MySql
- Web Scraper簡單配置方法Web
- webpack(簡單安裝配置)Web
- Mysql-cluster小專案MySql
- MySQL基本簡單操作01MySql
- mysql簡單效能測試MySql
- MySQL簡單最佳化MySql
- MySQL高可用之GC-Galera Cluster for MySQLMySqlGC
- 9. MySQL Galera Cluster全解析 Part 9 監控Galera ClusterMySql
- 7. MySQL Galera Cluster全解析 Part 7 Galera Cluster部署指南MySql
- 8. MySQL Galera Cluster全解析 Part 8 Galera Cluster和傳統MySQL的不同點MySql
- 一個簡單多庫配置
- 交換機的簡單配置
- node webpack4.6簡單配置Web
- MySQL日誌引數配置簡介MySql
- linux 安裝 mysql簡單教程LinuxMySql
- MySQL Galera Cluster全解析 Part 4 Galera Cluster 安裝前準備MySql
- HP cluster的硬體配置及使用
- 一個簡單vue.config.js配置和axios簡單封裝VueJSiOS封裝
- 伺服器簡單郵箱配置伺服器
- Elasticsearch 的安裝和簡單配置Elasticsearch
- Django安裝與簡單配置(1)Django
- CentOS 7 以上防火牆簡單配置CentOS防火牆
- Spring Cloud Gateway + Nacos(1)簡單配置SpringCloudGateway