CentOS 6.4 64位 搭建MySQL-Cluster 7.3.8 集群

准备:1、下载 MySQL-Cluster-gpl-7.3.8-1.el6.x86_64.rpm-bundle.tar

    下载地址: http://mirrors.sohu.com/mysql/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.8-1.el6.x86_64.rpm-bundle.tar

    解压:  

[[email protected] files]# tar -xvf MySQL-Cluster-gpl-7.3.8-1.el6.x86_64.rpm-bundle.tar
MySQL-Cluster-test-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-shared-compat-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-client-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-embedded-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-server-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-devel-gpl-7.3.8-1.el6.x86_64.rpm
MySQL-Cluster-shared-gpl-7.3.8-1.el6.x86_64.rpm

     2、停掉原有mysql 删除开机自动运行 卸载原有mysql 相关(未有任何相关则忽略)


[[email protected] files]# service mysql stop Shutting down MySQL.. SUCCESS!

[[email protected] files]# chkconfig  mysql  off

[[email protected] files]# rpm -qa | grep MySQLMySQL-client-5.6.24-1.el6.x86_64MySQL-server-5.6.24-1.el6.x86_64MySQL-devel-5.6.24-1.el6.x86_64
[[email protected] files]# rpm -e --nodeps MySQL-client-5.6.24-1.el6.x86_64 MySQL-server-5.6.24-1.el6.x86_64 MySQL-devel-5.6.24-1.el6.x86_64

进行安装操作

[[email protected] files]# rpm -ivh MySQL-Cluster-server-gpl-7.3.8-1.el6.x86_64.rpm 
[[email protected] files]# rpm -ivh MySQL-Cluster-client-gpl-7.3.8-1.el6.x86_64.rpm

添加用户信息:

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;

 flush privileges ;

创建工作目录及文件配置:

[[email protected] var]# mkdir /var/mysql-cluster[[email protected] var]# mkdir /var/lib/mysql/data[[email protected] var]# mkdir /var/run/mysqld

 [[email protected] var]# chmod -R 1777 /var/lib/mysql
 [[email protected] var]# chmod -R 1777 /var/run/mysqld
 [[email protected] var]# chmod -R 1777 /var/lib/mysql-cluster

  [[email protected] var]  vi /etc/config.ini

[computer]
Id=mgr-server-01
HostName=192.168.1.240
[mgm default]
datadir=/var/lib/mysql-cluster
[mgm]
HostName=192.168.1.240
NodeId=60
ExecuteOnComputer=mgr-server-01
PortNumber=1186
ArbitrationRank=2
[ndbd default]
NoOfReplicas=2
DataMemory=500M
IndexMemory=500M
[ndbd]
HostName=192.168.1.240
DataDir=/var/lib/mysql
NodeId=1
[ndbd]
HostName=192.168.1.241
DataDir=/var/lib/mysql
NodeId=2

 [[email protected] var] vi /etc/my.conf

[client]
socket=/var/lib/mysql/mysql.sock

[mysqld]
max_connections=100
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
ndbcluster
ndb-connectstring=192.168.1.240

[mysqld_safe]
log-error=/var/log/mysqld.log
#pid-file=/var/run/mysqld/mysqld.pid
pid-file=/var/lib/mysql/mysqld.pid

[mysql_cluster]
ndb-connectstring=192.168.1.240

启动:

注:关闭防火墙设置(可待调试成功后重新开启防火墙仅开放用到的端口),selinux 设为 disabled

顺序:管理节点->均衡节点->数据节点 (关闭时相反:数据节点 service mysql stop ->均衡节点 ndb_mgm -e shutdown)

[[email protected] mysql-cluster]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini  //启动 管理节点 操作MySQL Cluster Management Server mysql-5.6.22 ndb-7.3.8 [[email protected] mysql-cluster]# ndbd --initial //均衡节启动 首次启动加 --initial 再次不需加 [[email protected] mysql-cluster]# mysqld_safe --defaults-file=/etc/my.cnf --explicit_defaults_for_timestamp & //启动数据节点

查看连接情况:

[[email protected] ~]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.1.240:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @192.168.1.240  (mysql-5.6.22 ndb-7.3.8, Nodegroup: 0)
id=2    @192.168.1.241  (mysql-5.6.22 ndb-7.3.8, Nodegroup: 0, *)

[ndb_mgmd(MGM)] 1 node(s)
id=60   @192.168.1.240  (mysql-5.6.22 ndb-7.3.8)

[mysqld(API)]   2 node(s)
id=81   @192.168.1.240  (mysql-5.6.22 ndb-7.3.8)
id=82   @192.168.1.241  (mysql-5.6.22 ndb-7.3.8)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

进入mysql出错处理:

