当前位置:Gxlcms > mysql > MySQL中双NDBD节点Cluster快速配置

MySQL中双NDBD节点Cluster快速配置

时间:2021-07-01 10:21:17 帮助过:58人阅读

1.配置环境; MGM:192.168.0.31 NDBD1:192.168.0.32 NDBD2:192168.0.33 SQL1:192.168.0.34 SQL2:192.168.0.30 2.软件安装 (

1.配置环境;
MGM:192.168.0.31
NDBD1:192.168.0.32
NDBD2:192168.0.33
SQL1:192.168.0.34
SQL2:192.168.0.30

2.软件安装
(一)管理节点MGM
首先在合适的位置建立管理节点的配置文件;
config.ini
[ndbd default]
NoOfReplicas=2
DataMemory=80M
IndexMemory=18M
[tcp default]
portnumber=2202

[ndb_mgmd]
hostname=192.168.0.31
datadir=/var/lib/mysql-cluster
[ndbd]
hostname=192.168.0.32
datadir=/usr/local/mysql/data
[ndbd]
hostname=192.168.0.33
datadir=/usr/local/mysql/data
[mysqld]
hostname=192.168.0.30
[mysqld]
hostname=192.168.0.34
a.改变地址到/var/tmp目录下,解压mysql-cluster压缩文件,取出ndb_mdmd和ndb_mdm;
b.改变路径为拷贝到的目录下,,并确保这两个文件可执行;
chmod +x ndb_mgm*
c.在/usr/local下创建mysql文件夹;
(二)数据节点NDBD和SQL节点;
配置数据节点NDBD和SQL节点;
在每个SQL节点都做如下的配置,在/etc/my.cnf文件内;
[client]
socket=/usr/local/mysql/sock/mysql.sock

[mysqld]
ndbcluster
datadir=/usr/local/mysql
socket=/usr/local/mysql/sock/mysql.sock
ndb-connectstring=192.168.0.31
#user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysql_cluster]
ndb-connectstring=192.168.0.31

linux

人气教程排行