Cenots 7 安装mysql cluster 通过rpm 包
环境:Cenots 7
MG:192.168.0.105
NDB:192.168.0.108
NDB:192.168.0.109
SQL:192.168.0.111
SQL:192.168.0.107
软件下载说明:
软件下载地址:http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-Cluster-7.5/
MG 管理商:
mysql-cluster-community-client-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-libs-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-common-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-management-server-7.5.5-1.el7.x86_64.rpm
NDB 数据节点:
mysql-cluster-community-client-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-libs-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-common-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-libs-compat-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-data-node-7.5.5-1.el7.x86_64.rpm
SQL 查询节点:
mysql-cluster-community-client-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-libs-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-common-7.5.5-1.el7.x86_64.rpm
mysql-cluster-community-server-7.5.5-1.el7.x86_64.rpm
防火墙配置:
MG 管理端配置:
1.禁用firewalld:
systemctl stop firewalld & systemctl disable firewalld
2.安装iptables 防火墙:yum -y install iptables-services
配置重点如下:
在/etc/sysconfig/iptables 添加如下规则
-A INPUT -p tcp -m state --state NEW -m tcp -s 192.168.0.0/24 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp -s 192.168.0.0/24 -j ACCEPT
3.禁用SElinux ,请注意需要重启服务器
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
NDB 数据节点防火墙配置:
1.禁用firewalld:
systemctl stop firewalld & systemctl disable firewalld
2.安装iptables 防火墙:yum -y install iptables-services
配置重点如下:
在/etc/sysconfig/iptables 添加如下规则
-A INPUT -p tcp -m state --state NEW -m tcp -s 192.168.0.0/24 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp -s 192.168.0.0/24 -j ACCEPT
3.禁用SElinux ,请注意需要重启服务器
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
SQL 查询节点防火墙配置:
1.禁用firewalld:
systemctl stop firewalld & systemctl disable firewalld
2.安装iptables 防火墙:yum -y install iptables-services
配置重点如下:
在/etc/sysconfig/iptables 添加如下规则
-A INPUT -p tcp -m state --state NEW -m tcp -s 192.168.0.0/24 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp -s 192.168.0.0/24 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
3.禁用SElinux ,请注意需要重启服务器
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
Cluster 命令使用:
MG 管理端:
第一次启动命令(修改config.ini配置文件重新初始化):
ndb_mgmd -f /var/lib/mysql-cluster/config.ini --initial
启动命令:
ndb_mgmd -f /var/lib/mysql-cluster/config.ini
关闭命令:
ndb_mgm -e shutdown
查询状态命令:
ndb_mgm -e show
查询MG是否启动状态:
ps aux | grep ndb | grep -v grep
NDB 数据节点命令:
第一次启动:
ndbd --initial
重启:
ndbd
查询启动状态:
ps aux | grep ndb | grep -v grep
查看端口连接:
netstat -anpt
SQL 查询节点:
第一次启动, 请注意配置好my.cnf 文件之后再启动:
chown mysql:mysql -R /var/lib/mysql
mysqld --initialize-insecure
systemctl restart mysqld
安装软件说明:
MGM 管理端,:
安装命令如下,请查收安装时进入到软件所放置的目录下面;
yum -y localinstall mysql-cluster-community-*
NDB 跟MGM 安装一样;
SQL 安装有所不同,是因为安装插件:
yum install prel-Class-MethodMaker perl-libwww-perl perl-DBI perl-GD perl-Data-Dumper
yum -y remove mariadb-libs
yum -y localinstall mysql-cluster-community-*
配置说明:
MGM 管理端:
配置文件所存放在:/var/lib/mysql-cluster/ 目录下面,所以首先要创建此目录:mkdir /var/lib/mysql-cluster/
配置内容如下:
[ndb_mgmd default]
DataDir=/var/lib/mysql-cluster [ndb_mgmd]
NodeId=10
HostName=192.168.0.105 #[TCP DEFAULT]
#portnumber=2202 [ndbd default]
NoOfReplicas=2
DataMemory=10307921510
IndexMemory=5153960755 DataDir=/var/lib/mysql-cluster
BackupDataDir=/var/lib/mysql-cluster/backup StringMemory=20
MaxNoOfTables=1024
MaxNoOfOrderedIndexes=2048
MaxNoOfUniqueHashIndexes=512
MaxNoOfAttributes=204800
MaxNoOfTriggers=102400 LockPagesInMainMemory=1
TimeBetweenLocalCheckpoints=20
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=100
TimeBetweenWatchdogCheckInitial=60000 FragmentLogFileSize=256M
NoOfFragmentLogFiles=16
RedoBuffer=64M MaxNoOfConcurrentOperations=500000
TransactionInactiveTimeout=50000
MaxNoOfExecutionThreads=8
BatchSizePerLocalScan=512 SharedGlobalMemory=20M
DiskPageBufferMemory=80M [ndbd]
NodeId=20
HostName=192.168.0.109 [ndbd]
NodeId=21
HostName=192.168.0.108 [mysqld]
NodeId=30
HostName=192.168.0.111
[mysqld]
NodeId=31
HostName=192.168.0.107 [mysqld]
[mysqld]
[mysqld]
[mysqld]
[mysqld]
[mysqld]
[mysqld]
[mysqld]
MG config.ini 文件配置内容
NDB 数据节点配置:
因在MG 管理里面定义有backup 文件夹,所有首先要创建此文件夹,不然在重启过程中会报错从而不能成功启动节点:mkdir /var/lib/mysql-cluster/backup
配置文件为/etc/my.cnf 配置内容如下:
[mysqld]
ndbcluster
ndb-connectstring=192.168.0.105 # IP address of Management Node [mysql_cluster]
ndb-connectstring=192.168.0.105 # IP address of Management Node
NDB my.cnf 配置内容
SQL 查询节点配置:
配置文件为/etc/my.cnf 请注意:第一次启动时先配置好此文件再初始化Mysql 再启动;
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld]
user=mysql
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid ndbcluster
ndb-connectstring=192.168.0.105:1186 # IP address for server management node
default_storage_engine=ndbcluster # Define default Storage Engine used by MySQL [mysql_cluster]
ndb-connectstring=192.168.0.105:1186 # IP address for server management node
SQL my.cnf 配置文件内容
启动过程:MG-NDB-SQL
完成!
Cenots 7 安装mysql cluster 通过rpm 包的更多相关文章
- CentOS7 安装 MySQL Cluster 7.6.7
引用自:http://lemonlone.com/posts/mysql-ndb-cluster-install/ 仅做备份和配置文件更改 1.先在VMware中安装 CentOS-7-x86_64- ...
- zabbix安装及配置(rpm包安装mysql,php,apache,zabbix)
zabbix安装及配置 一.安装mysql.php.apache.zabbix 安装环境: 操作系统:rhel6.3-x86-64 mysql:5.6.23 --官网下载rpm包安装php:5. ...
- Linux 5 下安装MySQL 5.6(RPM方式)
MySQL在很多领域被广泛使用,尤其是很多互联网企业,诸如腾讯,阿里等等.本文主要介绍在Linux 5下通过rpm方式来安装Mysql,这是比较简单的一种安装方式,具体详见下文. <MySQL权 ...
- 【转】Linux系统上安装MySQL 5.5 rpm
1.准备工作 从MySQL官网上分别下载mysql服务器端于客户端包. 如: MySQL-server-5.5.15-1.linux2.6.x86_64.rpm和MySQL-client-5.5.15 ...
- Linux之保留yum安装软件后的RPM包
yum安装软件很方便,但是下载下来的rpm包在安装后默认会被删除掉: 如果希望保留yum安装的软件包该如何做呢? 设置方法: 将/etc/yum.conf里对应的keepcache参数改为1即可,然后 ...
- Linux应用和系统库的2种安装方式---源码安装tarball和二进制rpm包
一.应用程序和系统库从哪里来? 两种机制,源码安装和二进制安装. 二.源码安装 tarball 1.核心思想是:利用开源代码,自己编译生成应用程序或者库,要求系统上必须已安装TMG(tar, make ...
- centos7安装mysql5.6(rpm包安装)
应用场景:日常需求安装数据库——MySQL. 安装环境:① 最小化安装的centos7.2(同版本RHEL7适用): ② MySQL 5.6: 具体步骤: 1. 下载mysql 5.6并解压(官网有时 ...
- Windows下安装mysql cluster
0.mysql集群介绍 浅谈mysql集群——http://blog.csdn.net/chenxingzhen001/article/details/7708663: 官网——http://dev. ...
- CentOS-6.4-minimal版中安装JDK_Maven_Subversion以及改动rpm包安装路径
完整版见https://jadyer.github.io/2013/09/07/centos-config-develop/ /** * @see -------------------------- ...
随机推荐
- 【2】从零认识中心极限思想-e往无尽
目录 e往无尽 单调性.有界性 \(e^{-x^2}\)的积分性质 函数列的近似 傅里叶的方案 三角函数系的正交性 傅立叶展开 傅立叶展开式的指数形式 e往无尽 无论是学高数,还是学习数分,我们在讲到 ...
- windows 安装MySQL服务 zip解压程序
1:配置 my.ini 文件 如下: [mysql] default-character-set=utf8[mysqld] port=3306basedir=D:\\Program Files\\da ...
- fatal: remote origin already exists.
解决方法: 先删除, 再添加 1. git remote rm origin 2. git remote add origin https://github.com/zjulanjian/eshop. ...
- 编译原理_P1004
龙书相关知识点总结 //*************************引论***********************************// 1. 编译器(compiler):从一中语言( ...
- Exchang Online 保护策略
一.恶意软件筛选器 1.配置反恶意软件策略 1.1Exchange管理中心->保护->恶意软件筛选器->双击Default->编辑默认的策略 1.2单击“设置”选项,根据需要进 ...
- sql的书写顺序
例:select t.* from (select * from t_user where isDelete = 1 limit 0,10) t order by t.qq select from ...
- 02-Java开发环境的配置
在本章节中我们将为大家介绍如何搭建Java开发环境. Windows 上安装开发环境 window系统安装java 下载JDK 首先我们需要下载java开发工具包JDK,下载地址:http://www ...
- 吴裕雄--天生自然python学习笔记:Matplotlib 基本绘图
使用 Matplotlib 组件绘图时,经常要与 Numpy 组件搭配使用 . 使用 Matplotlib 绘图首先要导入 Matplotlib 组件 , 由于大部分绘图功能是在 matplotlib ...
- 对Java8新的日期时间类的学习(二)
示例11 在Java中如何判断某个日期是在另一个日期的前面还是后面 这也是实际项目中常见的一个任务.你怎么判断某个日期是在另一个日期的前面还是后面,或者正好相等呢?在Java 8中,LocalDate ...
- FPGA基础架构总结
1.为什么FPGA的整体逻辑的速度有限制? 与ASIC相比较,AS指的是(application specific)专用集成应用,而FPGA是可编程逻辑,在实现的过程中,AS是直接用最基础的逻辑门实现 ...