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 -------------------------- ...
随机推荐
- maven 设置pom 指定jdk版本
<profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</acti ...
- OfficeidMsoViewer最新版
点击下载 OfficeidMsoViewer最新版
- 写入简单的日志log
log.c: #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h& ...
- Nginx_配置文件解读及模板
Nginx 介绍 # nginx的最大优势在于处理静态文件和代理转发功能,支持7层负载均衡和故障隔离. 动静分离是每个网站发展到一定规模之后必然的结果.静态请求则应当最好将其拆分,并启用独立的域名,既 ...
- G - Radar Scanner Gym - 102220G(中位数~~)
zThere are n rectangle radar scanners on the ground. The sides of them are all paralleled to the axe ...
- GitHub 代码仓库提示:“We found a potential security vulnerability in one of your dependencies”
github代码仓库提示:“We found a potential security vulnerability in one of your dependencies” 问题描述: Github上 ...
- python学习笔记(13)常用模块列表总结
os模块: os.remove() 删除文件 os.unlink() 删除文件 os.rename() 重命名文件 os.listdir() 列出指定目录下所有文件 os.chdir() 改变当前工作 ...
- git理论知识
1.Git 有三种状态,你的文件可能处于其中之一:已提交(committed).已修改(modified)和已暂存(staged) 由此引入 Git 项目的三个工作区域的概念:Git 仓库.工作目录以 ...
- springboot学习笔记:5.spring mvc(含FreeMarker+layui整合)
Spring Web MVC框架(通常简称为"Spring MVC")是一个富"模型,视图,控制器"的web框架. Spring MVC允许你创建特定的@Con ...
- [LC] 209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contigu ...