This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-17. For the latest, interactive version please visit https://mariadb.com/kb/.

Cannot Initialize a New Galera Cluster When using '/usr/bin/galera_new_cluster'

I have installed mariadb 10.3.10. Here below is the installation log.

============================================================
	# yum install -y MariaDB-server
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.3.10-1.el7.centos will be installed
--> Processing Dependency: galera for package: MariaDB-server-10.3.10-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-server-10.3.10-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-client for package: MariaDB-server-10.3.10-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.3.10-1.el7.centos will be installed
---> Package MariaDB-common.x86_64 0:10.3.10-1.el7.centos will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.3.10-1.el7.centos.x86_64
---> Package galera.x86_64 0:25.3.24-1.rhel7.el7.centos will be installed
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.3.10-1.el7.centos will be obsoleting
---> Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================
 Package               Arch          Version                           Repository      Size
============================================================================================
Installing:
 MariaDB-compat        x86_64        10.3.10-1.el7.centos              MariaDB        2.8 M
     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7
 MariaDB-server        x86_64        10.3.10-1.el7.centos              MariaDB        123 M
Installing for dependencies:
 MariaDB-client        x86_64        10.3.10-1.el7.centos              MariaDB         53 M
 MariaDB-common        x86_64        10.3.10-1.el7.centos              MariaDB        157 k
 galera                x86_64        25.3.24-1.rhel7.el7.centos        MariaDB        8.1 M

Transaction Summary
============================================================================================
Install  2 Packages (+3 Dependent packages)

Total download size: 188 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------------------
Total                                                       226 MB/s | 188 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : MariaDB-compat-10.3.10-1.el7.centos.x86_64                               1/6 
  Installing : MariaDB-common-10.3.10-1.el7.centos.x86_64                               2/6 
  Installing : MariaDB-client-10.3.10-1.el7.centos.x86_64                               3/6 
  Installing : galera-25.3.24-1.rhel7.el7.centos.x86_64                                 4/6 
  Installing : MariaDB-server-10.3.10-1.el7.centos.x86_64                               5/6 
chown: invalid user: ‘mysql’


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h ekycdb1 password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

  Erasing    : 1:mariadb-libs-5.5.52-1.el7.x86_64                                       6/6 
  Verifying  : MariaDB-client-10.3.10-1.el7.centos.x86_64                               1/6 
  Verifying  : galera-25.3.24-1.rhel7.el7.centos.x86_64                                 2/6 
  Verifying  : MariaDB-server-10.3.10-1.el7.centos.x86_64                               3/6 
  Verifying  : MariaDB-common-10.3.10-1.el7.centos.x86_64                               4/6 
  Verifying  : MariaDB-compat-10.3.10-1.el7.centos.x86_64                               5/6 
  Verifying  : 1:mariadb-libs-5.5.52-1.el7.x86_64                                       6/6 

Installed:
  MariaDB-compat.x86_64 0:10.3.10-1.el7.centos MariaDB-server.x86_64 0:10.3.10-1.el7.centos

Dependency Installed:
  MariaDB-client.x86_64 0:10.3.10-1.el7.centos MariaDB-common.x86_64 0:10.3.10-1.el7.centos
  galera.x86_64 0:25.3.24-1.rhel7.el7.centos  

Replaced:
  mariadb-libs.x86_64 1:5.5.52-1.el7                                                        

Complete!

============================================================

Here below is /etc/my.cnf content:

[client-server]

[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
user=mysql
binlog_format=ROW
bind-address=0.0.0.0
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size=122M
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_provider_options="gcache.size=300M; gcache.page_size=300M"
wsrep_cluster_name="eKYCluster"
wsrep_cluster_address="gcomm://10.0.5.14"
wsrep_node_name=ekycNode1
wsrep_node_address="10.0.5.14"
wsrep_sst_method=rsync

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

Then, I tried to initialize the cluster by running the script, /usr/bin/galera_new_cluster.  It could be done successfully.  Here below is the startup log:

===============================================================
Nov  6 09:10:31 ekycdb1 systemd: Starting MariaDB 10.3.10 database server...
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] /usr/sbin/mysqld (mysqld 10.3.10-MariaDB) starting as process 30032 ...
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Warning] You need to use --log-bin to make --binlog-format work.
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Using Linux native AIO
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Uses event mutexes
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Number of pools: 1
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Using SSE2 crc32 instructions
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Initializing buffer pool, total size = 122M, instances = 1, chunk size = 122M
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Completed initialization of buffer pool
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Waiting for purge to start
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: 10.3.10 started; log sequence number 1630941; transaction id 21
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] InnoDB: Buffer pool(s) load completed at 181106  9:10:31
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] Server socket created on IP: '0.0.0.0'.
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] Reading of all Master_info entries succeded
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] Added new Master_info '' to hash table
Nov  6 09:10:31 ekycdb1 mysqld: 2018-11-06  9:10:31 0 [Note] /usr/sbin/mysqld: ready for connections.
Nov  6 09:10:31 ekycdb1 mysqld: Version: '10.3.10-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
Nov  6 09:10:31 ekycdb1 systemd: Started MariaDB 10.3.10 database server.
====================================================

Here below is systemctl status:

# systemctl status mysql
● mariadb.service - MariaDB 10.3.10 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2018-11-06 09:10:31 HKT; 2min 47s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 30064 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 29975 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 29973 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 30032 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─30032 /usr/sbin/mysqld --wsrep-new-cluster

Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] InnoDB: 10.3.1...21
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] InnoDB: Loadin...ol
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] InnoDB: Buffer...31
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] Plugin 'FEEDBA...d.
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] Server socket ...'.
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] Reading of all...ed
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] Added new Mast...le
Nov 06 09:10:31 ekycdb1 mysqld[30032]: 2018-11-06  9:10:31 0 [Note] /usr/sbin/mysq...s.
Nov 06 09:10:31 ekycdb1 mysqld[30032]: Version: '10.3.10-MariaDB'  socket: '/var/l...er
Nov 06 09:10:31 ekycdb1 systemd[1]: Started MariaDB 10.3.10 database server.
Hint: Some lines were ellipsized, use -l to show in full.
======================================================================

Then I run 'mysql -u root' and checked cluster status:

# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.10-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW STATUS LIKE 'wsrep_%';
+--------------------------+----------------------+
| Variable_name            | Value                |
+--------------------------+----------------------+
| wsrep_cluster_conf_id    | 18446744073709551615 |
| wsrep_cluster_size       | 0                    |
| wsrep_cluster_state_uuid |                      |
| wsrep_cluster_status     | Disconnected         |
| wsrep_connected          | OFF                  |
| wsrep_local_bf_aborts    | 0                    |
| wsrep_local_index        | 18446744073709551615 |
| wsrep_provider_name      |                      |
| wsrep_provider_vendor    |                      |
| wsrep_provider_version   |                      |
| wsrep_ready              | OFF                  |
| wsrep_thread_count       | 0                    |
+--------------------------+----------------------+
12 rows in set (0.001 sec)

MariaDB [(none)]> 
===========================================================

The wsrep_cluster_size is 0, not 1. Why?

Answer Answered by Geoff Montee in this comment.

I don't see wrep_on=ON in your my.cnf, so Galera Cluster is not enabled. See Configuring MariaDB Galera Cluster: Mandatory Options.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.