# Not able to run three-node-cluster-on-a-single-box

**URL:** <https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258>\
**Category:** MySQL & MariaDB\
**Created:** [July 1, 2023, 12:10pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258 "2023-07-01T12:10:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 1, 2023, 12:10pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/1 "2023-07-01T12:10:51Z")

</div>

Hi,  
I have same issue. Trying to follow the steps here:  
[How to set up a three-node cluster on a single box](https://docs.percona.com/percona-xtradb-cluster/8.0/howtos/singlebox.html)

link: [https://docs.percona.com/percona-xtradb-cluster/8.0/howtos/singlebox.html](https://docs.percona.com/percona-xtradb-cluster/8.0/howtos/singlebox.html)

Downloaded the latest tarball and extracted in /usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64

Here are the configs of the 3 my.cnf:

# cat /etc/my.4000.cnf

[mysqld]  
port = 4000  
socket=/tmp/mysql.4000.sock  
datadir=/app1/bench/d1  
basedir=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64  
user=mysql  
log\_error=error.log  
binlog\_format=ROW  
wsrep\_cluster\_address=‘gcomm://10.87.229.32:5030,10.87.229.32:6030’  
wsrep\_provider=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64/lib/libgalera\_smm.so  
wsrep\_sst\_receive\_address=10.87.229.32:4020  
wsrep\_node\_incoming\_address=10.87.229.32  
wsrep\_cluster\_name=trimethylxanthine  
wsrep\_provider\_options = “gmcast.listen\_addr=tcp://10.87.229.32:4030;”  
wsrep\_sst\_method=xtrabackup-v2  
wsrep\_node\_name=node4000  
innodb\_autoinc\_lock\_mode=2

# cat /etc/my.5000.cnf

[mysqld]  
port = 5000  
socket=/tmp/mysql.5000.sock  
datadir=/app1/bench/d2  
basedir=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64  
user=mysql  
log\_error=error.log  
binlog\_format=ROW  
wsrep\_cluster\_address=‘gcomm://10.87.229.32:4030,10.87.229.32:6030’  
wsrep\_provider=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64/lib/libgalera\_smm.so  
wsrep\_sst\_receive\_address=10.87.229.32:5020  
wsrep\_node\_incoming\_address=10.87.229.32

wsrep\_cluster\_name=trimethylxanthine  
wsrep\_provider\_options = “gmcast.listen\_addr=tcp://10.87.229.32:5030;”  
wsrep\_sst\_method=xtrabackup-v2  
wsrep\_node\_name=node5000  
innodb\_autoinc\_lock\_mode=2

# cat /etc/my.6000.cnf

[mysqld]  
port = 6000  
socket=/tmp/mysql.6000.sock  
datadir=/app1/bench/d3  
basedir=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64  
user=mysql  
log\_error=error.log  
binlog\_format=ROW  
wsrep\_cluster\_address=‘gcomm://10.87.229.32:4030,10.87.229.32:5030’  
wsrep\_provider=/usr/local/Percona-XtraDB-Cluster\_8.0.27-18.1.x86\_64/lib/libgalera\_smm.so  
wsrep\_sst\_receive\_address=10.87.229.32:6020  
wsrep\_node\_incoming\_address=10.87.229.32  
wsrep\_cluster\_name=trimethylxanthine  
wsrep\_provider\_options = “gmcast.listen\_addr=tcp://10.87.229.32:6030;”  
wsrep\_sst\_method=xtrabackup-v2  
wsrep\_node\_name=node6000  
innodb\_autoinc\_lock\_mode=2  
type or paste code here

When attempting to start the first node it gave me this error message:

`Preformatted text`# bin/mysqld\_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster  
2023-07-01T12:05:14.670117Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-01T12:05:14.671985Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-01T12:05:14.692600Z mysqld\_safe Starting mysqld daemon with databases from /app1/bench/d1  
2023-07-01T12:05:14.696485Z mysqld\_safe Skipping wsrep-recover for empty datadir: /app1/bench/d1  
2023-07-01T12:05:14.697387Z mysqld\_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep\_start\_position  
2023-07-01T12:05:14.909989Z mysqld\_safe mysqld from pid file /app1/bench/d1/rn000112059.pid ended with return value of 1`Preformatted text`

Also no error logs has been generated so I do not know where to check.

I am using almalinux8 ip 10.87.229.32

Please share some thoughts please.  
Thanks

---

<div class="post-metadata">

**Author:** ![Evgeniy\_Patlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeniy_patlan/32/41_2.png) [@Evgeniy\_Patlan](https://forums.percona.com/u/Evgeniy_Patlan)\
**Post date:** [July 3, 2023, 10:50am UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/2 "2023-07-03T10:50:34Z")

</div>

Hey @ir0nwarez  
I tried with the 8.0.32 version and everything worked well for me

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 4, 2023, 6:39pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/3 "2023-07-04T18:39:16Z")

</div>

> [@ir0nwarez](#):
>
> Skipping wsrep-recover for empty datadir:

Did you initialize MySQL before starting your cluster? You have to have at least the system tables in place before you can start.

---

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 6, 2023, 3:10am UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/4 "2023-07-06T03:10:39Z")

</div>

Hi,

did you follow same steps using that version?

---

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 6, 2023, 3:12am UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/5 "2023-07-06T03:12:15Z")

</div>

Hi matt,

apologies, but I just did the exact steps on the guide mentioned.

Can you share your steps please?

Thanks

---

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 6, 2023, 8:43am UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/6 "2023-07-06T08:43:25Z")

</div>

Hi Matt,

I am trying to follow the step by step guide provided via this link: [How to set up a three-node cluster on a single box - Percona XtraDB Cluster](https://docs.percona.com/percona-xtradb-cluster/8.0/howtos/singlebox.html)

When I run this command:  
bin/mysqld\_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster

It gives me error with these:

bin/mysqld\_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster  
2023-07-06T08:39:25.013359Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-06T08:39:25.015602Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-06T08:39:25.037864Z mysqld\_safe Starting mysqld daemon with databases from /app1/bench/d1  
2023-07-06T08:39:25.042663Z mysqld\_safe Skipping wsrep-recover for empty datadir: /app1/bench/d1  
2023-07-06T08:39:25.043760Z mysqld\_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep\_start\_position  
2023-07-06T08:39:25.243543Z mysqld\_safe mysqld from pid file /app1/bench/d1/rn000112059.pid ended with return value of 1

No where to go from here.  
Please suggest.

Thanks!

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 6, 2023, 1:52pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/7 "2023-07-06T13:52:24Z")

</div>

Hello @ir0nwarez,  
That guide is a tad incomplete. It looks like there is an assumption that you already have a working MySQL datadir. You need to create one. Try adding `--initialize` to the mysqld command.

---

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 6, 2023, 3:30pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/8 "2023-07-06T15:30:04Z")

