Unable to add master...
All,
I am trying to import two dummy Mysql servers as master and a slave. I have cluster control installed on a third server. When I go to import Existing Server/Cluster (the MySQL replication tab) and get to the second page "Define MySQL Servers" I turn off information_schema Queries, Node AutoRecovery, and Cluster AutoRecovery and go to add the master mysql server and slave server at the bottom under the "Add Node". With this output taken from the Cluster Control Jobs section:
[16:55:25]:
Generated & set RPC authentication token.
[16:55:25]:
Cluster 17 is running.
[16:55:24]:
Waiting until the initial cluster starts up.
[16:55:24]:
Registering the cluster on the web UI.
[16:55:15]:
xxx.xxx.xxx.33: Granting SQL access to 'cmon' monitoring user trough SSH.
[16:55:15]:
SQL_host xxx.xxx.xxx.33:3306
[16:55:15]:
SQL_host xxx.xxx.xxx.22:3306 (READ ONLY)
[16:55:15]:
Controller xxx.xxx.xxx.251.
[16:55:15]:
Granting privileges for the Cmon Controller.
[16:55:15]:
Cluster 17 is running.
[16:55:11]:
Waiting until the initial cluster starts up.
[16:55:11]:
Sending SIGHUP to the controller process.
[16:55:11]:
Configuration written to 'cmon_17.cnf'.
[16:55:11]:
Filename is 'cmon_17.cnf'.
[16:55:11]:
Directory is '/etc/cmon.d'.
[16:55:11]:
Saving cluster configuration.
[16:55:11]:
MySQL root password stored in monitored_mysql_root_password= entry of /etc/cmon.d/cmon_17.cnf.
[16:55:11]:
Registering host in the host manager.
[16:55:11]:
Generating and writing the new configuration.
[16:55:11]:
xxx.xxx.xxx.22:3306: Detected operating system is 'redhat'.
[16:55:11]:
xxx.xxx.xxx.22: Checking OS information.
[16:55:11]:
xxx.xxx.xxx.33:3306: The datadir is /var/lib/mysql/.
[16:55:11]:
Connected succesfully: 'cmon@xxx.xxx.xxx.251' -> 'xxx.xxx.xxx.33:3306'.
[16:55:11]:
xxx.xxx.xxx.22:3306: The datadir is /var/lib/mysql/.
[16:55:11]:
Connected succesfully: 'cmon@xxx.xxx.xxx.251' -> 'xxx.xxx.xxx.22:3306'.
[16:55:11]:
Testing connection & determining data directories.
[16:55:02]:
xxx.xxx.xxx.33: Granting user cmon.
[16:55:02]:
xxx.xxx.xxx.33:3306: Node is writable.
[16:55:00]:
xxx.xxx.xxx.22:3306: Node is read-only.
[16:54:57]:
Granting controller (xxx.xxx.xxx.251,replicator.somedomain.com).
[16:54:57]:
Controller 'xxx.xxx.xxx.251' resolves to 'replicator.somedomain.com'
[16:54:57]:
Checking if resolve of 'xxx.xxx.xxx.251' is needed, and attempting to resolve to a hostname
[16:54:54]:
Detected that skip_name_resolve is not used on the target server(s).
[16:54:54]:
xxx.xxx.xxx.33:3306: skip_name_resolve=mysql: Using a password on the command line interface can be insecure.
skip_name_resolve OFF
[16:54:51]:
xxx.xxx.xxx.22:3306: skip_name_resolve=mysql: Using a password on the command line interface can be insecure.
skip_name_resolve OFF
[16:54:49]:
xxx.xxx.xxx.33:3306: SELinux is enabled on host set permissive mode, or make sure you have configured it.
[16:54:45]:
xxx.xxx.xxx.22:3306: SELinux is enabled on host set permissive mode, or make sure you have configured it.
[16:54:44]:
Check SELinux statuses.
[16:54:44]:
Using sudo password for further communication.
[16:54:44]:
xxx.xxx.xxx.33: Access with ssh/sudo granted.
[16:54:44]:
xxx.xxx.xxx.33: Checking ssh/sudo with credentials ssh_cred_job_6656.
[16:54:44]:
Checking that nodes are not in another cluster.
[16:54:44]:
Found in total 2 nodes.
[16:54:44]:
Found node: 'xxx.xxx.xxx.33'
[16:54:44]:
Found node: 'xxx.xxx.xxx.22'
[16:54:41]:
xxx.xxx.xxx.22:3306: Sanity check...
[16:54:37]:
xxx.xxx.xxx.22:3306: Verifying the MySQL user/password.
[16:54:35]:
Using sudo password for further communication.
[16:54:35]:
xxx.xxx.xxx.22: Access with ssh/sudo granted.
[16:54:34]:
xxx.xxx.xxx.22: Checking ssh/sudo with credentials ssh_cred_job_6656.
[16:54:34]:
Adding existing MySQL cluster.
[16:54:34]:
Generating configuration for cluster Cluster0.
[16:54:33]:
Adding cluster with type 'replication', vendor 'percona'.
So with the two nodes added and the Cluster control added I go to look at the cluster but the dummy server that is intended to be the master shows a red status with the comment "The server is not a replication slave" What am I missing here?
I'm running fully updated Centos 7 and mysql Ver 14.14 Distrib 5.7.32.
Thank you in advance! And apologize if I've left out any relevant information - I am new to databases, but not new to being a system's administrator.
Dave T
-
One thing I forgot to mention is the dummy master server that will not add properly is in super user read only mode. IF not set in that fashion cluster control states that:
-
[19:30:57]:Found more than one writable node. This is not a recommended setup and may lead to data inconsistencies. Aborting.
-
[19:30:57]:xxx.xxx.xxx.33:3306: Node is writable.
-
[19:30:54]:xxx.xxx.xxx.22:3306: Node is writable.
-
-
Hi David Thoms,
The message you read is correct. Adding or importing a cluster requires a master where it is fully writable while the slave nodes are set to be read only, although this can be overridden but this is not the focus of the problem you are asking though. You can check if you are importing the correct node if that is supposed to be a master by checking,
SELECT @@read_only, @@super_read_only; <-- both has to be 0 values to be a master
SHOW SLAVE HOSTS; <- must have slaves or hosts connected to it
SHOW SLAVE STATUS \G <- must be empty for a master unless you are doing a multi-master setup but again it might not be the case of your problem
-
Please forgive me as I am new to this - so these questions might seem obvious to you.
Why would the master node need to be read/writeable and the slave read only? Why would you want to write to the master (assume the master is a production database) and have the slave as read only?
Thank you for responding so fast,
Dave Thoms
-
Hi Dave,
I'm not sure if I understood your question correctly.
The idea to have a master-slave topology is that the master will be used to write (your application will use it) and the slave (or more than one) can be used to have high availability, reporting, backups, etc, so you can reduce the load in the master node using the slave for this kind of tasks, and to avoid any data inconsistency, the best is to have this slave node in a read-only mode.
You can find more information here: https://severalnines.com/resources/database-management-tutorials/mysql-replication-high-availability-tutorial
Please, let me know if this answers your question.
Regards,
Sebastian.
-
Ok that makes sense now that you would want the database on the master to be writeable from the perspective of using it to do what databases do - record data and retrieve it. I was thinking more from the perspective of the severalnines cluster software being able to write to it. Thank you!
Here's my next issue - if I "Import Existing Server/Database" it complains if I set both hosts (assume one slave and one master, I don't care which is which as these are dummy servers) to writable and fails. If I set one readonly and one readwrite it invariable sets the readonly server to 'red' as shown in the picture inserted:
Please sign in to leave a comment.
Comments
5 comments