Home > Database > Mysql Tutorial > mysql cluster安装与配置_MySQL

mysql cluster安装与配置_MySQL

WBOY
Release: 2016-06-01 13:45:12
Original
1013 people have browsed it

bitsCN.com

在centos6.0上安装并配置mysql cluster

我在这里用的是mysql cluster 7.1.15a的rpm包

我用了五台虚拟机:
一个管理节点、两个sql节点、两个数据节点

简单说一下安装配置步骤:

1.管理节点安装

rpm -vih /home/aa/MySQL-Cluster-gpl-management-7.1.15a-1.rhel5.i386.rpm

rpm -vih /home/aa/MySQL-Cluster-gpl-tools-7.1.15a-1.rhel5.i386.rpm

rpm -vih /home/aa/MySQL-Cluster-gpl-extra-7.1.15a-1.rhel5.i386.rpm

2.两个sql节点上安装(都要安装)

rpm -vih /home/aa/MySQL-Cluster-gpl-server-7.1.15a-1.rhel5.i386.rpm

rpm -vih /home/aa/MySQL-Cluster-gpl-client-7.1.15a-1.rhel5.i386.rpm

3.两个数据节点安装

rpm -vih /home/aa/MySQL-Cluster-gpl-storage-7.1.15a-1.rhel5.i386.rpm

4.管理节点配置

mkdir /var/lib/mysql-cluster

cd /var/lib/mysql-cluster

vim /var/lib/mysql-cluster/config.ini

[ndbd default]
NoOfReplicas=2
DataMemory=80M
IndexMemory=18M

[tcp default]

[ndb_mgmd]
hostname=192.168.1.103  #管理节点地址
datadir=/var/lib/mysql-cluster

[ndbd]
hostname=192.168.1.100    #数据节点ip
datadir=/var/lib/mysql-cluster/data    #这个data目录是我在数据节点上手动创建的

[ndbd]
hostname=192.168.1.61  #第二个数据节点ip
datadir=/var/lib/mysql-cluster/data

[mysqld]
hostname=192.168.1.101  #sql节点ip

[mysqld]
hostname=192.168.1.104  #第二个sql节点ip


5.数据节点配置(两个节点上都配置)

vim /etc/my.cnf

[mysqld]
ndbcluster
ndb-connectstring=192.168.1.103  #管理节点ip

[mysql_cluster]
ndb-connectstring=192.168.1.103  #管理节点ip

6.sql节点配置(两个节点上都配置)

vim /etc/my.cnf

[mysqld]
ndbcluster
ndb-connectstring=192.168.1.103  #管理节点ip
port=3306

[mysql_cluster]
ndb-connectstring=192.168.1.103  #管理节点ip

7.启动mysql cluster

先启动管理节点,再启动数据节点,最后启动sql节点

启动管理节点:

ndb_mgmd -f /var/lib/mysql-cluster/config.ini

启动数据节点:

ndbd

启动sql节点:

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

8.完成配置,查看一下

在管理节点上执行:

 mysql cluster安装与配置_MySQL


补充:个人的简单配置,若有不足,尽请谅解。

 

作者“我的青春我做主”

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template