MySQL Cluster experiment

Source: Internet
Author: User

Today simple to do a MySQL cluster experiment, still smooth, the steps recorded, after the yaxing again to the layout of the supplement

Environment Description:

192.168.6.240 Management node SQL node data node

192.168.5.172 SQL Node Data node


Get ready:

Download the binary package mysql-cluster-gpl-7.4.12-linux-glibc2.5-x86_64.tar.gz

Extract

Tar zxvf mysql-cluster-gpl-7.4.12-linux-glibc2.5-x86_64.tar.gz

Placed on two machines/usr/local/mysql-cluster


Configuration:

On two machines.

Add Export path= $PATH:/usr/local/mysql-cluster/bin to/etc/profile

Create MySQL users and groups

Create Data Catalog

Mkdir-p/mysql/data


Modifying a configuration file/etc/my.cnf

[Client]
Socket=/mysql/data/mysql.sock

[Mysqld]

Character-set-server = Ndbcluster

max_connections=100
Basedir=/usr/local/mysql-cluster
Datadir=/mysql/data
Socket=/mysql/data/mysql.sock
Ndbcluster
ndb-connectstring=192.168.6.240

[Mysqld_safe]
Log-error=/mysql/data/error.err
Pid-file=/mysql/data/mysql.pid

[Mysql_cluster]
ndb-connectstring=192.168.6.240


Initializing data nodes

Cd/usr/local/mysql-cluster

./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql-cluster--datadir=/mysql/data--defaults-file=/ Etc/my.cnf



Execute on 6.240 (Management node)

Vim/usr/local/mysql-cluster/config.ini

[NDBD DEFAULT]
noofreplicas=2
datamemory=1024m
indexmemory=1024m

[TCP DEFAULT]
portnumber=2202

[NDB_MGMD]
Id=1
hostname=192.168.6.240
Datadir=/usr/local/mysql-cluster

[NDBD]
id=2
hostname=192.168.6.240
Datadir=/mysql/data

[NDBD]
Id=3
hostname=192.168.5.172
Datadir=/mysql/data

[MYSQLD]
hostname=192.168.6.240

[MYSQLD]
hostname=192.168.5.172



Start:

The node's boot order is the data node, the management node,->sql node


Management node

Ndb_mgmd-f/usr/local/mysql-cluster/comfig.ini


Data node


NDBD--initial


SQL node


/usr/local/mysqld_safe--user=mysql &


Management Maintenance cluster:

Cluster off:


Common Administrative commands:

Log Management:


Backup and Recovery:


Add/Remove Nodes



Optimization:




Find a problem like InnoDB, MyISAM table, insert data is added later, and Ndbcluster is added earlier. The principle is explained another day.

This article from "Vampire--it Life" blog, reproduced please contact the author!

MySQL Cluster experiment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.