环境: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 包的更多相关文章

  1. CentOS7 安装 MySQL Cluster 7.6.7

    引用自:http://lemonlone.com/posts/mysql-ndb-cluster-install/ 仅做备份和配置文件更改 1.先在VMware中安装 CentOS-7-x86_64- ...

  2. zabbix安装及配置(rpm包安装mysql,php,apache,zabbix)

    zabbix安装及配置 一.安装mysql.php.apache.zabbix 安装环境: 操作系统:rhel6.3-x86-64  mysql:5.6.23   --官网下载rpm包安装php:5. ...

  3. Linux 5 下安装MySQL 5.6(RPM方式)

    MySQL在很多领域被广泛使用,尤其是很多互联网企业,诸如腾讯,阿里等等.本文主要介绍在Linux 5下通过rpm方式来安装Mysql,这是比较简单的一种安装方式,具体详见下文. <MySQL权 ...

  4. 【转】Linux系统上安装MySQL 5.5 rpm

    1.准备工作 从MySQL官网上分别下载mysql服务器端于客户端包. 如: MySQL-server-5.5.15-1.linux2.6.x86_64.rpm和MySQL-client-5.5.15 ...

  5. Linux之保留yum安装软件后的RPM包

    yum安装软件很方便,但是下载下来的rpm包在安装后默认会被删除掉: 如果希望保留yum安装的软件包该如何做呢? 设置方法: 将/etc/yum.conf里对应的keepcache参数改为1即可,然后 ...

  6. Linux应用和系统库的2种安装方式---源码安装tarball和二进制rpm包

    一.应用程序和系统库从哪里来? 两种机制,源码安装和二进制安装. 二.源码安装 tarball 1.核心思想是:利用开源代码,自己编译生成应用程序或者库,要求系统上必须已安装TMG(tar, make ...

  7. centos7安装mysql5.6(rpm包安装)

    应用场景:日常需求安装数据库——MySQL. 安装环境:① 最小化安装的centos7.2(同版本RHEL7适用): ② MySQL 5.6: 具体步骤: 1. 下载mysql 5.6并解压(官网有时 ...

  8. Windows下安装mysql cluster

    0.mysql集群介绍 浅谈mysql集群——http://blog.csdn.net/chenxingzhen001/article/details/7708663: 官网——http://dev. ...

  9. CentOS-6.4-minimal版中安装JDK_Maven_Subversion以及改动rpm包安装路径

    完整版见https://jadyer.github.io/2013/09/07/centos-config-develop/ /** * @see -------------------------- ...

随机推荐

  1. F - Fraction Formula Gym - 102307F

    Mr. Potato Head has been promoted and now is a math professor at the UNAL. For his first course he i ...

  2. APUE 书中 toll 函数

    今天看unix环境高级编程时,随着书上的源码打了一遍,编译时提示 toll函数未定义, 找了半天(恕我对上下文不了解).看了英文版和源代码文件才知道, 中文版打印错了: toll => atol ...

  3. 为什么使用 document.write 需要将</script>拆分开

    福州SEO:细心点的朋友可能会注意到,有些网站使用document.write动态加载JS的时候需要把</script>拆分开来写?如下面的例子所示: <script type='t ...

  4. DataSet,DataTable排序(转载)

    DataSet,DataTable排序   关于对已经绑定的DataSet的排序的问题: DataSet ds=new DataSet();DataView dv=new DataView();dv. ...

  5. oracle时间处理tochar的黑幕坑

    建议改成 在用别人黑不隆东,各种商业套路洗脑下的产品时,能简约弱智就被给自己留坑 做技术没踩过h2这类开源数据库的源码设计,即使砸了一堆时间看了<数据库系统基础教程>,<数据库系统实 ...

  6. Regex of Perl: ?= 指的是如果后面匹配到,则后面的内容不做替换,保留。 ab, s/a?=b/x/,变为xb,即后面匹配到b,b保留不做替换

    Regex of Perl: ?= 指的是如果后面匹配到,则后面的内容不做替换,保留.  ab, s/a?=b/x/,变为xb,即后面匹配到b,b保留不做替换

  7. 基础篇五:Nginx的目录和基础配置

    Yum安装目录:yum的方式安装 rpm -ql nginx 下面开始安装目录详解

  8. 2018SEERC Points and Rectangles (CDQ分治)

    题:http://codeforces.com/gym/101964/problem/K 分析:https://blog.csdn.net/qq_43202683/article/details/98 ...

  9. SwipeRefreshLayout 下拉刷新

    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com ...

  10. 吴裕雄--天生自然 HADOOP大数据分布式处理:安装配置Tomcat服务器

    下载链接:https://tomcat.apache.org/download-80.cgi tar -zxvf apache-tomcat-8.5.42.tar.gz -C /usr/local/s ...