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 -------------------------- ...
随机推荐
- Underscore _.template 方法使用详解
为什么用「void 0」代替「undefined」 undefined 并不是保留词(reserved word),它只是全局对象的一个属性,在低版本 IE 中能被重写. 事实上,undefined ...
- ZOJ-1610 Count the Colors(线段树染色,求染色段)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1610 https://vjudge.net/contest/318019# ...
- 2019-2020-1 20199324《Linux内核原理与分析》第四周作业
第三章 MenuOs的构造 一.知识点总结 计算机的三大法宝: 存储程序计算机 函数调用堆栈 中断 操作系统的两把宝剑: 中断上下文的切换(保存现场和恢复现场) 进程上下文的切换 它们都和汇编语言有着 ...
- winform 界面加载慢原因分析
公司新来的开发人员,对winform开发还不是特别精通,在做个性化界面体验的时候容易出现闪烁和加载慢 闪烁的话,通过winform窗体的双缓存来解决在form 窗体中增加如下代码 protected ...
- 吴裕雄--天生自然python Google深度学习框架:Tensorflow基础应用
import tensorflow as tf a = tf.constant([1.0, 2.0], name="a") b = tf.constant([2.0, 3.0], ...
- day19-3个双下item方法
#使用双下item方法来实现属性的增删改查: # 查:__getitem__ 增改:__setitem__ 删除: __delitem__ class Goods: def __init__(self ...
- day04-函数,装饰器初成
面试的时候,经常被问过装饰器,所以掌握好装饰器非常重要. 一.装饰器形成的过程:1.最简单的装饰器.2.被装饰的函数有返回值.3.被装饰的函数有一个参数.4.被装饰的函数有多个位置参数.5.被装饰的函 ...
- 以puppeteer抓取微指数,puppeteer基本示例,docker部署headless
还是直接上代码 https://github.com/cclient/weizhishu-puppeteer 根据关键字获取微博指数 早期版本以常规的构造cookie,token,sign的访问api ...
- CentOS-SendMail服务
title date tags layout music-id CentOS6.5 SendMail服务安装与配置 2018-09-04 Centos6.5服务器搭建 post 456272749 一 ...
- Django学习之模板层
三板斧 render,HttpResponse,redirectrender返回一个HTML页面,并且还能够给该页面传数据render内部原理: from django.template import ...