I haven't had time to write. I knew one months would not be over, temporarily added work is always dragged down.
。。
MySQL cluster docker installed MySQL cluster error. It's my image that has less perl. Be honest with me. The image is not small again. Also need to install NUMACTL, Net-tools
error:failed dependencies:
/usr/bin/perl is needed by mysql-cluster-server-gpl-7.4.10-1.el7.x86_64
Libnuma.so.1 () (64bit) is needed by mysql-cluster-server-gpl-7.4.10-1.el7.x86_64
--Continue---
192.168.2.54 Management Node
192.168.2.55 Data Node
192.168.2.56 SQL Node
---install Data Node----
MySQL $ sudo rpm-uhv mysql-cluster-server-gpl-7.4.10-1.el7.x86_64.rpm
After successful installation, NDBD and NDBMTD should be in the/usr/sbin folder
---install SQL Node----
MySQL $ sudo rpm-uhv mysql-cluster-server-gpl-7.4.10-1.el7.x86_64.rpm
After successful installation mysqld should be in the/usr/sbin folder,/usr/share/mysql has Mysql.server
Suppose you want to manage SQL Node, you need to install the client. MySQL in/usr/bin/after installation
MySQL $ sudo rpm-uvh mysql-cluster-client-gpl-7.4.10-1.el7.x86_64.rpm
If the installation process is error, you need to install
FATAL Error:please Install the following Perl modules before executing/usr/bin/mysql_install_db:
Data::D umper
MySQL $ sudo yum install-y perl-data-dumper
---install management Node----
MySQL $ sudo rpm-uhv mysql-cluster-server-gpl-7.4.10-1.el7.x86_64.rpm
After installation NDB_MGMD has been installed in/usr/sbin, NDB_MGM Management client has also been installed successfully
====================================================================
---initial configuration cluster----
MySQL cluster7.3+ provides a Auto-install GUI installation method. We'll try later.
To edit the configuration file, each data node or SQL node needs to edit my.cnf, providing the connection character information that tells the node how to find the management node. Also tell MySQL server to provide the Ndbcluster engine
The management node needs to configure the Config.ini file. Describes how many replicas need to be maintained, how much memory is allocated to data and indexes on each data node, and how data nodes are found. where each data node's data is stored on the disk, how to find the SQL node
---Configure data nodes and SQL nodes----
MySQL $ sudo mkdir-p/usr/local/mysql/data
MySQL $ sudo chown-r mysq:mysq/usr/local/mysql/
MySQL $ sudo vi/etc/my.cnf
[Mysqld]
Ndbcluster
[Mysql_cluster]
NDB-CONNECTSTRING=192.168.2.54 # Manage node address, don't forget firewall off, check ping Pass
Two nodes are configured
Note that assuming that you have initiated the configuration of the Ndbcluster mysqld process, the cluster does not start and the CREATE TABLE and ALTER TABLE statements cannot be run, in order to maintain consistency
---The Configuration management node----
MySQL $ sudo mkdir/var/lib/mysql-cluster create a folder to save the configuration
MySQL $ sudo chown-r mysq:mysq/var/lib/mysql-cluster/
MySQL $ sudo mkdir/usr/mysql-cluster
MySQL $ sudo chown-r mysq:mysq/usr/mysql-cluster
MySQL $ sudo vi/var/lib/mysql-cluster/config.ini
[NDBD default]# Options affecting NDBD processes on all data nodes:noofreplicas=2 # Number of replicasdatamemory=80m # How much memory to allocate for data storageindexmemory=18m # How much memory to allocate for index storage # for Datamemory and indexmemory, we have used the # default values. Since the ' World ' database takes up # is about 500KB, this should is more than enough for # This example Cluster setup. [TCP default]# TCP/IP options:portnumber=2202 # this default; However, you can use any # Port-is-free for all the hosts in the cluster # Note:it is recommended so you don't specify the port # number at all and simply allow the default value to be Used # instead[ndb_mgmd]# Management process options:hostname=192.168.2.54 # hostname or IP ad Dress of MGM Nodedatadir=/var/lib/mysql-cluster # Directory for MGM node Log files[ndbd]# Options for data node ' A ': # (one [NDBD] section per data node) hostname=1 92.168.2.55 # Hostname or IP Addressdatadir=/usr/local/mysql/data # Directory for this data node ' s data files# [ndbd]# Options for Data node "B": #hostname =192.168.0.40 # hostname or IP address#datadir=/usr/local/mysql/data # Directory for this data node ' s data files[mysqld]# SQL node options:hostname=192.168.2.56 # hostname or IP a Ddress # (additional mysqld connections can be # specified F Or this node for various # purposes such as running Ndb_restore)
================================================
---initialize the cluster----
On the management node, run the command to start the management node process
MySQL $ ndb_mgmd-f/var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql-5.6.28 ndb-7.4.10
Assuming a startup error, view log exclusion errors in the/var/lib/mysql-cluster folder
In the data node. Run command start
MySQL $ ndbd
[Email protected] ~]$ NDBD
2016-04-21 10:01:37 [NDBD] INFO--Angel connected to ' 192.168.2.54:1186 '
2016-04-21 10:01:37 [NDBD] INFO--Angel allocated Nodeid:2
View status on the management node
MySQL $ ndb_mgm
Ndb_mgm> Show View node status, assuming there are no available nodes, it will be tried every five seconds
[MySQL ~]$ NDB_MGM
--NDB Cluster--Management Client--
Ndb_mgm> Show
Connected to Management Server at:localhost:1186
Cluster Configuration
---------------------
[NDBD (NDB)] 1 node (s)
id=2@192.168.2.55 (mysql-5.6.28 ndb-7.4.10, nodegroup:0, *)
[NDB_MGMD (MGM)] 1 node (s)
Id=1@192.168.2.54 (mysql-5.6.28 ndb-7.4.10)
[Mysqld (API)] 1 node (s)
Id=3 (not connected, accepting connect from 192.168.2.56)
Start the SQL node
Because it is newly installed, running MYSQLD will error
Need to Installdb first
MySQL $ mysql_install_db--user=mysql
MySQL $ mysqld & run with the daemon way you used to
============ View Status =============
Cluster Configuration
---------------------
[NDBD (NDB)] 1 node (s)
id=2@192.168.2.55 (mysql-5.6.28 ndb-7.4.10, nodegroup:0, *)
[NDB_MGMD (MGM)] 1 node (s)
Id=1@192.168.2.54 (mysql-5.6.28 ndb-7.4.10)
[Mysqld (API)] 1 node (s)
id=3@192.168.2.56 (mysql-5.6.28 ndb-7.4.10)
MySQL (8)--cluster 7.4 rpm CENTOS7