mysqld_safe --skip-grant-tables &mysql -uroot -p>use mysql;>update mysql.user set password=PASSWORD(‘123456‘) where User=‘root‘ ; >flush privileges ;

or 

//在mysql 配置文件中加入以下一句话 ,重新启动输入 mysql 进入命令行修改密码

[[email protected] files]# vi /etc/my.cnf
[mysqld]skip-grant-tables
[[email protected] files]# mysql

出错:

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
>SET PASSWORD = PASSWORD(‘123456‘);
时间: 2024-08-06 04:40:07

CentOS 6.4 64位 搭建MySQL-Cluster 7.3.8 集群的相关文章

CentOS 7.2 64位上装mysql

# yum install mysql # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server # yum install mysql-devel mysql安装完成! 启动数据库 # systemctl start mysql 初

搭建MySQL高可用负载均衡集群

1.简介 使用MySQL时随着时间的增长,用户量以及数据量的逐渐增加,访问量更是剧增,最终将会使MySQL达到某个瓶颈,那么MySQL的性能将会大大降低.这一结果也不利于软件的推广. 那么如何跨过这个瓶颈,提高MySQL的并发量呢?方法有很多,分布式数据库.读写分离.高可用负载均衡.增加缓存服务器等等.之前的文章里已经介绍了读写分离的方案了,接下来我将讲解MySQL高可用负载均衡这一方法. 其中实现高可用负载均衡的方法有很多,例如LVS+keepalived组合实现.haproxy+keepal

CentOS 6.4 64位 安装 mysql 5.6.24

下载安装包 由于官网访问及版本选择下载不太方便,使用 suho 的源进行下载 http://mirrors.sohu.com/mysql/MySQL-5.6/ 下载如下三个安装包: MySQL-server-5.6.24-1.el6.x86_64.rpm MySQL-client-5.6.24-1.el6.x86_64.rpm MySQL-devel-5.6.24-1.el6.x86_64.rpm 进行安装 如原装有mysql 请在安装前先进行卸载 [[email protected] file

阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL)

阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL) 转载自:http://elf8848.iteye.com/blog/1698351 一.快速安装Apache+PHP5+MySql ----------------------------------------------------- 补充:由于163的yum源上只有php5.1.6 mysql 5.0.95 版本较低,请直接看最后面的<八.卸载php5.1,mysql5.0 重新安装ph

centos 6.5 64位下安装源码安装mysql 5.6.15

系统环境是centos 6.5 64位的 首先在防火墙里面增加3306端口: 然后保存:wq! 保存好后重启下防火墙 service iptables restart 安装系统所需要的依赖包 [[email protected] ~]# yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*  cmake  bison

CentOS 6.8搭建mysql cluster(7.3)

CentOS 6.8搭建mysql cluster(7.3): 注:共5台,1台管理节点(10.0.0.21),2台SQL节点(10.0.0.22.10.0.0.23),2台数据节点(10.0.0.24.10.0.0.25) 参考网址:http://blog.itpub.net/9034054/viewspace-2097706 下载网址(选择Red Hat的tar包并进行解压):https://dev.mysql.com/downloads/cluster/7.3.html#downloads

搭建mysql cluster

虚拟机搭建Mysql Cluster 参考文档:http://www.cnblogs.com/jackluo/archive/2013/01/19/2868152.html http://www.cnblogs.com/StanBlogs/archive/2011/06/14/2080986.html 需要三台服务器.一个管理节点服务器.另外两个均充当数据节点和sql节点. 这里选用ubuntu64位操作系统.mysql cluster 对应也必须是64位的.去官方站点下载mysql-clust

centos6.5 64位 搭建FTP服务器

准备开始搞我的毕设了,到腾讯云服务器买了个最低配置的服务器. 搭建了自己服务器上的FTP服务. 写下来做个备份,顺便分享给大家,希望和大家一起学习学习! 我主要是做个搬运工,搬运并加上自己的一些解释. 亲测可行! 云服务器平台:腾讯云服务器 云主机:centos 6.5   64位 配置: 1核.1GB.10GB(本地盘),1Mbps(公网流量) 首先是要在云主机上配置vsftpd服务 Step1. 在云服务器配置FTP服务 1. 在root权限下,通过如下命令安装Vsftp(以centos 系

[转]Win7 64位搭建本地SVN服务器 Apache+Subversion

转载地址:http://blog.sina.com.cn/s/blog_4f072a7001015j5z.html 一.工具下载 01.SVN 服务器Subversion:Setup-Subversion-1.6.17.msi 02.SVN 客户端TortoiseSVN:本文选用版本为(64位)TortoiseSVN-1.6.16.21511-x64-svn-1.6.17.msi 03.TortoiseSVN中文语言包:本文选用版本为LanguagePack_1.6.16.21511-x64-z