ClusterLabs / ClusterLabs/resource-agents

How can I create a galera resource with two nodes?

Open
#1,901 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
519
Forks
608
Avg merge
6d 1h
Merged PRs (30d)
7

Description

/etc/mysql/mariadb.conf.d/50-server.cnf galera configuration on node 1 (nyan1)
```
[galera]
wsrep_on=ON
wsrep_cluster_address=gcomm://192.168.1.21,192.168.1.22
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
wsrep_cluster_name="galera_cluster"
wsrep_node_address="192.168.1.21"
```

/etc/mysql/mariadb.conf.d/50-server.cnf galera configuration on node 2 (nyan2)
```
[galera]
wsrep_on=ON
wsrep_cluster_address=gcomm://192.168.1.21,192.168.1.22
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
wsrep_cluster_name="galera_cluster"
wsrep_node_address="192.168.1.22"
```

create resource command
```
root@nyan1:~# pcs resource create GaleraCluster ocf:heartbeat:galera wsrep_cluster_address="gcomm://192.168.1.21,192.168.1.22" \
cluster_host_map="nyan1:192.168.1.21;nyan2:192.168.1.22" \
op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="20s" \
op monitor role="Master" OCF_CHECK_LEVEL="0" timeout="30s" interval="10s" \
op monitor role="Slave" OCF_CHECK_LEVEL="0" timeout="30s" interval="30s" \
promotable promoted-max=2
```

```
root@nyan1:~# pcs status
Cluster name: mycluster
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-11-09 10:07:44 -06:00)
Cluster Summary:
* Stack: corosync
* Current DC: nyan2 (version 2.1.5-a3f44794f94) - partition with quorum
* Last updated: Thu Nov 9 10:07:45 2023
* Last change: Thu Nov 9 10:07:10 2023 by root via cibadmin on nyan1
* 2 nodes configured
* 2 resource instances configured (9 DISABLED)

Node List:
* Online: [ nyan1 nyan2 ]

Full List of Resources:
* Clone Set: GaleraCluster-clone [GaleraCluster] (promotable):
* GaleraCluster (ocf:heartbeat:galera): FAILED Promoted nyan2
* Promoted: [ nyan1 ]

Failed Resource Actions:
* GaleraCluster promote on nyan2 returned 'error' (MySQL server failed to start (pid=38624) (rc=1), please check your installation) at Thu Nov 9 10:07:24 2023 after 6.450s

Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file or test is named. Start by reviewing the MariaDB and Pacemaker logs for the failed GaleraCluster promotion on nyan2, then compare the /etc/mysql/mariadb.conf.d/50-server.cnf settings and the pcs resource command. Done would require a confirmed two-node configuration or a documented fix, but the issue does not define which is expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, shell
Domain
databases, devops, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.