當前位置:首頁 » 編程語言 » sql3167
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

sql3167

發布時間: 2023-07-29 16:01:16

Ⅰ MYsql的CLUSTER的SQL節點配置需要注意什麼

管理節點:

[root@localhost ~]# cd /usr/local/mysql/
[root@localhost mysql]# ls
config.ini data ndb_mgm ndb_mgmd
[root@localhost mysql]# cat config.ini
[NDBD DEFAULT]
NoOfReplicas=1
[TCP DEFAULT]
portnumber=3306
[NDB_MGMD]
hostname=192.168.0.231
datadir=/usr/local/mysql/data
[NDBD]
hostname=192.168.0.233
datadir=/usr/local/mysql/data
[NDBD]
hostname=192.168.0.234
datadir=/usr/local/mysql/data
[MYSQLD]
hostname=192.168.0.232
[root@localhost mysql]#

[root@localhost mysql]# /usr/local/mysql/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.0.233 (Version: 5.0.24, starting, Nodegroup: 0)
id=3 @192.168.0.234 (Version: 5.0.24, starting, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1 (Version: 5.0.24)

[mysqld(API)] 1 node(s)
id=4 (not connected, accepting connect from 192.168.0.232)

ndb_mgm>

SQL 節點:
[root@localhost ~]# cat /etc/my.cnf
[mysqld]
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/
user=nobody
port=3306
socket=/tmp/mysql.sock

ndbcluster
ndb-connectstring=192.168.0.231
[mysql_cluster]
ndb-connectstring=192.168.0.231
[root@localhost ~]# ps aux | grep mysql
root 2865 0.0 0.1 5312 1104 tty1 S 19:13 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe
nobody 2910 0.0 1.8 122356 18384 tty1 Sl 19:13 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=nobody --pid-file=/usr/local/mysql/data//localhost.localdomain.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock
root 3167 0.0 0.0 4752 664 pts/0 S+ 21:20 0:00 grep mysql

DATA 節點:(兩個配置一樣的。另外一個是192.168.234)
[root@localhost ~]# cat /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=192.168.0.231
[mysql_cluster]
ndb-connectstring=192.168.0.231
[root@localhost ~]# ps aux | grep ndb
root 2953 0.0 0.2 6672 1956 ? Ss 11:09 0:00 /usr/local/mysql/bin/ndbd --initial
root 2954 0.0 10.0 491720 97412 ? Sl 11:09 0:00 /usr/local/mysql/bin/ndbd --initial
root 3229 0.0 0.0 4752 664 pts/0 S+ 13:19 0:00 grep ndb
[root@localhost ~]#