GreatSQL社区

搜索

[已解决] MGR 配置第二节点用户显示只读

586 1 2024-2-27 21:31
第二节点创建用户时提示只读,在安装文档中提到“重启GreatSQL实例后(report-host 是只读选项,需要重启才能生效),创建MGR服务专用账号及配置MGR服务通道:” ,重启该怎么操作?

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST   | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 960fbf06-ce2e-11ee-84b4-000c29759f14 | 192.168.2.182 |        3306 | ERROR        |             | 8.0.32         | XCom                       |
| group_replication_applier | 9ff7b4bd-ce2e-11ee-b76e-000c29721c48 | 192.168.2.181 |        3306 | ONLINE       | PRIMARY     | 8.0.32         | XCom                       |
+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
2 rows in set (0.00 sec)
mysql> set session sql_log_bin=0;
Query OK, 0 rows affected (0.00 sec)
mysql> create user repl@'%' identified with mysql_native_password by 'repl';
ERROR 1290 (HY000): The MySQL server is running with the --super-read-only option so it cannot execute this statement
mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST   | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |

+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 960fbf06-ce2e-11ee-84b4-000c29759f14 | 192.168.2.182 |        3306 | ERROR        |             | 8.0.32         | XCom                       |
+---------------------------+--------------------------------------+---------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.00 sec)


另外第二个节点还需要设置如下两条吗?
SET GLOBAL group_replication_group_seeds= "192.168.2.181:33061,192.168.2.182:33061,192.168.2.183:33061";

SET GLOBAL group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1";



my.cnf 配置如下:
[root@sql02 ~]# cat /etc/my.cnf
[mysqld]
user = mysql
basedir=/usr/local/GreatSQL-8.0.32-25-Linux-glibc2.28-x86_64
datadir=/data/GreatSQL
port=3306
server_id=33062
log-bin
log_slave_updates=1
gtid_mode=ON
enforce_gtid_consistency=ON
log_error = /data/GreatSQL/error.log
plugin_load_add='group_replication.so'
group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"
group_replication_local_address= "192.168.2.182:33061"
group_replication_group_seeds= "192.168.2.181:33061,192.168.2.182:33061,192.168.2.183:33061"
report-host=192.168.2.182

全部回复(1)
yejr 2024-2-28 09:12:43
参考这篇文档用MySQL Shell构建MGR:https://greatsql.cn/docs/8032-25 ... r%E9%9B%86%E7%BE%A4

也可以用手工方式部署:https://gitee.com/GreatSQL/Great ... deep-dive-mgr-03.md

创建MGR专属用户、修改report-host这些都应该在启动MGR服务前先准备好,而不是等MGR服务启动后再创建用户。启动MGR服务后,如果是非primary节点,都默认是read only保护状态。
lb8125

5

主题

0

博客

13

贡献

新手上路

Rank: 1

积分
20

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-24 13:40 , Processed in 0.019380 second(s), 14 queries , Redis On.
快速回复 返回顶部 返回列表