8个节点MySQL-cluster安装和配置,含两个管理节点
换装jdk
[root@clusterdata1 software]# rpm -qa | grep java
java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64
tzdata-java-2012j-1.el6.noarch
java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
[root@clusterdata1 software]# rpm -e --nodeps tzdata-java-2012j-1.el6.noarch
[root@clusterdata1 software]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
[root@clusterdata1 software]# rpm -qa |grep java
java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64
[root@clusterdata1 software]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64
[root@clusterdata1 software]# rpm -qa |grep java
[root@clusterdata1 software]# ls
jdk-7u60-linux-x64.rpm mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64.tar.gz
[root@clusterdata1 software]# rpm -ivh jdk-7u60-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
[root@clusterdata1 software]# java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
安装datanode,准备工作只要两个执行文件
ndb-connectstring=xxx.xxx.xxx.xx1
[root@clusterdata1 software]# tar -zxvf mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64.tar.gz
[root@clusterdata1 software]# cd mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64
[root@clusterdata1 mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64]# cp bin/ndbd /usr/local/bin/ndbd
[root@clusterdata1 mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64]# cp bin/ndbmtd /usr/local/bin/ndbmtd
[root@clusterdata1 mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64]# cd /usr/local/bin
[root@clusterdata1 bin]# chmod +x ndb*
创建一个数据存放的目录
ndb-connectstring=xxx.xxx.xxx.xx1
[root@clusterdata1 bin]# cd /usr/local
[root@clusterdata1 local]# ls
bin etc games include lib lib64 libexec sbin share src
[root@clusterdata1 local]# mkdir -p mysql/data
[root@clusterdata1 local]# cd mysql/data
[root@clusterdata1 data]# pwd
/usr/local/mysql/data
sql节点
创建mysql用户
[root@clustersql2 software]# grep mysql /etc/passwd
[root@clustersql2 software]# grep mysql /etc/group
[root@clustersql2 software]# groupadd mysql
[root@clustersql2 software]# useradd -g mysql mysql
安装
Server version: 5.6.27-ndb-7.4.8-cluster-gpl MySQL Cluster Community Server (GPL)
[root@clustersql2 software]# tar -C /usr/local -xzvf mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64.tar.gz
[root@clustersql2 mysql]# ln -s /usr/local/mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64 /usr/local/mysql
[root@clustersql2 mysql]# cd /usr/local/mysql
[root@clustersql2 mysql]# scripts/mysql_install_db --user=mysql
[root@clustersql2 mysql]# chown -R root .
[root@clustersql2 mysql]# chown -R mysql data
[root@clustersql2 mysql]# chgrp -R mysql .
完成之后启动并设置下root密码
[root@clustersql1 bin]# ./mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 4999
[root@clustersql1 bin]# 151229 08:47:17 mysqld_safe Logging to '/usr/local/mysql/data/clustersql1.err'.
151229 08:47:17 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
# bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# bin/mysql -uroot mysql
mysql> update user set password=PASSWORD('tplink') where user='root';
mysql> flush privileges;
# bin/mysqladmin -uroot -p shutdown
# bin/mysql -uroot -p
管理节点安装
[root@clustermgm1 software]# tar -zxvf mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64.tar.gz
[root@clustermgm1 software]# cd mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64
[root@clustermgm1 mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64]# cp bin/ndb_mgm* /usr/local/bin
[root@clustermgm1 mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64]# cd /usr/local/bin
[root@clustermgm1 bin]# chmod +x ndb_mgm*
[root@clustermgm1 bin]# ll ndb_mgm*
-rwxr-xr-x 1 root root 7136783 Dec 10 00:19 ndb_mgm
-rwxr-xr-x 1 root root 16368291 Dec 10 00:19 ndb_mgmd
配置
数据节点配置
[root@clusterdata1 data]# vi /etc/my.cnf
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=xxx.xxx.xxx.xx1,xxx.xxx.xxx.xx1 # location of management server
SQL节点配置
[root@clustersql1 bin]# cat /etc/my.cnf
[mysqld]
ndbcluster
character_set_server=utf8
max_connections=2000
connect_timeout=10
wait_timeout=28800
interactive_timeout=28800
[mysql_cluster]
ndb-connectstring=xxx.xxx.xxx.xx1,xxx.xxx.xxx.xx1
管理节点配置
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[root@clustermgm1 mysql-cluster]# cat config.ini
[ndbd default]
NoOfReplicas= 2
LockPagesInMainMemory=1
DataMemory= 16G
IndexMemory= 4G
#ODirect=1
MaxNoOfOrderedIndexes= 512
MaxNoOfConcurrentOperations= 1000000
MaxNoOfLocalScans= 40000
MaxNoOfConcurrentScans=500
#MaxParallelScansPerFragment=1024
# real-time scheduling
SchedulerSpinTimer=400
SchedulerExecutionTimer=50
RealTimeScheduler=1
#Logging and Checkpointing
NoOfFragmentLogFiles=300
FragmentLogFileSize=16M
TimeBetweenWatchDogCheck= 30000
TimeBetweenLocalCheckpoints= 3
#TimeBetweenGlobalCheckpoints= 1000
TimeBetweenEpochs=200
TimeBetweenWatchdogCheckInitial= 60000
#DiskPageBufferMemory=1024M
TransactionInactiveTimeout= 50000
MaxNoOfExecutionThreads= 8
BatchSizePerLocalScan= 512
TransactionDeadlockDetectionTimeout=10000
[ndb_mgmd]
NodeId=1
HostName= xxx.xxx.xxx.xx1
DataDir= /usr/local/mysql/mysql-cluster
[ndb_mgmd]
NodeId=2
HostName= xxx.xxx.xxx.xx1
DataDir= /usr/local/mysql/mysql-cluster
[ndbd]
NodeId=3
HostName= xxx.xxx.xxx.xx3
DataDir= /usr/local/mysql/data
NodeGroup= 0
[ndbd]
NodeId=4
HostName= xxx.xxx.xxx.xx3
DataDir= /usr/local/mysql/data
NodeGroup= 0
[ndbd]
NodeId=5
HostName= xxx.xxx.xxx.xx4
DataDir= /usr/local/mysql/data
NodeGroup= 1
[ndbd]
NodeId=6
HostName= xxx.xxx.xxx.xx4
DataDir= /usr/local/mysql/data
NodeGroup= 1
[mysqld]
NodeId=7
HostName= xxx.xxx.xxx.xx2
[mysqld]
NodeId=8
HostName= xxx.xxx.xxx.xx2
[mysqld]
[mysqld]
# choose an unused port number
# in this configuration 63132, 63133, and 63134
# will be used
[tcp default]
PortNumber= 63132
SendBufferMemory=2M
ReceiveBufferMemory=2M
首次启动
管理节点
[root@clustermgm1 mysql-cluster]# ndb_mgmd --config-file=/usr/local/mysql/mysql-cluster/config.ini
[root@clustermgm1 mysql-cluster]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Cluster Configuration
[ndbd(NDB)] 4 node(s)
[root@clustermgm1 mysql-cluster]# ndb_mgmd --config-file=/usr/local/mysql/mysql-cluster/config.ini
[root@clustermgm1 mysql-cluster]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Cluster Configuration
id=3 @xxx.xxx.xxx.xx3 (mysql-5.6.27 ndb-7.4.8, Nodegroup: 0, *)
id=4 @xxx.xxx.xxx.xx3 (mysql-5.6.27 ndb-7.4.8, Nodegroup: 0)
id=5 @xxx.xxx.xxx.xx4 (mysql-5.6.27 ndb-7.4.8, Nodegroup: 1)
id=6 @xxx.xxx.xxx.xx4 (mysql-5.6.27 ndb-7.4.8, Nodegroup: 1) [ndb_mgmd(MGM)] 2 node(s)
id=1 @xxx.xxx.xxx.xx1 (mysql-5.6.27 ndb-7.4.8)
id=2 @xxx.xxx.xxx.xx1 (mysql-5.6.27 ndb-7.4.8) [mysqld(API)] 4 node(s)
id=7 @xxx.xxx.xxx.xx2 (mysql-5.6.27 ndb-7.4.8)
id=8 @xxx.xxx.xxx.xx2 (mysql-5.6.27 ndb-7.4.8)
id=9 (not connected, accepting connect from any host)
id=10 (not connected, accepting connect from any host)
data节点
[root@clusterdata1 ~]# ndbd --initial
2015-12-11 01:05:07 [ndbd] INFO -- Angel connected to 'xxx.xxx.xxx.xx1:1186'
2015-12-11 01:05:07 [ndbd] INFO -- Angel allocated nodeid: 1
sql节点
[root@clustersql1 bin]# mysqld_safe --user=mysql &
[1] 3028
[root@clustersql1 bin]# 151229 14:48:20 mysqld_safe Logging to '/usr/local/mysql/data/clustersql1.err'.
151229 14:48:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
8个节点MySQL-cluster安装和配置,含两个管理节点的更多相关文章
- mysql cluster 安装配置方案
mysql cluster (mysql 集群)安装配置方案 一.准备 1.准备服务器 计划建立有5个节点的MySQL CLuster体系,需要用到5台服务器,但是我们做实验时没有这么多机器,可以 ...
- C#自制Web 服务器开发:mysql免安装版配置步骤详解分享
mysql免安装版配置步骤详解分享 1.准备工作 下载mysql的最新免安装版本mysql-noinstall-5.1.53-win32.zip,解压缩到相关目录,如:d:\ mysql-noinst ...
- (六)OpenStack---M版---双节点搭建---Neutron安装和配置
↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建网络服务数据库 2.获得 admin 凭证来获取只有管理员能执行的命令的访问权限 3.创 ...
- (八)OpenStack---M版---双节点搭建---Cinder安装和配置
↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建数据库并授权 2.获得admin凭证执行管理员命令并创建服务证书 3.创建块存储设备AP ...
- 第一章 数据库概述、MySQL的安装和配置
第一章 数据库概述.MySQL的安装和配置 1.为什么要使用数据库 最早是纸质文件来存储数据 缺点:不易保存,占用空间大 计算机出现以后,采用软件来进行保存(excel) 缺点:容易损坏 文件 ...
- MySql的安装及配置详细指引!
一.安装My Sql数据库 1.1,首先下载MySQL与HeidiSQL工具,双击打开后可以看到名为”mysql-5.0.22-win32 Setup.exe”的安装程序,双击执行该程序. 1.2,打 ...
- mysql免安装版配置与使用方法
mysql免安装版配置与使用方法 以mysql-noinstall-5.1.6(win32)为例 1>把压缩文件mysql-noinstall-5.1.6-alpha-win32.zi ...
- .Neter玩转Linux系列之六:Linux下MySQL的安装、配置、使用
一.Linux安装MySQL (1)下载安装包:https://dev.mysql.com/downloads/mysql/ (2)解压并安装 命令:tar zxvf 文件名 解压完成之后,重名一下文 ...
- Mysql数据库安装和配置
http://blog.csdn.net/pipisorry/article/details/46773507 Mysql数据库安装和配置.mysql语法.特殊符号及正则表达式的使用.MySQL备份与 ...
随机推荐
- 转: CSS中overflow的用法
Overflow可以实现隐藏超出对象内容,同时也有显示与隐藏滚动条的作用,overflow属性有四个值:visible (默认), hidden, scroll, 和auto.同样有两个overflo ...
- PowerMock使用遇到的问题——2
如果在测一个类的某一个方法时,这个方法还调用了此类的其他方法,那么如何指定其他方法的返回值呢? Partial mock local private method or public method i ...
- Oracle实现自增方式:序列+触发器
Oracle不能像MySQL那样设置主键自增,Oracle用 <序列+触发器>的方式使数据表的一列或多列实现自增 序列sequence+触发器trigger:实现数据表S_DEPART中的 ...
- web api control注册及重写DefaultHttpControllerSelector、ApiControllerActionSelector、ApiControllerActionInvoker
namespace EWorkpal.WebApi { public class HttpNotFoundDefaultHttpControllerSelector : DefaultHttpCont ...
- mac下安装apache+php+mysql
运行“sudo apachectl start”,再输入帐号密码,这样Apache就运行了. 运行“sudo apachectl -v”,你会看到Mac OS X 10.6.3中的Apache版本号: ...
- discuz 系列产品 在ie9下注册成功后不跳转bug处理
header.htm 把 <meta http-equiv="x-ua-compatible" content="ie=7" /> 改为 <m ...
- cmd的xcopy命令
C#项目的PostEvent里经常会用到xcopy命令,复制目录时容易出错,如下: xcopy sourceDir targetDir,其中的2个目录最后不能有反斜杠"",而目录类 ...
- EF Code-First数据迁移的尝试
Code-First的方式虽然省去了大量的sql代码,但增加了迁移的操作.尝试如下: 1.首先要在“扩展管理器”里搜索并安装NuGet“库程序包管理器”,否则所有命令都不能识别,会报CommandNo ...
- Android VersionedGestureDetector手势事件
今天研究了一下PhotoView,发现里面的自定义的手势事件可以支持所有的SDK版本,该事件可以实现拖拽.滑动.缩放功能.下面直接上代码: public abstract class Versione ...
- 《剑指offer-名企面试官精讲典型编程题》读后感
首先,不得不说这是一本好书!!! 我接触这本书是在学长的推荐下去看的,而且口碑还是挺好的一本书,豆瓣的评分也比较高,当我刚看了它,我就深深的爱上了这本书,到现在为止,我已经看了三遍这本书了,平时无聊时 ...