· 6 years ago · Mar 19, 2019, 05:04 PM
1192.168.1.12 – management node
2192.168.1.12 – SQL node
3192.168.1.12 – data node
4192.168.1.13 – SQL node
5192.168.1.13 – data node
6
7$ sudo apt-get install mysql-cluster-community-management-server
8$ sudo apt-get install mysql-cluster-community-client
9$ sudo apt-get install mysql-cluster-community-data-node
10$ sudo apt-get install mysql-cluster-community-server
11
12ndb_mgm> show
13Connected to Management Server at: 192.168.1.12:1186
14Cluster Configuration
15---------------------
16[ndbd(NDB)] 2 node(s)
17id=2 @192.168.1.12 (mysql-5.7.25 ndb-7.5.13, starting, Nodegroup: 0)
18id=3 (not connected, accepting connect from 192.168.1.13)
19
20[ndb_mgmd(MGM)] 1 node(s)
21id=1 @192.168.1.12 (mysql-5.7.25 ndb-7.5.13)
22
23[mysqld(API)] 2 node(s)
24id=4 (not connected, accepting connect from 192.168.1.12)
25id=5 (not connected, accepting connect from 192.168.1.13)
26
27[ndb_mgmd]
28HostName=192.168.1.12
29DataDir=/var/lib/mysql-cluster
30
31[ndbd]
32HostName=192.168.1.12
33NodeId=2
34DataDir=/usr/local/mysql/data
35
36[ndbd]
37HostName=192.168.1.13
38NodeId=3
39DataDir=/usr/local/mysql/data
40
41[mysqld]
42HostName=192.168.1.12
43
44[mysqld]
45HostName=192.168.1.13
46
47[mysqld]
48pid-file = /var/run/mysqld/mysqld.pid
49socket = /var/run/mysqld/mysqld.sock
50datadir = /var/lib/mysql
51log-error = /var/log/mysql/error.log
52bind-address=192.168.1.12
53
54ndbcluster
55ndb-connectstring=192.168.1.12
56
57
58[mysql_cluster]
59ndb-connectstring =192.168.1.12
60
61[mysql_cluster]
62ndb-connectstring =192.168.1.12
63
642019-02-26T21:18:07.772650Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 720710ms. The settings might not be optimal. (flushed=0 and $
652019-02-26T21:18:33.499413Z 0 [Warning] NDB: server id set to zero - changes logged to bin log with server id zero will be logged with another se$
662019-02-26T21:18:33.499926Z 0 [Note] NDB Binlog: Starting...
672019-02-26T21:18:33.500418Z 1 [Note] NDB Binlog: Started
682019-02-26T21:18:33.500438Z 1 [Note] NDB Binlog: Setting up
692019-02-26T21:18:33.500569Z 1 [Note] NDB Binlog: Created schema Ndb object, reference: 0x0, name: 'Ndb Binlog schema change monitoring'
702019-02-26T21:18:33.500684Z 1 [Note] NDB Binlog: Created injector Ndb object, reference: 0x0, name: 'Ndb Binlog data change monitoring'
712019-02-26T21:18:33.500708Z 1 [Note] NDB Binlog: Setup completed
722019-02-26T21:18:33.500720Z 1 [Note] NDB Binlog: Wait for server start completed
732019-02-26T21:18:33.500836Z 0 [Note] NDB Util: Starting...
742019-02-26T21:18:33.500936Z 2 [Note] NDB Util: Wait for server start completed
752019-02-26T21:18:33.501068Z 0 [Note] NDB Index Stat: Starting...
762019-02-26T21:18:33.501097Z 0 [Note] NDB Index Stat: Wait for server start completed
772019-02-26T21:18:33.603096Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data$
782019-02-26T21:18:33.607559Z 0 [Warning] CA certificate ca.pem is self signed.
792019-02-26T21:18:33.609426Z 0 [Note] Server hostname (bind-address): '192.168.1.12'; port: 33$
802019-02-26T21:18:33.609456Z 0 [Note] - '192.168.1.12' resolves to '192.168.1.12';
812019-02-26T21:18:33.609491Z 0 [Note] Server socket created on IP: '192.168.1.12'.
822019-02-26T21:18:33.702507Z 0 [Note] Event Scheduler: Loaded 0 events
832019-02-26T21:18:33.702850Z 0 [Note] /usr/sbin/mysqld: ready for connections.
84Version: '5.7.25-ndb-7.5.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Cluste$
852019-02-26T21:18:33.702987Z 2 [Note] NDB Util: Wait for cluster to start
862019-02-26T21:18:33.703018Z 0 [Note] NDB Index Stat: Wait for cluster to start
872019-02-26T21:18:33.703086Z 1 [Note] NDB Binlog: Check for incidents
882019-02-26T21:18:33.703101Z 1 [Note] NDB Binlog: Checking for any pending binlog purges
892019-02-26T21:18:33.703132Z 1 [Note] NDB Binlog: Wait for cluster to start
902019-02-26T21:19:03.754192Z 0 [Warning] NDB : Tables not available after 30 seconds. Conside$
91
92#Management node
93sudo ndb_mgmd -f /var/lib/mysql-cluster/config.ini --bind-address=192.168.1.12
94
95#Data node
96sudo ndbd --bind-address=192.168.1.12
97
98#SQL node
99sudo service mysql start