标签:lib ignore 备份 集群配置 命令行 oca port initial 关闭
管理节点 10.0.0.19 数据节点 10.0.0.12 10.0.0.17 sql节点 10.0.0.18 10.0.0.22
groupadd mysql useradd mysql -g mysql
cd /home/test tar -zxvf mysql-cluster-gpl-7.3.5-linux-glibc2.5-x86_64.tar.gz -C /usr/local mv mysql-cluster-gpl-7.3.5-linux-glibc2.5-x86_64/ mysql cd ../ chown -R mysql:mysql mysql/ cd mysql ./scripts/mysql_install_db --user=mysql 这个步骤所有服务器都需要执行(5台)
vim /usr/local/mysql/config.ini #lizhenghua [ndbd default] noOfReplicas=1 [ndb_mgmd] hostname=192.168.145.138 datadir=/usr/local/mysql/data [ndbd] hostname=192.168.145.140 datadir=/usr/local/mysql/data [MYSQLD] hostname=192.168.145.141 [MYSQLD] [mysqld] #博客园 [NDBD DEFAULT] NoOfReplicas=2 [TCP DEFAULT] portnumber=3306 [NDB_MGMD] #设置管理节点服务器 nodeid=1 HostName=10.0.0.19 DataDir=/var/mysql/data [NDBD] id=2 HostName=10.0.0.12 DataDir=/var/mysql/data [NDBD] id=3 HostName=10.0.0.17 DataDir=/var/mysql/data [MYSQLD] id=4 HostName=10.0.0.18 [MYSQLD] id=5 HostName=10.0.0.22 #必须有空的mysqld节点,不然数据节点断开后启动有报错 [MYSQLD] id=6 [mysqld] id=7
ndb_mgmd -f /usr/local/mysql/config.ini
[root@localhost bin]#ndb_mgm ndb_mgm> shutdowm
ndb_mgmd -f /usr/local/mysql/config.ini --initial
ndb_mgm> show 查看各节点情况。 ndb_mgm> all report memory 查看各数据节点使用情况 ndb_mgm>create nodegroup 3;创建数据节点分组 mysql> alter online table data_house reorganize partition; 调整分区数据
vim /etc/my.cnf (添加以下内容)
#lizhenghua [mysqld] basedir=/usr/local/mysql datadir=/usr/local/mysql/data ndbcluster ndb-connectstring=192.168.145.138 [mysql_cluster] ndb-connectstring=192.168.145.138 [NDB_MGM] connect-string=192.168.145.138 [mysqld_safe] log-error=/usr/local/mysql/log/mysqld.log pid-file=/usr/local/mysql/mysqld.pid #博客园 [mysqld] datadir=/var/mysql/data socket=/var/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 #运行NDB存储引擎 ndbcluster #指定管理节点 ndb-connectstring=10.0.0.19 [MYSQL_CLUSTER] ndb-connectstring=10.0.0.19 [NDB_MGM] connect-string=10.0.0.19 [mysqld_safe] log-error=/var/mysql/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
cd /usr/local/mysql/ cp support-files/mysql.server /etc/rc.d/init.d/mysqld chmod +x /etc/rc.d/init.d/mysqld chkconfig --add mysqld
vim /etc/my.cnf (添加以下内容)
#lizhenghua [mysqld] ndbcluster ndb-connectstring=192.168.145.138 explicit_defaults_for_timestamp=true lower_case_table_names=1 pid-file = /usr/local/mysql/data/mysql3306.pid log-error = /usr/local/mysql/data/mysql3306.err basedir = /usr/local/mysql datadir = /usr/local/mysql/data skip-host-cache skip-name-resolve max_connections = 512 log-bin=mysql-bin #log = /usr/local/mysql/binlog/binlog.log [mysql_cluster] ndb-connectstring=192.168.145.138 #博客园 [mysqld] server-id=4#每个服务器的id不一样 datadir=/var/mysql/data socket=/var/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-bin = /var/mysql/log/mysql-bin.log max_connections=1000 #以下为mysql 主主模式的配置文件 # 忽略mysql数据库复制 binlog-ignore-db=mysql # 每次增长2 auto-increment-increment = 2 # 设置自动增长的字段的偏移量,即初始值为2 auto-increment-offset = 1 [mysqld_safe] log-error=/var/mysql/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid [MYSQLD] ndbcluster ndb-connectstring=10.0.0.19 [MYSQL_CLUSTER] ndb-connectstring=10.0.0.19 [NDB_MGM] connect-string=10.0.0.19
service mysqld start
标签:lib ignore 备份 集群配置 命令行 oca port initial 关闭
原文地址:http://www.cnblogs.com/chenglee/p/7742615.html