Skip to content

Instantly share code, notes, and snippets.

@wwwted
Last active February 23, 2021 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwwted/90341013f0cbc8eaf8d6e7cdfa9a574d to your computer and use it in GitHub Desktop.
Save wwwted/90341013f0cbc8eaf8d6e7cdfa9a574d to your computer and use it in GitHub Desktop.
1) Install MCM
- Download MCM install package from https://edelivery.oracle.com/
- Install MCM package
Guide on run MCM using systemd: https://github.com/wwwted/Install-MySQL-Cluster-Manager-using-Systemd
2) Configure MCM
- set manager-directory to where you want to store cluster data on disk
- set log-file to where you want to store the mcm logfile.
3) Start MCM on all nodes/servers where you will run NDB cluster processes
mcmd --defaults-file=./mcmd.ini --daemon
4) Download and unpack NDB binaries on all nodes/servers where you want to run NDB processes
You can download latest NDB binaries from here: https://dev.mysql.com/downloads/cluster/
For example:
mkdir /opt/mysql/ndb
cd /opt/mysql/ndb
wget https://dev.mysql.com/get/Downloads/MySQL-Cluster-8.0/mysql-cluster-8.0.23-linux-glibc2.12-x86_64.tar.gz
tar xzf mysql-cluster-8.0.23-linux-glibc2.12-x86_64.tar.gz
5) Create your cluster (see SIMPLE_CLUSTER file below.
mcm < SIMPLE_CLUSTER
mcm -e"show status -r mycluster"
---- File SIMPLE_CLUSTER ----
create site --hosts=127.0.0.1 mysite;
add package --basedir=/opt/mysql/ndb/mysql-cluster-8.0.23-linux-glibc2.12-x86_64 ndb8023;
create cluster --package=ndb8023 --processhosts=ndb_mgmd@127.0.0.1,ndbmtd@127.0.0.1,ndbmtd@127.0.0.1 mycluster;
add process --processhosts=mysqld:146@127.0.0.1,mysqld:148@127.0.0.1 mycluster;
add process --processhosts=ndbapi@127.0.0.1,ndbapi@127.0.0.1 mycluster;
add process --processhosts=ndbapi@127.0.0.1,ndbapi@127.0.0.1 mycluster;
set port:mysqld:146=53306 mycluster;
set port:mysqld:148=53307 mycluster;
set ndb_autoincrement_prefetch_sz:mysqld=513 mycluster;
set ndb-cluster-connection-pool:mysqld=2 mycluster;
set ndb-batch-size:mysqld=16M mycluster;
start cluster mycluster;
show status -r mycluster;
---- end file ----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment