版本信息:MariaDB-Galera-server-10.0.12-1.el6.x86_64my.cnf 如下:
[client]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
[mysqld_safe]
numa - interleave
[mysqld]
port                           = 3306
socket                         = /var/lib/mysql/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #thread poolthread_handling=pool-of-threads
thread_pool_max_threads=500       #设置thread pool线程的上限值(同时running的最大线程数为100)
thread_pool_size=50               #thread pool中线程数的下限值# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock
pid-file                       = /var/lib/mysql/mysql.pid
character_set_server = utf8lower_case_table_name = 1# MyISAM #
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolvesysdate-is-now                 = 1
innodb                         = FORCE
innodb-strict-mode             = 1# DATA STORAGE #
datadir                        = /var/lib/mysql/# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 512
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 4096
table-open-cache               = 1024
join_buffer_size = 128M
sort_buffer_size = 8M
read_rnd_buffer_size = 8M # INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 2048M# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file = /var/lib/mysql/slow.log
long_query_time = 1##
## WSREP options
### Full path to wsrep provider library or 'none'
wsrep_provider=/usr/lib64/galera/libgalera_smm.sowsrep_node_address=
# Provider specific configuration options
wsrep_provider_options="gcache.size=128M"# Logical cluster name. Should be the same for all nodes.
wsrep_cluster_name="my_wsrep_cluster"# Group communication system handle
wsrep_cluster_address="gcomm://"# 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=4# 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=0# 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
# ClusterControl currently DOES NOT support wsrep_sst_method=mysqldump
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=sst:sstpass123# Desired SST donor name.
#wsrep_sst_donor=# Protocol version to use
# wsrep_protocol_version=
[mysqldump]
quick
max-allowed-packet = 16M
启动错误信息:
140704 20:06:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/
140704 20:06:51 mysqld_safe WSREP: Running position recovery with --log_error='/var/lib/mysql//wsrep_recovery.tCcvPr' --pid-file='/var/lib/mysql//localhost.localdomain-recover.pid'
140704 20:06:51 [ERROR] WSREP: Parallel applying (wsrep_slave_threads > 1) requires innodb_autoinc_lock_mode = 2.
140704 20:06:56 mysqld_safe WSREP: Recovered position 00000000-0000-0000-0000-000000000000:-1
140704 20:06:56 [ERROR] WSREP: Parallel applying (wsrep_slave_threads > 1) requires innodb_autoinc_lock_mode = 2.
140704 20:06:56 [Note] WSREP: wsrep_start_position var submitted: '00000000-0000-0000-0000-000000000000:-1'
140704 20:06:56 [Note] WSREP: Read nil XID from storage engines, skipping position init
140704 20:06:56 [Note] WSREP: wsrep_load(): loading provider library '/usr/lib64/galera/libgalera_smm.so'
140704 20:06:56 [Note] WSREP: wsrep_load(): Galera 25.3.5(rXXXX) by Codership Oy <[email protected]> loaded successfully.
sh: /sbin/ifconfig: Permission denied
140704 20:06:56 [ERROR] WSREP: Failed to read output of: '/sbin/ifconfig | grep -E '^[[:space:]]+inet addr:' | grep -m1 -v 'inet addr:127' | sed 's/:/ /' | awk '{ print $3 }''
140704 20:06:56 [Warning] WSREP: Failed to guess base node address. Set it explicitly via wsrep_node_address.
140704 20:06:56 [Warning] WSREP: Guessing address for incoming client connections failed. Try setting wsrep_node_incoming_address explicitly.
140704 20:06:56 [Note] WSREP: CRC-32C: using hardware acceleration.
140704 20:06:56 [Warning] WSREP: Could not open saved state file for reading: /var/lib/mysql//grastate.dat
140704 20:06:56 [Note] WSREP: Found saved state: 00000000-0000-0000-0000-000000000000:-1
140704 20:06:56 [Note] WSREP: Passing config to GCS: base_port = 4567; cert.log_conflicts = no; debug = no; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 1; 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.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet
140704 20:06:56 [Note] WSREP: Service thread queue flushed.
140704 20:06:56 [Note] WSREP: Assign initial position for certification: -1, protocol version: -1
140704 20:06:56 [Note] WSREP: wsrep_sst_grab()
140704 20:06:56 [Note] WSREP: Start replication
140704 20:06:56 [Note] WSREP: Setting initial position to 00000000-0000-0000-0000-000000000000:-1
140704 20:06:56 [Note] WSREP: protonet asio version 0
140704 20:06:56 [Note] WSREP: Using CRC-32C (optimized) for message checksums.
140704 20:06:56 [Note] WSREP: backend: asio
140704 20:06:56 [Note] WSREP: GMCast version 0
140704 20:06:56 [Note] WSREP: (b1a28872-0373-11e4-9b4c-af036871e152, 'tcp://0.0.0.0:4567') listening at tcp://0.0.0.0:4567
140704 20:06:56 [Note] WSREP: (b1a28872-0373-11e4-9b4c-af036871e152, 'tcp://0.0.0.0:4567') multicast: , ttl: 1
140704 20:06:56 [Note] WSREP: EVS version 0
140704 20:06:56 [Note] WSREP: PC version 0
140704 20:06:56 [Note] WSREP: gcomm: connecting to group 'my_wsrep_cluster', peer ''
140704 20:06:56 [ERROR] WSREP: Permission denied
140704 20:06:56 [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():814
140704 20:06:56 [ERROR] WSREP: gcs/src/gcs_core.c:gcs_core_open():202: Failed to open backend connection: -13 (Permission denied)
140704 20:06:56 [ERROR] WSREP: gcs/src/gcs.c:gcs_open():1291: Failed to open channel 'my_wsrep_cluster' at 'gcomm://': -13 (Permission denied)
140704 20:06:56 [ERROR] WSREP: gcs connect failed: Permission denied
140704 20:06:56 [ERROR] WSREP: wsrep::connect() failed: 7
140704 20:06:56 [ERROR] Aborting
140704 20:06:56 [Note] WSREP: Service disconnected.
140704 20:06:57 [Note] WSREP: Some threads may fail to exit.
140704 20:06:57 [Note] /usr/sbin/mysqld: Shutdown complete
140704 20:06:57 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended求解决办法

解决方案 »

  1.   

    Parallel applying (wsrep_slave_threads > 1) requires innodb_autoinc_lock_mode = 2.在配置文件的mysqld下面加上innodb_autoinc_lock_mode = 2
      

  2.   

    感谢版主回答,但是加了innodb_autoinc_lock_mode = 2,依然错误如上
      

  3.   

    主要是,这块影响起不来,140704 20:06:56 [Note] WSREP: (b1a28872-0373-11e4-9b4c-af036871e152, 'tcp://0.0.0.0:4567') multicast: , ttl: 1
    140704 20:06:56 [Note] WSREP: EVS version 0
    140704 20:06:56 [Note] WSREP: PC version 0
    140704 20:06:56 [Note] WSREP: gcomm: connecting to group 'my_wsrep_cluster', peer ''
    140704 20:06:56 [ERROR] WSREP: Permission denied
    140704 20:06:56 [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)
      

  4.   

    感谢刀尖红叶,防火墙已经开了3306,4567端口,关闭SELinux就可以了(临时关闭setenforce 0,永久关闭:修改/etc/selinux/config 文件
    将SELINUX=enforcing改为SELINUX=disabled
    重启机器即可 )
      

  5.   

    这个问题也困扰了我半天,终于可以正常启动了!
    我的my.cnf和你的差不多,只是:
    pid-file                       =  /usr/local/mysql/【你的机器名】.pid    #eg:mypc.pid# INNODB #
    innodb_data_home_dir                = /usr/local/mysql
    innodb_log_group_home_dir           = /usr/local/mysql
    innodb_data_file_path               = ibdata1:2000M:autoextend:max:3G
    innodb-flush-method            = O_DIRECT
    innodb-log-files-in-group      = 2
    innodb-file-per-table          = 1
    innodb-buffer-pool-size        = 384M
    innodb_additional_mem_pool_size = 20M
    innodb-log-file-size           = 128M
    innodb_log_buffer_size = 8M
    innodb-flush-log-at-trx-commit = 1
    innodb_lock_wait_timeout = 50
    innodb_autoinc_lock_mode = 2# LOGGING #
    log-error                      = /usr/local/mysql/mysql-error.log
    log-queries-not-using-indexes  = 1
    slow-query-log                 = 1
    #slow_query_log=on 
    slow-query-log-file = /usr/local/mysql/slow_query_log.log 
    long_query_time = 2
    也不必关闭SELinux;你试试看!我的是解决了的