首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MariaDB Galera聚类-主动活动-操作不允许的错误

MariaDB Galera聚类-主动活动-操作不允许的错误
EN

Server Fault用户
提问于 2013-09-09 17:36:09
回答 1查看 1.4K关注 0票数 -1

我对MariaDB和Galera在RHEL6.4& 6.2 64位服务器上运行并让它们集群存在问题。我安装了Galera集群所需的RPM:

  • MariaDB-Galera-服务器
  • MariaDB-客户端
  • MariaDB-compat
  • MariaDB-公共
  • MariaDB-共享
  • MariaDB-测试
  • 加雷拉

然后,在安装MariaDB及其所有组件之后,我检查了它通常保存文件、/var/lib/mysql//var/log/mysql/的目录,并执行了

代码语言:javascript
复制
chown -R mysql:mysql /var/lib/mysql/
chown -R mysql:mysql /var/log/mysql/

我以独立模式启动了这两个服务器,并配置了一个复制用户:

代码语言:javascript
复制
grant all privileges on *.* to 'mariadb-user'@'localhost' identified by 'password' with grant option;
grant all privileges on *.* to 'mariadb-user'@'%' identified by 'password' with grant option;

这样的话,我就会有一个数据库的用户与之通信。然后,我在主节点和从节点上编辑了我的信任:

代码语言:javascript
复制
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]
general_log_file=/var/log/mysql/mysqld.log
general_log=1
log_warning=2
log-error=/var/log/mysql/error.log
#log-bin=/var/log/mysql-bin.log
log-slow-queries=/var/log/mysql-slow-queries.log
# this is only for the mysqld standalone daemon
[mysqld]

# this is only for embedded server
[embedded]

# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]

# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
wsrep_cluster_address=gcomm://mariadb-master.net,mariadb-slave.net
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
wsrep_cluster_name=corp-zabbix-server
wsrep_debug=on
wsrep_sst_auth=mariadb-user:cerner
##wsrep_sst_auth=root:
wsrep_sst_method=mysqldump
##wsrep_sst_method=xtrabackup
[mariadb-5.5]

一旦信任到位,我确保防火墙允许流量通过,基本上是通过清除他们的iptables -F。然后,我使用以下方法初始化主服务器上的集群:

代码语言:javascript
复制
/etc/init.d/mysql start --wsrep_cluster_address=gcomm://

进程出现在主节点上,在从节点上使用:

代码语言:javascript
复制
service mysql start

然后,从节点连接一段时间,交换状态,然后退出,表示不允许进行操作。

MariaDB_错误_在Pastebin.com登录

这是/var/log/mysql/mysql.log的输出:

代码语言:javascript
复制
/usr/sbin/mysqld, Version: 5.5.32-MariaDB-log (MariaDB Server, wsrep_23.7.5.rXXXX). started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.5.32-MariaDB-log (MariaDB Server, wsrep_23.7.5.rXXXX). started with:
Tcp port: 0  Unix socket: (null)
Time                 Id Command    Argument
130910  8:18:48     3 Connect   mariadb-user@mariadb-master.net as anonymous on
                    3 Query     select @@version_comment limit 1
                    3 Query     SET wsrep_on=OFF
                    3 Query     SELECT @@GENERAL_LOG
                    3 Quit
                    4 Connect   mariadb-user@mariadb-master.net as anonymous on
                    4 Query     select @@version_comment limit 1
                    4 Query     SET wsrep_on=OFF
                    4 Query     SELECT @@SLOW_QUERY_LOG
                    4 Quit
                    5 Connect   mariadb-user@mariadb-master.net as anonymous on
                    5 Query     select @@version_comment limit 1
                    5 Query     SET wsrep_on=OFF
                    5 Query     SET GLOBAL GENERAL_LOG=OFF
/usr/sbin/mysqld, Version: 5.5.32-MariaDB-log (MariaDB Server, wsrep_23.7.5.rXXXX). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
130910  8:18:50     7 Query     SET GLOBAL SLOW_QUERY_LOG=1
                    7 Quit
130910  8:18:51     8 Connect   mariadb-user@mariadb-master.net as anonymous on
                    8 Query     select @@version_comment limit 1
                    8 Query     SET wsrep_on=OFF
                    8 Query     SELECT @@GENERAL_LOG
                    8 Quit
                    9 Connect   mariadb-user@mariadb-master.net as anonymous on
                    9 Query     select @@version_comment limit 1
                    9 Query     SET wsrep_on=OFF
                    9 Query     SELECT @@SLOW_QUERY_LOG
                    9 Quit
                   10 Connect   mariadb-user@mariadb-master.net as anonymous on
                   10 Query     select @@version_comment limit 1
                   10 Query     SET wsrep_on=OFF
                   10 Query     SET GLOBAL GENERAL_LOG=OFF
/usr/sbin/mysqld, Version: 5.5.32-MariaDB-log (MariaDB Server, wsrep_23.7.5.rXXXX). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
130910  8:18:52    12 Query     SET GLOBAL SLOW_QUERY_LOG=1
                   12 Quit
130910  8:18:53    13 Connect   mariadb-user@mariadb-master.net as anonymous on
                   13 Query     select @@version_comment limit 1
                   13 Query     SET wsrep_on=OFF
                   13 Query     SELECT @@GENERAL_LOG
                   13 Quit
                   14 Connect   mariadb-user@mariadb-master.net as anonymous on
                   14 Query     select @@version_comment limit 1
                   14 Query     SET wsrep_on=OFF
                   14 Query     SELECT @@SLOW_QUERY_LOG
                   14 Quit
                   15 Connect   mariadb-user@mariadb-master.net as anonymous on
                   15 Query     select @@version_comment limit 1
                   15 Query     SET wsrep_on=OFF
                   15 Query     SET GLOBAL GENERAL_LOG=OFF
/usr/sbin/mysqld, Version: 5.5.32-MariaDB-log (MariaDB Server, wsrep_23.7.5.rXXXX). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
130910  8:18:55    17 Query     SET GLOBAL SLOW_QUERY_LOG=1
                   17 Quit

我不知道我还应该做什么。我以前让这个集群工作过,但在完成OS基线之后,我立即恢复到快照。所以,在我看来,它应该以同样的方式工作,但实际上并非如此。我是否应该在与数据库用户相同的框上创建一个本地用户?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2013-09-11 13:39:55

如果您查看第18和第19行pastebin链接上的错误消息,就会看到以下引用:

代码语言:javascript
复制
130906 12:47:32 [ERROR] mysqld: File '/var/log/mysql-slow-queries.log' not found (Errcode: 13)
130906 12:47:32 [ERROR] Could not use /var/log/mysql-slow-queries.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.

我所做的是,当我创建我的配置文件时,我用手指捏造了一行:

代码语言:javascript
复制
log-slow-queries=/var/log/mysql-slow-queries.log

一旦我编辑了这一行以反映:

代码语言:javascript
复制
log-slow-queries=/var/log/mysql/mysql-slow-queries.log

星系团神奇地运转。我现在能够在数据库之间进行复制,并让它们发挥作用。我不太清楚为什么这一条线会阻止一切正常工作,但它做到了。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/537553

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档