您的位置:首页 > 数据库 > MySQL

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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: