0108MySQL集群搭建详解(三种结点分离)
转自http://blog.csdn.net/yang1982_0907/article/details/20716845,感谢博主
管理结点
|
mysql-mgm
|
192.168.124.141
|
数据结点 1
|
mysql-ndbd-1
|
192.168.124.142
|
数据结点 2
|
mysql-ndbd-2
|
192.168.124.143
|
SQL 结点1
|
mysql-sql-1
|
192.168.124.144
|
SQL 结点2
|
mysql-sql-2
|
192.168.124.145
|
cd /root/Downloads tar -xvzf mysql-cluster-gpl-7.3.4-linux-glibc2.5-x86_64.tar.gz mv mysql-cluster-gpl-7.3.4-linux-glibc2.5-x86_64 /usr/local/mysql |
chkconfig --level 35 iptables off |
gedit /etc/selinux/config |
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted |
mkdir /var/lib/mysql-cluster
cd /var/lib/mysql-cluster
gedit config.ini
|
[ndbd default] NoOfReplicas=2 DataMemory=80M IndexMemory=18M [ndb_mgmd] [ndbd] [ndbd]
NodeId=3 hostname=192.168.124.143 datadir=/usr/local/mysql/data [mysqld]
NodeId=4 hostname=192.168.124.144 [mysqld] |
cp /usr/local/mysql/bin/ndb_mgm* /usr/local/bin cd /usr/local/bin chmod +x ndb_mgm* |
groupadd mysql useradd -g mysql mysql |
gedit /etc/my.cnf |
[mysqld] basedir=/usr/local/mysql datadir=/usr/local/mysql/data socket=/usr/local/mysql/sock/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] [mysql_cluster] |
cd /usr/local/mysql mkdir sock scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data |
chown -R root . chown -R mysql.mysql /usr/local/mysql/data chown -R mysql.mysql /usr/local/mysql/sock chgrp -R mysql . |
cp support-files/mysql.server /etc/rc.d/init.d/ chmod +x /etc/rc.d/init.d/mysql.server chkconfig --add mysql.server |
groupadd mysql useradd -g mysql mysql |
gedit /etc/my.cnf |
[client] socket=/usr/local/mysql/sock/mysql.sock [mysqld] [mysql_cluster] |
cd /usr/local/mysql mkdir sock scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data |
chown -R root . chown -R mysql.mysql /usr/local/mysql/data chown -R mysql.mysql /usr/local/mysql/sock chgrp -R mysql . |
cp support-files/mysql.server /etc/rc.d/init.d/ chmod +x /etc/rc.d/init.d/mysql.server chkconfig --add mysql.server |
ndb_mgmd -f /var/lib/mysql-cluster/config.ini |
ndb_mgm |
/usr/local/mysql/bin/ndbd --initial |
/usr/local/mysql/bin/ndbd |
/usr/local/mysql/bin/mysqld_safe --user=mysql & |
shell> /usr/local/mysql/bin/mysql -u root -p mysql>show databases; mysql>create database aa; mysql>use aa; mysql>CREATE TABLE ctest2 (i INT) ENGINE=NDB; //这里必须指定数据库表的引擎为NDB,否则同步失败 mysql> INSERT INTO ctest2 () VALUES (1); mysql> SELECT * FROM ctest2; |
mysql> create database bb; mysql> use bb; mysql> CREATE TABLE ctest3 (i INT) ENGINE=NDB; mysql> use aa; mysql> INSERT INTO ctest2 () VALUES (3333); mysql> SELECT * FROM ctest2; |
#/usr/local/mysql/bin/ndbd --initial#service mysqld start
|
# /usr/local/mysql/bin/mysql -u root –p
|
shell> /usr/local/mysql/bin/ndb_mgm -e shutdown |
Connected to Management Server at: localhost:1186 2 NDB Cluster node(s) have shutdown. Disconnecting to allow management server to shutdown. |
shell> /etc/init.d/mysql.server stop Shutting down MySQL... SUCCESS! |
0108MySQL集群搭建详解(三种结点分离)的更多相关文章
- MySQL集群搭建详解
概述 MySQL Cluster 是MySQL 适合于分布式计算环境的高实用.可拓展.高性能.高冗余版本,其研发设计的初衷就是要满足许多行业里的最严酷应用要求,这些应用中经常要求数据库运行的可靠性要达 ...
- MySQL集群搭建详解(三种结点分离)
本文将搭建一个最简化的MySQL Cluster系统,配置方法中的所有命令都是以root账户运行.这个MySQL Cluster包含一个管理结点.两个数据结点.两个SQL结点,这五个结点会分别安装在五 ...
- Flume NG高可用集群搭建详解
.Flume NG简述 Flume NG是一个分布式,高可用,可靠的系统,它能将不同的海量数据收集,移动并存储到一个数据存储系统中.轻量,配置简单,适用于各种日志收集,并支持 Failover和负载均 ...
- Solr系列二:solr-部署详解(solr两种部署模式介绍、独立服务器模式详解、SolrCloud分布式集群模式详解)
一.solr两种部署模式介绍 Standalone Server 独立服务器模式:适用于数据规模不大的场景 SolrCloud 分布式集群模式:适用于数据规模大,高可靠.高可用.高并发的场景 二.独 ...
- Apache + Tomcat集群配置详解 (1)
一.软件准备 Apache 2.2 : http://httpd.apache.org/download.cgi,下载msi安装程序,选择no ssl版本 Tomcat 6.0 : http://to ...
- [转帖]Application Request Route实现IIS Server Farms集群负载详解
Application Request Route实现IIS Server Farms集群负载详解 https://www.cnblogs.com/knowledgesea/p/5099893.ht ...
- Zookeeper集群安装详解
Zookeeper的角色 Zookeeper集群搭建 要求:服务器集群规模不小于3个节点,各服务器之间系统时间要保持一致! 安装步骤 1.在h1节点解压,目录改名. tar –zxvf zooke ...
- Centos使用LVS+keepalive 搭建集群原理详解
负载均衡集群是 load balance 集群的简写,翻译成中文就是负载均衡集群.常用的负载均衡开源软件有nginx.lvs.haproxy,商业的硬件负载均衡设备F5.Netscale.这里主要是学 ...
- elasticsearch简单的安装以及集群配置详解
首先要确保有java8的环境,安装方法如下(centos) wget --no-check-certificate --no-cookies --header "Cookie: oracle ...
随机推荐
- Window上python 开发--1.搭建开发环境
事实上在开发python最好在ubuntu环境下,简单也便于扩展各个package.可是我的linux的电脑临时不在身边.还的我老婆的电脑win7没办法啊. 因为python的跨平台性.在window ...
- luogu1403 约数研究
题目大意:给出n,求1~n所有数的约数个数的和. 将“1~n所有数的约数”的模板中的factor[i*j].push_back(i)改为FactorCnt[i*j]++,最后再求一次和即可. #inc ...
- 【转】IOS中Json解析的四种方法
原文网址:http://blog.csdn.net/enuola/article/details/7903632 作为一种轻量级的数据交换格式,json正在逐步取代xml,成为网络数据的通用格式. 有 ...
- 【转】学会这13个原则写UI界面文案,用户才能秒懂
原文网址:http://www.niaogebiji.com/article-12011-1.html 摘要: 首先,在写UI文案之前,为了理清思路,要先搞清楚三个问题:我(设计师)想让用户做什么? ...
- Maven打包编译错误工作区间设置编码格式gbk可以utf-8不可以
转自:https://blog.csdn.net/wolf_love666/article/details/52593483 问题:Maven打包编译错误工作区间设置编码格式gbk可以utf-8不可以 ...
- A - Vile Grasshoppers
Problem description The weather is fine today and hence it's high time to climb the nearby pine and ...
- C# txt文件操作
//打开文件到流 FileStream fs=new FileStream(path,FileMode.Open,FileAccess.ReadWrite); //写文件流的方法 StreamWrit ...
- Super超级ERP系统---(3)基础信息管理--商品管理
商品管理主要包括商品的添加,修改,维护商品所在分类,单位,供应商,品牌,名称,价格,尺寸,规格等属性的维护. 1.商品添加 2.商品列表展示 商品列表界面左侧商品分类,右侧是商品信息
- 仿QQ浏览器mac版官网主页 html+css3特效
这是一款超酷的CSS3动态背景动画特效,CSS3仿QQ浏览器官网彗星动画背景特效. 在线演示本地下载
- linux网络路由配置
网卡配置文件介绍: # vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 (描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为 ...