我正在尝试设置 MariaDB Galera 集群如下这教程完全一样,我被困在步骤 7 – 初始化第一个集群节点,我正在这样做,sudo /etc/init.d/mysql start --wsrep-new-cluster
并且在一段时间后Starting MySQL.....
,它结束于Starting MySQL..... ERROR!
谁能告诉我发生了什么事吗?这是我的 MySQL 日志:
150408 11:46:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150408 11:46:56 mysqld_safe WSREP: Running position recovery with --log_error='/var/lib/mysql/wsrep_recovery.X0vkQP' --pid-file='/var/lib/mysql/db1-recover.pid'
150408 11:46:58 mysqld_safe WSREP: Recovered position 00000000-0000-0000-0000-000000000000:-1
150408 11:46:58 [Note] WSREP: wsrep_start_position var submitted: '00000000-0000-0000-0000-000000000000:-1'
150408 11:46:58 [Note] WSREP: Read nil XID from storage engines, skipping position init
150408 11:46:58 [Note] WSREP: wsrep_load(): loading provider library '/usr/lib64/galera/libgalera_smm.so'
150408 11:46:58 [Note] WSREP: wsrep_load(): Galera 25.3.9(r3385) by Codership Oy <[email protected]> loaded successfully.
150408 11:46:58 [Note] WSREP: CRC-32C: using "slicing-by-8" algorithm.
150408 11:46:58 [Note] WSREP: Found saved state: 00000000-0000-0000-0000-000000000000:-1
150408 11:46:58 [Note] WSREP: Passing config to GCS: base_host = 172.28.109.10; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 2; evs.view_forget_timeout = PT24H; gcache.dir = /var/lib/mysql/; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page_size = 128M; gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.npvo = false; pc.recove
150408 11:46:58 [Note] WSREP: Service thread queue flushed.
150408 11:46:58 [Note] WSREP: Assign initial position for certification: -1, protocol version: -1
150408 11:46:58 [Note] WSREP: wsrep_sst_grab()
150408 11:46:58 [Note] WSREP: Start replication
150408 11:46:58 [Note] WSREP: 'wsrep-new-cluster' option used, bootstrapping the cluster
150408 11:46:58 [Note] WSREP: Setting initial position to 00000000-0000-0000-0000-000000000000:-1
150408 11:46:58 [Note] WSREP: protonet asio version 0
150408 11:46:58 [Note] WSREP: Using CRC-32C for message checksums.
150408 11:46:58 [Note] WSREP: backend: asio
150408 11:46:58 [Warning] WSREP: access file(gvwstate.dat) failed(No such file or directory)
150408 11:46:58 [Note] WSREP: restore pc from disk failed
150408 11:46:58 [Note] WSREP: GMCast version 0
150408 11:46:58 [Note] WSREP: (7dc963a0, 'tcp://0.0.0.0:4567') listening at tcp://0.0.0.0:4567
150408 11:46:58 [Note] WSREP: (7dc963a0, 'tcp://0.0.0.0:4567') multicast: , ttl: 1
150408 11:46:58 [Note] WSREP: EVS version 0
150408 11:46:58 [Note] WSREP: gcomm: bootstrapping new group 'galera_cluster'
150408 11:46:58 [Note] WSREP: start_prim is enabled, turn off pc_recovery
150408 11:46:58 [ERROR] WSREP: Permission denied
150408 11:46:58 [ERROR] WSREP: failed to open gcomm backend connection: 13: error while trying to listen 'tcp://0.0.0.0:4567?socket.non_blocking=1', asio error 'Permission denied': 13 (Permission denied)
at gcomm/src/asio_tcp.cpp:listen():777
150408 11:46:58 [ERROR] WSREP: gcs/src/gcs_core.cpp:long int gcs_core_open(gcs_core_t*, const char*, const char*, bool)():206: Failed to open backend connection: -13 (Permission denied)
150408 11:46:58 [ERROR] WSREP: gcs/src/gcs.cpp:long int gcs_open(gcs_conn_t*, const char*, const char*, bool)():1379: Failed to open channel 'galera_cluster' at 'gcomm://172.28.109.10,172.28.109.11,172.28.109.12': -13 (Permission denied)
150408 11:46:58 [ERROR] WSREP: gcs connect failed: Permission denied
150408 11:46:58 [ERROR] WSREP: wsrep::connect() failed: 7
150408 11:46:58 [ERROR] Aborting
150408 11:46:58 [Note] WSREP: Service disconnected.
150408 11:46:59 [Note] WSREP: Some threads may fail to exit.
150408 11:46:59 [Note] /usr/sbin/mysqld: Shutdown complete
150408 11:46:59 mysqld_safe mysqld from pid file /var/lib/mysql/db1.pid ended
答案1
解决了。问题出在 SELinux 上,我明确地将其置于宽容模式,但我从未重新启动以正确应用更改。因此,我检查了 SELinux 当前状态sestatus
,发现它配置为 Permissive 模式,但运行在 Enforcing 模式下。