Trying to setup Mutliple mysqld instances on same machine?

I am trying to setup multi instance MySQL setup following official docs gettings issue.

MySQL :: MySQL 8.0 Reference Manual :: 2.5.9 Managing MySQL Server with systemd

my.cnf

[mysqld@replica01]
datadir=/var/lib/mysql-replica01
socket=/var/lib/mysql-replica01/mysql.sock
port=3307
log-error=/var/log/mysqld-replica01.log

[mysqld@replica02]
datadir=/var/lib/mysql-replica02
socket=/var/lib/mysql-replica02/mysql.sock
port=3308
log-error=/var/log/mysqld-replica02.log

================end of file===============
=========================================


mysqld-replica01.log

2020-10-01T10:58:48.704098Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-11) starting as process 95995
2020-10-01T10:58:48.712881Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-10-01T10:58:49.098915Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-10-01T10:58:49.204241Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/lib/mysql/mysqlx.sock' failed, can't create lock file /var/lib/mysql/mysqlx.sock.lock'
2020-10-01T10:58:49.204652Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2020-10-01T10:58:49.276263Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-10-01T10:58:49.298709Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-11'  socket: '/var/lib/mysql-replica01/mysql.sock'  port: 3310  Percona Server (GPL), Release 11, Revision 5b5a5d2.
~

================================================================
mysqld-replica02.log

2020-10-01T10:58:53.589526Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-11) starting as process 96080
2020-10-01T10:58:53.597853Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-10-01T10:58:53.882940Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-10-01T10:58:54.986742Z 0 [ERROR] [MY-011292] [Server] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible'
2020-10-01T10:58:54.986969Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2020-10-01T10:58:54.987286Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/lib/mysql/mysqlx.sock' failed, can't create lock file /var/lib/mysql/mysqlx.sock.lock'
2020-10-01T10:58:55.050673Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-10-01T10:58:55.073122Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20-11'  socket: '/var/lib/mysql-replica02/mysql.sock'  port: 3320  percona Server (GPL), Release 11, Revision 5b5a5d2.
=================================================

 service mysqld@replica01 status shows ---> active and running 
 service mysqld@replica01 status shows ----> active and running

How to repeat:
after configuration start service 

 service mysqld@replica01 start
 service mysqld@replica02 start

Error shows the conflict on mysqlx_port , not on regular port.

Try to use different mysqlx_port for replica01 and replica02

Similarly you need to configure mysqlx_socket as you changed location for socker

Thanks for suggestions @vadimtk Which port and which path will work?

service starts well … but not able to get MySQL temporary password to login to mysql and also mysql.tables are not generated .

logs

5T09:17:18.597757Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-11) Percona Server (GPL), Release 11, Revision 5b5a5d2.

2020-10-05T09:17:34.954171Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-11) starting as process 102029

2020-10-05T09:17:34.965764Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2020-10-05T09:17:35.267718Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2020-10-05T09:17:35.371795Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: ‘/var/lib/mysql-replica01/mysqlx.sock’ bind-address: ‘::’ port: 33061

2020-10-05T09:17:35.447142Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2020-10-05T09:17:35.470199Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.0.20-11’ socket: ‘/var/lib/mysql-replica01/mysql.sock’ port: 3310 Percona Server (GPL), Release 11, Revision 5b5a5d2.