MySQLCluster安装配置(二)
2015-08-22 12:06
549 查看
二、 Mysql Cluster --配置文件
1. my.cnf
每一个数据结点和SQL结点需要配置一个my.cnf文件,该文件包含两条信息:一条连接信息找到管理结点,一条配置ndbcluster存储引擎
vi /etc/my.cnf
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
datadir=/mysqlcluster/SQLNode/mysql/data
basedir=/mysqlcluster/SQLNode/mysql
[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=192.168.120.9 # location of management server
2.config.ini
管理结点需要配置config.ini,可以配置有多少备份,多少内存和索引,如何找到数据结点和sql结点
shell> mkdir/mysqlcluster/ManageNode/mysql-cluster
shell> mkdir/mysqlcluster/ManageNode/ndb-log
shell> cd/mysqlcluster/ManageNode/mysql-cluster
shell> vi config.ini
[ndbd default]
# Options affecting ndbdprocesses on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=80M # How much memory to allocate for datastorage
IndexMemory=18M # How much memory to allocate for indexstorage
# For DataMemory andIndexMemory, we have used the
# default values. Since the"world" database takes up
# only about 500KB, thisshould 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 allthe hosts in the cluster
# Note: It is recommendedthat you do not specify the port
# number at all and simplyallow the default value to be used
# instead
[ndb_mgmd]
# Management processoptions:
NodeId=1
hostname=192.168.120.9 # Hostname or IP address ofMGM node
datadir=/mysqlcluster/ManageNode/ndb-log # Directory for MGM node log files
[ndbd]
# Options for data node"A":
# (one [ndbd]section per data node)
NodeId=2
hostname=192.168.120.9 # Hostname or IP address
datadir=/mysqlcluster/SQLNode/mysql/data # Directory for this data node's data files
[ndbd]
# Options for data node"B":
NodeId=3
hostname=192.168.120.10 # Hostname or IP address
datadir=/mysqlcluster/SQLNode/mysql/data # Directory for this data node's data files
[mysqld]
# SQL node options:
NodeId=4
hostname=192.168.120.9 # Hostname or IP address
# (additionalmysqld connections can be
# specified forthis node for various
# purposes suchas running ndb_restore)
[mysqld]
# SQL node options:
NodeId=5
hostname=192.168.120.10 # Hostname or IP address
# (additionalmysqld connections can be
# specified for this node forvarious
# purposes suchas running ndb_restore)
1. my.cnf
每一个数据结点和SQL结点需要配置一个my.cnf文件,该文件包含两条信息:一条连接信息找到管理结点,一条配置ndbcluster存储引擎
vi /etc/my.cnf
[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine
datadir=/mysqlcluster/SQLNode/mysql/data
basedir=/mysqlcluster/SQLNode/mysql
[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=192.168.120.9 # location of management server
2.config.ini
管理结点需要配置config.ini,可以配置有多少备份,多少内存和索引,如何找到数据结点和sql结点
shell> mkdir/mysqlcluster/ManageNode/mysql-cluster
shell> mkdir/mysqlcluster/ManageNode/ndb-log
shell> cd/mysqlcluster/ManageNode/mysql-cluster
shell> vi config.ini
[ndbd default]
# Options affecting ndbdprocesses on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=80M # How much memory to allocate for datastorage
IndexMemory=18M # How much memory to allocate for indexstorage
# For DataMemory andIndexMemory, we have used the
# default values. Since the"world" database takes up
# only about 500KB, thisshould 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 allthe hosts in the cluster
# Note: It is recommendedthat you do not specify the port
# number at all and simplyallow the default value to be used
# instead
[ndb_mgmd]
# Management processoptions:
NodeId=1
hostname=192.168.120.9 # Hostname or IP address ofMGM node
datadir=/mysqlcluster/ManageNode/ndb-log # Directory for MGM node log files
[ndbd]
# Options for data node"A":
# (one [ndbd]section per data node)
NodeId=2
hostname=192.168.120.9 # Hostname or IP address
datadir=/mysqlcluster/SQLNode/mysql/data # Directory for this data node's data files
[ndbd]
# Options for data node"B":
NodeId=3
hostname=192.168.120.10 # Hostname or IP address
datadir=/mysqlcluster/SQLNode/mysql/data # Directory for this data node's data files
[mysqld]
# SQL node options:
NodeId=4
hostname=192.168.120.9 # Hostname or IP address
# (additionalmysqld connections can be
# specified forthis node for various
# purposes suchas running ndb_restore)
[mysqld]
# SQL node options:
NodeId=5
hostname=192.168.120.10 # Hostname or IP address
# (additionalmysqld connections can be
# specified for this node forvarious
# purposes suchas running ndb_restore)
相关文章推荐
- 安装配置MySqlCluster
- MySQL必知必会(Select, Where子句)
- mysql中int、bigint、smallint 和 tinyint的区别详细介绍
- mysql实时同步到mssql的解决方案
- MYSQL的运算符
- MySQL必知必会(Select, Order by子句)
- mysql 的 存储结构(储存引擎)
- 【MySQL for Mac】在Mac终端导入&导出.sql文件
- MySQL中的字符串拼接
- MySQL必知必会(Select)
- mysql mysqli处理事务
- MySQL必知必会(Insert into)
- MySQL必知必会(Create, Alter)
- /usr/bin/ld: cannot find -lmysqlclient_r
- MySQL索引原理及慢查询优化
- 经典mysql语句
- MySQL字符串函数
- Redhat安装mysql及 导出数据库
- mysql 外键的记载
- Mysql 5.1升级为mysql 5.6遇到的问题及解决方式