Closed brandinchiu closed 4 years ago
Hi can you show me you php configuration did you select correct db name? or using default config ?
$binLogStream = new MySQLReplicationFactory(
(new ConfigBuilder())
->withUser('some user')
->withHost('some host')
->withPassword('some pass')
->withPort(3306)
->withSlaveId(100)
->withHeartbeatPeriod(2)
->build()
);
Yes, I'm just using the default one for now. I haven't had much chance to explore the rest of the configuration since I hit this wall basically right away.
Can you send me your my.cnf ? I will try do setup docker with percona 5.7
The file below contains the raw output from all of our configs for each of our nodes. Each has a cluster.cnf and a my.cnf file.
I appreciate the effort and am happy to help with anything else you need, just let me know!
hmm I created cluster
docker run -p 0.0.0.0:3390:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -e CLUSTER_NAME=cluster1 --net=pxc-network --name=mysql_cluster1 -d percona/percona-xtradb-cluster:5.7 \
mysqld \
--datadir=/var/lib/mysql \
--user=mysql \
--server-id=1 \
--log-bin=/var/lib/mysql/mysql-bin.log \
--binlog-format=row \
--max_allowed_packet=64M
docker run -p 0.0.0.0:3391:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -e CLUSTER_NAME=cluster1 -e CLUSTER_JOIN=mysql_cluster1 --net=pxc-network --name=mysql_cluster2 -d percona/percona-xtradb-cluster:5.7 \
mysqld \
--datadir=/var/lib/mysql \
--user=mysql \
--server-id=1 \
--log-bin=/var/lib/mysql/mysql-bin.log \
--binlog-format=row \
--max_allowed_packet=64M
docker run -p 0.0.0.0:3392:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -e CLUSTER_NAME=cluster1 -e CLUSTER_JOIN=mysql_cluster1 --net=pxc-network --name=mysql_cluster3 -d percona/percona-xtradb-cluster:5.7 \
mysqld \
--datadir=/var/lib/mysql \
--user=mysql \
--server-id=1 \
--log-bin=/var/lib/mysql/mysql-bin.log \
--binlog-format=row \
--max_allowed_packet=64M
I connected to "master" mysql_cluster1 and I receive events :/
So probably its something with configuration ? no idea will try to use you config to debug... l
@krowinski You're getting all of the events? Annoying. That means the next step is for me to rebuild a production replica from scratch and see if I can reproduce the issue.
Give me some time I will find out why. You are connecting to your master node ?
No, we weren't trying to connect to the master node. We didn't expect that would make a difference.
I can try that though and get back to you.
yep I think this is a problem nodes don't send events from what I tested only master sends. (If not someone correct me :trollface: )
Omg if that's just what the issue is that would be fantastic. I'll be sure to find time to test this soon and will get back to you to confirm.
Thanks!
I appreciate all the help you have given @krowinski. I've tested again using the master node and it is indeed working.
I'm sorry for wasting your time on something that seems like should have been a no-brainer.
I think there is also feature to be added like salve to salve replication right now there is only master -> slave support I need to check this if is possible.
or try do add (#71)
[mysqld]
log_slave_updates = on
I've tested this same solution on my local system using a regular install of MySQL. When I moved to test on my production system, the events are not propagating as expected. My concern is that the version of Percona Cluster we're using is at fault, and I'm curious if there are any ideas on how to address.
We have a 3 node cluster. I'm attempting to run the php-mysql-replication application on our 3rd node.
I've added the server config (of the node that is not working) below for reference:
When the application is run, I only receive heartbeat events, even though I am 100% other activity is happening across the cluster (I do occasionally get "format description" events, but I'm not terribly sure what these are for). I have yet to see any of the important events like updates, writes, or deletes.
EDIT: additional note; it looks like that each heartbeat event is identical while the application is running. The binlog position and file never changes. Not sure if this is helpful information or not, but thought I should include it.