热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mysqlcluster能单独_mysqlcluster中的sqlnode(主)与单独的mysqlserver(从)做主从复制(异常解决)...

mysql-cluster中的sqlnode(主)与单独的mysqlserver(从)做主从复制(错误解决)集群环境:mysql-cluster7.2.8(mysql

mysql-cluster 中的 sql node(主) 与 单独的 mysql server(从) 做主从复制(错误解决)

集群环境:

mysql-cluster 7.2.8 (mysql 5.5.27 ; ndb 7.2.8)

192.168.55.11 mgm node (nodeid=1)

192.168.55.10 data node (nodeid=2)+ sql node (nodeid=4)

192.168.55.9  data node (nodeid=3)+ sql node(nodeid=5)

MySQL服务器:

192.168.55.133 mysql

启动:# /var/lib/mysql/bin/mysqld_safe &

关闭:# /var/lib/mysql/bin/mysqladmin shutdown

进入数据库:#  /var/lib/mysql/bin/mysql -u root -p

主从环境搭配:

主:master(sql node (nodeid=4))

[mysqld]

server-id = 1

log-bin = mysql-bin

binlog_format = row

binlog-do-db = db_name1

binlog-do-db = db_name2

binlog-ignore-db = db_name3

从:slave(mysql)

[mysqld]

server-id = 3

log-bin = mysql-bin

binlog_format = row

binlog-do-db = db_name1

binlog-do-db = db_name2

binlog-ignore-db = db_name3

55.133

55.9

# mysqld_safe --ndb_nodeid=5 --user=mysql --server_id=1 &

# mysql -u mysql -p

mysql> show master status;

+------------------+----------+------------------+------------------+

| File             | Position | Binlog_Do_DB     | Binlog_Ignore_DB |

+------------------+----------+------------------+------------------+

| mysql-bin.000003 |      112 | db_name1,db_name2 | db_name3            |

+------------------+----------+------------------+------------------+

1 row in set (0.00 sec)

mysql> grant replication slave on *.* to slavemysql@192.168.211.133 identified by '908'; # 如果权限不够,切换到root

mysql> flush privileges;

55.133

# /var/lib/mysql/bin/mysqld_safe &

# /var/lib/mysql/bin/mysql -u root -p

mysql> change master to master_host='192.168.55.9', master_user='slaveuser', master_password='000', master_log_file='mysql-bin.000003', master_log_pos=112;

mysql> start slave;

mysql> show slave status/G;

提示错误: Last_IO_Error: error connecting to master 'slaveuser@192.168.55.9:3306' - retry-time: 60  retries: 86400

但是通过:# mysql -h 192.168.55.9 -u slavemysql -p 可成功登录远程9上的数据库。

# 在55.9上 mysql> grant all on *.* toslavemysql@192.168.211.133 identified by '908'; 也已经成功授权

错误已经修正:参考:http://blog.csdn.net/xc_gxf/article/details/8292075

e7ce419cf2d6ad34d01da2ceb8829eed.png

微信 赏一包辣条吧~

023a57327877fb4402bcc76911ec18ea.png

支付宝 赏一听可乐吧~



推荐阅读
author-avatar
学习小菜鸟
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有