MySQL Cluster 7.3 安装(二)------初始化配置 MySQL Cluster 7.3
来源:互联网 发布:tomcat 配置端口 编辑:程序博客网 时间:2024/06/05 16:12
以下配置不同操作系统通用
0.网络环境和规划
如果不希望在下面的配置中使用IP地址,也可以使用主机名
CentOS
# ndb1 /etc/hosts
:127.0.0.1 ndb1.cluster ndb1 localhost.localdomain localhost
# ndb2 /etc/hosts
:127.0.0.1 ndb2.cluster ndb2 localhost.localdomain localhost
Windows
C:\WINDOWS\system32\drivers\etc\hosts
每个数据节点(Data Node)和SQL节点(SQL Node)都必须一个my.cnf文件,它提供了两个信息,一是连接字符串,使每个节点都能找到管理节点,另一个是告诉MySQL服务在这个节点(数据节点)提供存储引擎
管理节点(Management Node)需要config.ini文件,获取节点信息,用于位数据和索引在每个数据节点分配内存,寻找数据节点,保存树蕨到每个节点,以及寻找sql节点
2.配置 data nodes 和 SQL nodes
my.cnf应该在/etc文件夹下,如果 不存在则创建一个
编辑如下
########################################################
[mysqld]# Options for mysqld process:ndbcluster # run NDB storage engine[mysql_cluster]# Options for MySQL Cluster processes:
ndb-connectstring=nodeid=21,192.168.0.10 # location of management server
注意这里的id和节点所在的ip应该和managment配置文件中的匹配,如果有多个管理节点,使用逗号隔开
########################################################
为每个节点做类似的配置
2.配置 management
首先创建可以找到的目录,然后创建文件
例如
shell>
mkdir /var/lib/mysql-cluster
shell>
cd /var/lib/mysql-cluster
shell>
vi config.ini
编辑
config.ini如下
#########################################################
[ndbd default]# Options affecting ndbd processes on all data nodes:NoOfReplicas=2 # Number of replicasDataMemory=80M # How much memory to allocate for data storageIndexMemory=18M # How much memory to allocate for index storage # For DataMemory and IndexMemory, we have used the # default values. Since the "world" database takes up # only about 500KB, this should be more than enough for # this example Cluster setup.[tcp default]# TCP/IP options:portnumber=2202 # This the default; however, you can use any # port that is free for all the hosts in the cluster # Note: It is recommended that you do not specify the port # number at all and simply allow the default value to be used # instead[ndb_mgmd]# Management process options:
id=1hostname=192.168.0.10 # Hostname or IP address of MGM nodedatadir=/var/lib/mysql-cluster # Directory for MGM node log files[ndbd]# Options for data node "A":
id=11 # (one [ndbd] section per data node)hostname=192.168.0.30 # Hostname or IP addressdatadir=/usr/local/mysql/data # Directory for this data node's data files[ndbd]# Options for data node "B":id=12
hostname=192.168.0.40 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files[mysqld]# SQL node options:
id=21hostname=192.168.0.20 # Hostname or IP address # (additional mysqld connections can be # specified for this node for various # purposes such as running ndb_restore)
###############################################################
注意 必须在存储节点手动建立datadir路径,本文为例,分别在存储节点192.168.0.40,192.168.0.30建立/usr/local/mysql/data路径,data是文件夹
默认情况下,每个节点都需要防火墙允许3306、1186和2202端口
未经允许,请勿转载 交流群 129268869
0 0
- MySQL Cluster 7.3 安装(二)------初始化配置 MySQL Cluster 7.3
- MySQL Cluster 7.3 安装(三)------初始化启动 MySQL Cluster 7.3
- MySQL-Cluster 7.3.2 安装和配置
- MySQL-Cluster 7.3.2 安装和配置
- MySQL Cluster安装配置
- MySQL Cluster 安装与配置
- mysql cluster 配置与安装
- Ubuntu 安装配置mysql-cluster
- MySQL Cluster 7.3 安装(一)------使用RPM安装MySQL Cluster 7.3
- 虚拟机windows xp 下安装配置mysql cluster 7.3.2
- mysql cluster (mysql 集群)安装配置方案
- mysql cluster (mysql 集群)安装配置方案
- mysql-cluster 7.3.5-linux 安装
- mysql-cluster 7.3.5-linux 安装
- Linux下mysql集群(mysql cluster)安装配置手记
- MySQL Cluster 7.3.5 集群配置实例( 入门篇 )
- mysql cluster 配置
- Mysql Cluster单机配置
- installing chkconfig on ubuntu
- C与C++比较(网友观点整理)
- Struts迭代器(iterator)遍历List常用的4种例子
- Cocos2dx 小技巧(九)现成的粒子特效
- eclipse 配置 maven 编译代码
- MySQL Cluster 7.3 安装(二)------初始化配置 MySQL Cluster 7.3
- XML学习笔记 5. XSLT
- Remove Mapping
- MAC终端快捷健
- Cocos2dx 3.0 过渡篇(二十五)死不了的贪食蛇(触摸版)
- 使用JVMTI获取Java多线程程序指令执行次序
- Cocos2dx 3.0 过渡篇(二十六)C++11多线程std::thread的简单使用(上)
- ibatis mybatis区别-使用层面
- CFBundleVersion与CFBundleShortVersionString