AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[percona](server)

Martin Hope
clarkk
Asked: 2021-02-13 01:05:39 +0800 CST

无法从 Percona 备份(从服务器)恢复主/从复制

  • 0

从master使用 Percona xtrabackup 创建的备份恢复从属

在主 binlog 上设置为在 14 天后过期,并且此备份不到 24 小时

my.cnf(主)

expire_logs_days   = 14

恢复脚本(从属)

service mysql stop

rm -r /var/lib/mysql/*

# backup is unzipped into /var/lib/mysql
xtrabackup --prepare --target-dir=/var/lib/mysql
chown -R mysql.mysql /var/lib/mysql

service mysql start

# get gtid
line=$(head -n 1 "/var/lib/mysql/xtrabackup_binlog_info")
gtid=$(echo $line | awk -F '[ ,]' '{print $3}')

mysql -u root -pPASS -e "reset master; SET GLOBAL gtid_purged='$gtid'; CHANGE MASTER TO MASTER_HOST='$master_host', MASTER_USER='repl', MASTER_PASSWORD='$master_pass', MASTER_AUTO_POSITION=1; start slave"

mysql -u root -pPASS -e "show slave status\G;"

地位

*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: server.com
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File:
          Read_Master_Log_Pos: 4
               Relay_Log_File: rep-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File:
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: mydb
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 154
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID sets and the missing purged transactions are too long to print in this message. For more information, please see the master's error log or the manual for GTID_SUBTRACT.'
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: fe51e8df-b7c4-11e9-be21-4061862b8d34
             Master_Info_File: /mnt/HC_Volume_8355755/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 210211 10:50:32
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: 3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
94bb04d3-6c4e-11eb-8631-96000080ccbb:1-2
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:

/var/lib/mysql/xtrabackup_binlog_info

mysql-bin.000025    217141189   3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
fe51e8df-b7c4-11e9-be21-4061862b8d34:1-25059775

gtid从文件中提取的值:3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477

更新

还尝试/var/lib/mysql/xtrabackup_binlog_info通过执行来获取第二个 uid

gtid=$(tail -n 1 "$mysql_dir/xtrabackup_binlog_info")

没有任何效果..同样的错误

更新 2

show master status在主返回

3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
fe51e8df-b7c4-11e9-be21-4061862b8d34:1-25203198
mysql debian database-replication percona
  • 1 个回答
  • 229 Views
Martin Hope
Tolsadus
Asked: 2020-06-19 00:07:08 +0800 CST

在 MySQL 8 中摆脱 debian-sys-maint 而不是 root

  • 0

我们最近从 MySQL Percona 5.7 升级到 8,我们正处于mysql_native_password从caching_sha2_password.

据我了解,升级的唯一方法Plugin是使用以下查询,如果未提供密码,则将使用空密码。

mysql> ALTER USER 'user'@'host' IDENTIFIED WITH caching_sha2_password BY 'password';

我的两个问题如下。

但是之前的任何更改,debian-sys-maint在 Stretch - MySQL 8 中仍然相关吗?删除该帐户意味着什么?考虑到root多年来它已经取代了它,并且在另一个 Stretch 上进行了全新安装,它不再存在。

与升级过程中没有迁移到的mysql.session类似的情况,在caching_sha2_password不设置任何密码的情况下更改他的插件可以吗?

+-----------+---------------+-----------------------+-------------------------------------------+
| Host      | User          | plugin                | authentication_string                     |
+-----------+---------------+-----------------------+-------------------------------------------+
| localhost | mysql.session | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
+-----------+---------------+-----------------------+-------------------------------------------+
mysql mysql8 percona
  • 1 个回答
  • 168 Views
Martin Hope
HonoredMule
Asked: 2016-12-20 07:54:47 +0800 CST

是否有(大部分)安全的方法来使用 zfs 快照备份实时 MySQL 数据库

  • 4

基本上我正在寻找的是一种告诉mysql(percona-flavored)采取以下步骤的方法:

  • 将所有提交的事务刷新到文件系统
  • 开始缓冲所有事务(使文件系统保持一致状态)
  • 等我做点什么(拍摄 zfs 快照)
  • 取消缓冲写入并恢复正常操作

允许 DDL 语句中断备份的解决方案是可以接受的(因为这种备份解决方案将被频繁应用,而 DDL 语句将非常罕见 - 最坏的情况是不得不比预期多回滚一个小时的数据库)。

备份操作对性能的破坏应该是最小的,但这不是一个负载很重的系统。在每个数据库或系统范围内执行此过程的解决方案都很好,尽管后者在某种程度上是首选。

zfs database-backup percona
  • 1 个回答
  • 720 Views
Martin Hope
HonoredMule
Asked: 2016-12-09 06:50:57 +0800 CST

为 Percona 激活 PAM 配置

  • 0

我正在尝试通过 PAM 为 Percona 配置 LDAP 支持,包括组映射和限制。我的 Percona 身份验证设置如下:

INSTALL PLUGIN pam SONAME 'auth_pam.so';

create user 'dba'@'%' IDENTIFIED WITH auth_pam AS 'mysql';
grant all privileges on *.* to 'dba'@'%' with grant option;

create user 'dbr'@'%' IDENTIFIED WITH auth_pam AS 'mysql';
grant select on *.* to 'dbr'@'%';

CREATE USER ''@'' IDENTIFIED WITH auth_pam AS 'mysql, sudo=dba, mysql=dbr';
GRANT PROXY ON 'dba'@'%' TO ''@'';
GRANT PROXY ON 'dbr'@'%' TO ''@'';

在 /etc/pam.d/mysql 我有:

auth required pam_warn.so
auth required pam_ldap.so
account required pam_ldap.so
account required pam_succeed_if.so user ingroup mysql

有了这些,以下工作:

  • 在 sudo(和 mysql)中以 LDAP 用户身份登录,获得 dba 的权限。
  • 在 mysql 中以 LDAP 用户身份登录,获得 dbr 的权限。
  • 尝试使用无效的用户名和/或密码登录,无法访问。

并且以下行为是不正确的(应该完全拒绝登录):

  • 在 sudo(但不是 mysql)中以 LDAP 用户身份登录,仍然获得 dba 的权限。
  • 以两个组中的 LDAP 用户身份登录,获得无权限访问。

花了很长时间才最终弄清楚配置/etc/pam.d/mysql没有效果。即使该文件不存在,行为也是相同的。

我的理解是字符串中的第一个值mysql, sudo=dba, mysql=dbr告诉 Percona 在名为 mysql 的文件中使用 PAM 配置,并且所有教程都显示文件名解析为/etc/pam.d/mysql.

我错过了什么?

ubuntu mysql pam ubuntu-16.04 percona
  • 1 个回答
  • 334 Views
Martin Hope
Codemonkey
Asked: 2016-06-09 04:20:55 +0800 CST

CentOS6 盒子:yum 删除 Percona-Server-shared-51 依赖项

  • 0

我想安装 Percona 5.7,但是当我运行相关的 yum 命令时,它告诉我 57 与 Percona-Server-shared-51 发生冲突。我真的不知道为什么我还要安装它,因为我也有 Percona-Server-shared-56。

rpm -qa | grep Percona

Percona-Server-client-56-5.6.30-rel76.3.el6.x86_64
Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64
Percona-Server-shared-56-5.6.30-rel76.3.el6.x86_64
Percona-Server-server-56-5.6.30-rel76.3.el6.x86_64

我可以轻松卸载 56 版本,但仍然会遇到与 51 相同的冲突。

当我尝试删除它时,我遇到了这个问题:

yum remove Percona-Server-shared-51

Removing:
 Percona-Server-shared-51                 x86_64                 5.1.73-rel14.12.625.rhel6                   @percona-release-x86_64                                  5.9 M
Removing for dependencies:
 cronie                                   x86_64                 1.4.4-15.el6_7.1                            @updates                                                 174 k
 cronie-anacron                           x86_64                 1.4.4-15.el6_7.1                            @updates                                                  43 k
 crontabs                                 noarch                 1.10-33.el6                                 @anaconda-CentOS-201311291202.x86_64/6.5                 2.4 k
 munin                                    noarch                 2.0.25-11.el6                               @epel                                                    535 k
 munin-node                               noarch                 2.0.25-11.el6                               @epel                                                    1.3 M
 postfix                                  x86_64                 2:2.6.6-6.el6_7.1                           @updates                                                 9.7 M
 sysstat                                  x86_64                 9.0.4-31.el6                                @base                                                    826 k
 yum-cron                                 noarch                 3.2.29-73.el6.centos                        @base                                                     28 k

我可以继续,然后在安装 Percona 5.7 后重新安装这些软件包,还是会遇到问题?我会丢失这些软件包当前设置的任何配置等吗?

谢谢!

如果我卸载所有 56 个软件包,然后尝试安装 57 个服务器/客户端(不共享),我会得到以下输出:

yum install Percona-Server-server-57 Percona-Server-client-57

Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                        |  17 kB     00:00
 * base: centos.mirror.fr.planethoster.net
 * epel: mirrors.ircam.fr
 * extras: centos.quelquesmots.fr
 * ius: mirrors.ircam.fr
 * remi-safe: rpms.remirepo.net
 * updates: centos.mirror.fr.planethoster.net
base                                                                                                                                                 | 3.7 kB     00:00
epel                                                                                                                                                 | 4.3 kB     00:00
extras                                                                                                                                               | 3.4 kB     00:00
ius                                                                                                                                                  | 2.2 kB     00:00
nginx                                                                                                                                                | 2.9 kB     00:00
percona-release-noarch                                                                                                                               | 2.5 kB     00:00
percona-release-x86_64                                                                                                                               | 2.5 kB     00:00
remi-safe                                                                                                                                            | 2.9 kB     00:00
updates                                                                                                                                              | 3.4 kB     00:00
varnish-4.1                                                                                                                                          |  951 B     00:00
Resolving Dependencies
--> Running transaction check
---> Package Percona-Server-client-57.x86_64 0:5.7.12-5.1.el6 will be installed
--> Processing Dependency: Percona-Server-shared-57 for package: Percona-Server-client-57-5.7.12-5.1.el6.x86_64
---> Package Percona-Server-server-57.x86_64 0:5.7.12-5.1.el6 will be installed
--> Running transaction check
---> Package Percona-Server-shared-57.x86_64 0:5.7.12-5.1.el6 will be installed
--> Processing Conflict: Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64 conflicts mysql-libs
--> Finished Dependency Resolution
Error: Percona-Server-shared-51 conflicts with Percona-Server-shared-57-5.7.12-5.1.el6.x86_64
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64 has installed conflicts mysql-libs: Percona-Server-shared-51-5.1.73-rel14.12.625.rhel6.x86_64
centos yum centos6 percona
  • 1 个回答
  • 2610 Views
Martin Hope
Pavel
Asked: 2016-05-19 12:04:01 +0800 CST

没有 innodb_recovery 4 PerconaDB 无法运行

  • 0

我的 Percona 5.7.11-4 无故崩溃。现在我只能使用 innodb force recovery = 4 运行。这是来自日志的回溯。你能帮我吗?谢谢你。

> Thread pointer: 0x0 Attempting backtrace. You can use the following
> information to find out where mysqld died. If you see no messages
> after this, something went terribly wrong... stack_bottom = 0
> thread_stack 0x40000
> /usr/sbin/mysqld(my_print_stacktrace+0x2c)[0xec0a9c]
> /usr/sbin/mysqld(handle_fatal_signal+0x461)[0x79b8c1]
> /lib64/libpthread.so.0[0x3b47c0f7e0]
> /lib64/libc.so.6(gsignal+0x35)[0x3b47832625]
> /lib64/libc.so.6(abort+0x175)[0x3b47833e05] /usr/sbin/mysqld[0x76a54c]
> /usr/sbin/mysqld(_Z32page_cur_search_with_match_bytesPK11buf_block_tPK12dict_index_tPK8dtuple_t15page_cur_mode_tPmS9_S9_S9_P10page_cur_t+0x969)[0xf7ff69]
> /usr/sbin/mysqld(_Z27btr_cur_search_to_nth_levelP12dict_index_tmPK8dtuple_t15page_cur_mode_tmP9btr_cur_tmPKcmP5mtr_t+0x97d)[0x10a6cfd]
> /usr/sbin/mysqld(_Z30btr_pcur_open_on_user_rec_funcP12dict_index_tPK8dtuple_t15page_cur_mode_tmP10btr_pcur_tPKcmP5mtr_t+0x96)[0x10b00c6]
> /usr/sbin/mysqld[0x111bbda]
> /usr/sbin/mysqld(_Z39dict_check_tablespaces_and_store_max_idb+0xa29)[0x111d499]
> /usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x45f3)[0x1034253]
> /usr/sbin/mysqld[0xef89b8]
> /usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7fa171]
> /usr/sbin/mysqld[0xcc5566]
> /usr/sbin/mysqld(_Z11plugin_initPiPPci+0x600)[0xccc430]
> /usr/sbin/mysqld[0x79439d]
> /usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x62a)[0x7957da]
> /lib64/libc.so.6(__libc_start_main+0xfd)[0x3b4781ed5d]
> /usr/sbin/mysqld[0x78b575] You may download the Percona Server
> operations manual by visiting
> http://www.percona.com/software/percona-server/. You may find
> information in the manual which will help you identify the cause of
> the crash. 2016-05-18T19:53:28.676862Z mysqld_safe mysqld from pid
> file /var/run/mysqld/mysqld.pid ended
percona
  • 1 个回答
  • 80 Views
Martin Hope
nvcnvn
Asked: 2015-04-25 02:49:18 +0800 CST

我可以在我的桌面上运行 Percona xtrabackup 吗?

  • 4

我已经在数据库服务器上成功运行 xtracbackup,但我真的想在另一台机器上运行备份(不是运行 MySQL 的机器)。
给定主机/端口选项,我尝试在桌面上运行 xtrabackup 工具,但出现以下错误:

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

150424 16:40:59  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=192.168.33.10;port=3306' as 'vagrant'  (using password: YES).
150424 16:40:59  innobackupex: Connected to MySQL server
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql server version 5.6.22-72.0

innobackupex: Created backup directory /home/WorkSpace/xtrabackup

150424 16:40:59  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp --tmpdir=/tmp --extra-lsndir='/tmp' --stream=tar
innobackupex: Waiting for ibbackup (pid=10463) to suspend
innobackupex: Suspend file '/tmp/xtrabackup_suspended_2'

xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: Can't change dir to '/var/lib/mysql' (Errcode: 2 - No such file or directory)
xtrabackup: cannot my_setwd /var/lib/mysql
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2672.

我可以在另一台机器上运行备份吗?如果是,我还需要安装什么?谢谢!

percona
  • 2 个回答
  • 1092 Views
Martin Hope
Jai
Asked: 2014-10-31 18:21:49 +0800 CST

自动关闭 MySQL 是 RHEL7

  • 2

当我执行systemctl start mysql它时,它会启动 MySQL,但我没有返回命令提示符,它就这样保持不变。数据库正常启动。几分钟后数据库自动关闭并且 systemctl 报告失败。

我也试过systemctl start mysql --no-block它立即返回命令提示符,但几分钟后数据库再次关闭。

数据库没有崩溃,这是一个干净的关闭,所以我怀疑 systemctl 在一段时间后发出关闭信号。

2014-10-30 20:03:37 7401 [Note] /usr/sbin/mysqld: Normal shutdown

已安装的 RPM

Percona-XtraDB-Cluster-galera-3-debuginfo-3.7-1.3254.rhel7.x86_64
Percona-XtraDB-Cluster-56-debuginfo-5.6.20-25.7.888.el7.x86_64
Percona-XtraDB-Cluster-garbd-3-3.7-1.3254.rhel7.x86_64
Percona-XtraDB-Cluster-test-56-5.6.20-25.7.888.el7.x86_64
percona-release-0.1-3.noarch
Percona-XtraDB-Cluster-galera-3-3.7-1.3254.rhel7.x86_64
Percona-XtraDB-Cluster-client-56-5.6.20-25.7.888.el7.x86_64
percona-xtrabackup-2.2.5-5027.el7.x86_64
Percona-XtraDB-Cluster-server-56-5.6.20-25.7.888.el7.x86_64
Percona-XtraDB-Cluster-full-56-5.6.20-25.7.888.el7.x86_64
Percona-XtraDB-Cluster-shared-56-5.6.20-25.7.888.el7.x86_64

操作系统

CentOS Linux release 7.0.1406 (Core)

如何确保 MySQl 不会关闭?

更新 1

[root@n5 ~]# systemctl start mysql  (Time 23:31)


Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details. (Time 23:46)
[root@n5 ~]# 
[root@n5 ~]# 
[root@n5 ~]# systemctl status mysql.service
mysql.service - Percona XtraDB Cluster
   Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
   Active: failed (Result: exit-code) since Thu 2014-10-30 23:46:47 MDT; 24min ago
  Process: 22821 ExecStopPost=/usr/bin/mysql-systemd stop-post (code=exited, status=0/SUCCESS)
  Process: 22778 ExecStop=/usr/bin/mysql-systemd stop (code=exited, status=2)
  Process: 18202 ExecStartPost=/usr/bin/mysql-systemd start-post $MAINPID (code=exited, status=1/FAILURE)
  Process: 18201 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
  Process: 18168 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=0/SUCCESS)
 Main PID: 18201 (code=exited, status=0/SUCCESS)

Oct 30 23:31:27 n5 rsyncd[19257]: sent 39 bytes  received 181 bytes  total size 48
Oct 30 23:46:29 n5 mysql-systemd[18202]: ERROR!
Oct 30 23:46:29 n5 systemd[1]: mysql.service: control process exited, code=exited status=1
Oct 30 23:46:29 n5 mysql-systemd[22778]: ERROR! mysql pid file /var/lib/mysql /var/lib/mysql/mysqld.pid empty or not readable
Oct 30 23:46:29 n5 mysql-systemd[22778]: WARNING: mysql may be already dead
Oct 30 23:46:29 n5 systemd[1]: mysql.service: control process exited, code=exited status=2
Oct 30 23:46:47 n5 mysqld_safe[18201]: 141030 23:46:47 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended
Oct 30 23:46:47 n5 mysql-systemd[22821]: SUCCESS!
Oct 30 23:46:47 n5 systemd[1]: Failed to start Percona XtraDB Cluster.
Oct 30 23:46:47 n5 systemd[1]: Unit mysql.service entered failed state.

来自 MySQL 日志

2014-10-30 23:31:49 19205 [Note] /usr/sbin/mysqld: ready for connections.
2014-10-30 23:46:29 19205 [Note] /usr/sbin/mysqld: Normal shutdown

来自消息日志

Oct 30 23:31:25 n5 mysql-systemd: /usr/bin/mysql-systemd: line 31: [: /var/lib: binary operator expected
Oct 30 23:31:25 n5 mysql-systemd: /usr/bin/mysql-systemd: line 39: [: /var/lib: binary operator expected
Oct 30 23:31:25 n5 mysql-systemd: /usr/bin/mysql-systemd: line 45: [: /var/log/mysqld.log: binary operator expected
Oct 30 23:31:26 n5 mysqld_safe: 141030 23:31:26 mysqld_safe Logging to '/var/log/mysqld.log'.
Oct 30 23:31:26 n5 mysqld_safe: 141030 23:31:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Oct 30 23:31:26 n5 mysqld_safe: 141030 23:31:26 mysqld_safe Skipping wsrep-recover for 6da46c5b-9acc-11e3-9d28-9f9960e4e0f4:2978271210 pair
Oct 30 23:31:26 n5 mysqld_safe: 141030 23:31:26 mysqld_safe Assigning 6da46c5b-9acc-11e3-9d28-9f9960e4e0f4:2978271210 to wsrep_start_position
Oct 30 23:46:29 n5 mysql-systemd: ERROR!
Oct 30 23:46:29 n5 systemd: mysql.service: control process exited, code=exited status=1
Oct 30 23:46:29 n5 mysql-systemd: ERROR! mysql pid file /var/lib/mysql /var/lib/mysql/mysqld.pid empty or not readable
Oct 30 23:46:29 n5 mysql-systemd: WARNING: mysql may be already dead
Oct 30 23:46:29 n5 systemd: mysql.service: control process exited, code=exited status=2
Oct 30 23:46:47 n5 mysqld_safe: 141030 23:46:47 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended
Oct 30 23:46:47 n5 mysql-systemd: SUCCESS!
Oct 30 23:46:47 n5 systemd: Unit mysql.service entered failed state.

更新 2 服务器内存信息 - 服务器有 256GB RAM 和 4GB 交换空间

top - 01:15:27 up 14:24,  2 users,  load average: 0.00, 0.01, 0.05
Tasks: 314 total,   1 running, 313 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.1 sy,  0.0 ni, 99.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:  26394486+total, 24065484 used, 23987937+free,      688 buffers
KiB Swap:  4194300 total,        0 used,  4194300 free. 21135896 cached Mem

我的.cnf

[MYSQLD]
user=mysql
datadir=/var/lib/mysql
log_error=/var/log/mysqld.log
log_warnings=2
#log_output=FILE
bind_address=192.168.1.15

### INNODB OPTIONS 
innodb_buffer_pool_size=180G
innodb_flush_log_at_trx_commit=2
innodb_file_per_table=1
innodb_data_file_path = ibdata1:100M:autoextend
## You may want to tune the below depending on number of cores and disk sub
innodb_read_io_threads=4
innodb_write_io_threads=4
innodb_io_capacity=400
innodb_doublewrite=1
innodb_log_file_size=1024M
innodb_log_buffer_size=96M
innodb_buffer_pool_instances=8
innodb_log_files_in_group=2
innodb_thread_concurrency=0
#innodb_file_format=barracuda
innodb_flush_method = O_DIRECT
innodb_autoinc_lock_mode=2
## avoid statistics update when doing e.g show tables
innodb_stats_on_metadata=0
default_storage_engine=innodb
innodb_buffer_pool_load_at_startup=1
innodb_buffer_pool_dump_at_shutdown=1

#Time
wait_timeout = 300
connect_timeout=60
interactive_timeout=300

# CHARACTER SET
collation_server = utf8_unicode_ci
init_connect='SET NAMES utf8'
character_set_server = utf8


# REPLICATION SPECIFIC
binlog_format=ROW

# OTHER THINGS, BUFFERS ETC
key_buffer_size = 24M
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 512M
#sort_buffer_size = 256K
#read_buffer_size = 256K
#read_rnd_buffer_size = 512K
#myisam_sort_buffer_size = 8M
skip_name_resolve
max_connect_errors = 100000000
sql_mode = ''
sysdate_is_now=1
max_connections=200
thread_cache_size=512
query_cache_type = 0
query_cache_size = 0
table_open_cache=1024
lower_case_table_names=0
# 5.6 backwards compatibility
explicit_defaults_for_timestamp=1
##
## WSREP options
##
# Full path to wsrep provider library or 'none'
wsrep_provider=/usr/lib64/libgalera_smm.so

wsrep_node_address=192.168.1.15
# Provider specific configuration options
wsrep_provider_options="gcache.size=32768M;gcs.fc_limit = 256; gcs.fc_factor = 0.99"

# Logical cluster name. Should be the same for all nodes.
wsrep_cluster_name="mh1"

# Group communication system handle
wsrep_cluster_address="gcomm://192.168.1.11,192.168.1.13,192.168.1.15"

# Human_readable node name (non-unique). Hostname by default.
#wsrep_node_name=

# Address for incoming client connections. Autodetect by default.
#wsrep_node_incoming_address=

# How many threads will process writesets from other nodes
wsrep_slave_threads=48

# DBUG options for wsrep provider
#wsrep_dbug_option

# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1

# Location of the directory with data files. Needed for non-mysqldump
# state snapshot transfers. Defaults to mysql_real_data_home.
#wsrep_data_home_dir=

# Maximum number of rows in write set
wsrep_max_ws_rows=131072

# Maximum size of write set
wsrep_max_ws_size=1073741824

# to enable debug level logging, set this to 1
wsrep_debug=1

# convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0

# how many times to retry deadlocked autocommits
wsrep_retry_autocommit=1

# change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1

# replicate myisam
wsrep_replicate_myisam=1
# retry autoinc insert, which failed for duplicate key error
wsrep_drupal_282555_workaround=0

# enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0

# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status  - new status of this node
# --uuid    - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index   - index of this node in the list
#wsrep_notify_cmd=

##
## WSREP State Transfer options
##

# State Snapshot Transfer method
wsrep_sst_method=rsync

# Address on THIS node to receive SST at. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
#wsrep_sst_receive_address=

# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
wsrep_sst_auth="xxxx:xxxx"

# Desired SST donor name.
#wsrep_sst_donor=

# Protocol version to use
# wsrep_protocol_version=

[MYSQL]
socket=/var/lib/mysql/mysql.sock
default_character_set=utf8

[client]
socket=/var/lib/mysql/mysql.sock
default_character_set=utf8

[mysqldump]
max_allowed_packet = 512M
socket=/var/lib/mysql/mysql.sock
default_character_set=utf8

[MYSQLD_SAFE]
pid_file=mysqld.pid
log_error=/var/log/mysqld.log
datadir=/var/lib/mysql
percona
  • 2 个回答
  • 4444 Views
Martin Hope
GoldieNZ
Asked: 2013-02-06 18:18:56 +0800 CST

在 2 台服务器上设置 Percona XtraDB 集群时遇到问题

  • 1

我正在尝试在两台机器上设置 Percona XtraDB 集群。但我在启动和运行第二台机器时遇到了麻烦。

我已将这篇文章用作参考,虽然它似乎几乎可以正常工作,但我可能缺少一些基本的东西。

机器如下:

Node 1: 192.168.2.10
Node 2: 192.168.2.11

两台机器都运行 Ubuntu 12.04 LTS。

节点 1 上的配置文件与本文类似。

当我使用上面的配置启动这个节点时,它工作正常。我可以通过命令行登录并运行

mysql> SHOW status LIKE 'wsrep%';

命令,因为它描述。一切看起来都很正常。

注意:节点 1 以前是一个标准的 mySQL 服务器,并且在 /var/lib/mysql 文件夹中已经有数据。这并没有影响它使用上述配置正常启动。

然后,我按照文章中关于添加新节点的步骤进行操作。这似乎是我遇到问题的地方。

我在节点 2 (192.168.2.11)上创建了 my.ini ,并使用了与本文类似的配置。

当我尝试使用service mysql start 启动服务时,它说它已启动,但我无法再通过命令行连接。

我尝试将节点 1 上的配置文件改回原来的配置文件,然后启动节点 2,但这也不起作用。

我通过简单地在命令行上使用 mysqld 命令启动 mysql 来捕获日志,这是修剪后的结果(只有有错误的东西):

130206 14:53:56 [ERROR] WSREP: Failed to read 'ready <addr>' from: wsrep_sst_xtrabackup --role 'joiner' --address 'ip_address' --auth 'root:password' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --parent '14762'
        Read: '(null)'
130206 14:53:56 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup --role 'joiner' --address 'ip_address' --auth 'root:password' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --parent '14762': 2 (No such file or directory)
130206 14:53:56 [ERROR] WSREP: Failed to prepare for 'xtrabackup' SST. Unrecoverable.
130206 14:53:56 [ERROR] Aborting

这是节点 1 在节点 2 连接时报告的内容(节点 1 使用第一个配置文件 - 再次修剪)

130206 14:59:44 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
         at gcomm/src/pc.cpp:connect():139
130206 14:59:44 [ERROR] WSREP: gcs/src/gcs_core.c:gcs_core_open():195: Failed to open backend connection: -110 (Connection timed out)
130206 14:59:44 [ERROR] WSREP: gcs/src/gcs.c:gcs_open():1290: Failed to open channel 'percona_cluster' at 'gcomm://192.168.2.11': -110 (Connection timed out)
130206 14:59:44 [ERROR] WSREP: gcs connect failed: Connection timed out
130206 14:59:44 [ERROR] WSREP: wsrep::connect() failed: 6
130206 14:59:44 [ERROR] Aborting

节点 2 报告类似。

如果有人可以帮助我解决我犯的愚蠢错误,将不胜感激。

(抱歉帖子的长度 - 我想提供尽可能多的信息)

percona
  • 1 个回答
  • 3555 Views
Martin Hope
Oneiroi
Asked: 2012-06-29 07:25:25 +0800 CST

Percona XtraDB Cluster 节点恢复

  • 2

我一直在审查 XtraDB 集群,并使用 4 个实例在 Openstack 上生成了一个 PoC 环境,这在我的弹性测试中失败了。

根据 pxc 文档:http ://www.percona.com/doc/percona-xtradb-cluster/howtos/virt_sandbox.html涵盖了 3 节点安装,我选择了第 4 个。

  1. 初始设置完成数据加载测试通过,所有节点使用 1.6GB 测试 sql 文件同步更新以加载数据库。
  2. 节点的故障和恢复开始,此测试需要停止节点上的 mysql 服务,创建并随后删除数据库以测试幸存的节点复制,并启动已关闭的节点以重新同步。
    1. 这适用于节点 4、3、2。
    2. 根据 pxc 文档,Node1 本质上是一个控制器,不会重新加入集群。

所以我的问题如下:

  1. 如果幸存节点已将数据写入它们,如何使控制器节点返回服务
  2. 以4个节点为参考,有没有办法去掉node1这个单点故障?(如果一个幸存的节点在控制器(node1)关闭/不同步的情况下重新启动,该节点也将失败)。
percona-xtradb-cluster percona xtradb
  • 3 个回答
  • 5205 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve