文章目录
1. 环境说明:
三台ubuntu18.04 ,分别为
- manage
- node1
- node2
2. manage 安装和配置Cluster Manager
- 二进制安装mysql-cluster-manage
cd /usr/local/src
wget https://dev.mysql.com/get/Downloads/MySQL-Cluster-8.0/mysql-cluster-community-management-server_8.0.19-1ubuntu18.04_amd64.deb
dpkg -i mysql-cluster-community-nodejs_8.0.19-1ubuntu18.04_amd64.deb
- 创建配置文件
mkdir /var/lib/mysql-cluster
vim /var/lib/mysql-cluster/config.ini
[ndbd default] # 配置ndbd节点 # Options affecting ndbd processes on all data nodes: NoOfReplicas=2 # Number of replicas [ndb_mgmd] # 配置管理节点 # Management process options: hostname=198.51.100.2 # Hostname of the manager datadir=/var/lib/mysql-cluster # Directory for the log files [ndbd] # 配置数据节点 hostname=198.51.100.0 # Hostname/IP of the first data node NodeId=2 # Node ID for this data node datadir=/usr/local/mysql/data # Remote directory for the data files [ndbd] hostname=198.51.100.1 # Hostname/IP of the second data node NodeId=3 # Node ID for this data node datadir=/usr/local/mysql/data # Remote directory for the data files [mysqld] # 配置sql节点 hostname=198.51