</div>

Hi Mattheweb,

tried your suggestion still the same error:

# bin/mysqld --initialize

root@rn000112059:/usr/local/Percona-XtraDB-Cluster-8.0.x86\_64

# bin/mysqld\_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster

2023-07-06T15:28:07.978902Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-06T15:28:07.981359Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-06T15:28:08.005019Z mysqld\_safe Starting mysqld daemon with databases from /app1/bench/d1  
2023-07-06T15:28:08.009452Z mysqld\_safe Skipping wsrep-recover for empty datadir: /app1/bench/d1  
2023-07-06T15:28:08.010420Z mysqld\_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep\_start\_position  
2023-07-06T15:28:08.234775Z mysqld\_safe mysqld from pid file /app1/bench/d1/rn000112059.pid ended with return value of 1  
root@rn000112059:/usr/local/Percona-XtraDB-Cluster-8.0.x86\_64

If you can point me to the correct steps that would be great. I just follow the guide and now I am stuck ☹

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 6, 2023, 3:59pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/9 "2023-07-06T15:59:45Z")

</div>

> [@ir0nwarez](#):
>
> Skipping wsrep-recover for empty datadir: /app1/bench/d1

You didn’t provide the other parameters along with `--initialize`. You still have an empty data dir.

`bin/mysqld_safe --initialize --defaults-file=/etc/my.4000.cnf`  
`bin/mysqld_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster`

---

<div class="post-metadata">

**Author:** ![ir0nwarez](https://avatars.discourse-cdn.com/v4/letter/i/da6949/32.png) [@ir0nwarez](https://forums.percona.com/u/ir0nwarez)\
**Post date:** [July 7, 2023, 3:03am UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/10 "2023-07-07T03:03:36Z")

</div>

Thanks Matthewb for the help,

But still facing issues:

root@rn000112059:/usr/local/Percona-XtraDB-Cluster-8.0.x86\_64

# bin/mysqld\_safe --initialize --defaults-file=/etc/my.4000.cnf bin/mysqld\_safe: line 745: /mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data/mysqld\_safe.pid: No such file or directory

2023-07-07T03:01:41.669107Z mysqld\_safe Logging to ‘/mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data/rn000112059.err’.  
Logging to ‘/mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data/rn000112059.err’.  
2023-07-07T03:01:41.688609Z mysqld\_safe Starting mysqld daemon with databases from /mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data  
2023-07-07T03:01:41.693515Z mysqld\_safe Skipping wsrep-recover for empty datadir: /mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data  
2023-07-07T03:01:41.694868Z mysqld\_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep\_start\_position  
2023-07-07T03:01:41.710207Z mysqld\_safe mysqld from pid file /mnt/jenkins/workspace/pxc80-autobuild-RELEASE/test/Percona-XtraDB-Cluster-8.0.32-24/20230518-183049/usr/local/Percona-XtraDB-Cluster\_8.0.32-24.2\_Linux.x86\_64.glibc2.17/data/rn000112059.pid ended with return value of 1  
root@rn000112059:/usr/local/Percona-XtraDB-Cluster-8.0.x86\_64

# bin/mysqld\_safe --defaults-file=/etc/my.4000.cnf --wsrep-new-cluster 2023-07-07T03:02:05.829292Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.

2023-07-07T03:02:05.831319Z mysqld\_safe Logging to ‘/app1/bench/d1/error.log’.  
2023-07-07T03:02:05.852925Z mysqld\_safe Starting mysqld daemon with databases from /app1/bench/d1  
2023-07-07T03:02:05.857341Z mysqld\_safe Skipping wsrep-recover for empty datadir: /app1/bench/d1  
2023-07-07T03:02:05.858492Z mysqld\_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep\_start\_position  
2023-07-07T03:02:06.072081Z mysqld\_safe mysqld from pid file /app1/bench/d1/rn000112059.pid ended with return value of 1

I have no idea where /mnt/jenkins came from.

Please advise.

Thank you

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 7, 2023, 4:28pm UTC](https://forums.percona.com/t/not-able-to-run-three-node-cluster-on-a-single-box/23258/11 "2023-07-07T16:28:17Z")

</div>

This worked for me:

```auto
mkdir /tmp/mysql4000

$ cat my.4000.cnf
[mysqld]
port = 4000
socket=/tmp/mysql.4000.sock
datadir=/tmp/mysql4000
basedir=/home/matthew/dbdeployer/opt/mysql/pxc8.0.27
user=matthew
log_error=error.log
binlog_format=ROW
wsrep_cluster_address="gcomm://10.10.10.203:5030,10.10.10.203:6030"
wsrep_provider=/home/matthew/dbdeployer/opt/mysql/pxc8.0.27/lib/libgalera_smm.so
wsrep_sst_receive_address=10.10.10.203:4020
wsrep_node_incoming_address=10.10.10.203
wsrep_cluster_name=trimethylxanthine
wsrep_provider_options="gmcast.listen_addr=tcp://10.10.10.203:4030"
wsrep_sst_method=xtrabackup-v2
wsrep_node_name=node4000
innodb_autoinc_lock_mode=2

$ bin/mysqld --defaults-file=my.4000.cnf --initialize
$ bin/mysqld --defaults-file=my.4000.cnf --wsrep-new-cluster

2023-07-07T16:24:38.993163Z 2 [Note] [MY-000000] [Galera] Bootstrapping a new cluster, setting initial position to 00000000-0000-0000-0000-000000000000:-1
2023-07-07T16:24:38.997940Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2023-07-07T16:24:38.998029Z 0 [System] [MY-010931] [Server] /home/matthew/dbdeployer/opt/mysql/pxc8.0.27/bin/mysqld: ready for connections. Version: '8.0.27-18.1' socket: '/tmp/mysql.4000.sock' port: 4000 Percona XtraDB Cluster binary (GPL) 8.0.27, Revision ac35177, WSREP version 26.4.3.

```

Stop using mysqld\_safe, that’s an old outdated script (also the source of the “jenkins” stuff because you have something misconfigured). Just use mysqld like I did.
