RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1337146 - mysql: replication_port parameter not used
Summary: mysql: replication_port parameter not used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 1337124
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-18 11:58 UTC by Oyvind Albrigtsen
Modified: 2017-03-21 09:27 UTC (History)
5 users (show)

Fixed In Version: resource-agents-3.9.5-36.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1337124
Environment:
Last Closed: 2017-03-21 09:27:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0602 0 normal SHIPPED_LIVE resource-agents bug fix update 2017-03-21 12:26:23 UTC

Description Oyvind Albrigtsen 2016-05-18 11:58:06 UTC
+++ This bug was initially created as a clone of Bug #1337124 +++

Description of problem:
Setting replication_port doesnt have any effect

Version-Release number of selected component (if applicable):
3.9.5-54.el7_2.10

How reproducible:
Everytime

Steps to Reproduce:
1. Change port to non-standard port in my.cnf
2. Set replication_port to the non-standard port
2. Make the resource a master/slave
3. Check if resource fails

Actual results:
Slave fails trying to connect to default port instead of replication_port

Expected results:
Slave connects to correct port

Additional info:
Fix available at: https://github.com/ClusterLabs/resource-agents/pull/788

Comment 3 Oyvind Albrigtsen 2016-09-08 14:23:13 UTC
Tested and working as expected.

Comment 5 michal novacek 2017-01-17 17:33:51 UTC
I have verified that the replication_port parameter is not ignored when changed
in resource-agents-3.9.5-43.el6.x86_64.

---

common setup:

 * enable port 3307 to be used by mysql replication (ports selinux)
 * setup mysql replication on port 3307 as master/master and verify that it
     works correctly (mysql replication setup)
 * setup cluster (pcs status)
 * setup mysql resource agent as master/slave with different replication_port,
     replication_passwd and replication_user and disable it (pcs resource)

>before the patch (resource-agents-3.9.5-34.el6.x86_64)
=======================================================
resource is started but mysql slave uses default port and will not connect

$ pcs resource enable mysql-master
$ sleep 60
$ pcs status
...
 Master/Slave Set: mysql-master [mysql]
     Masters: [ virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com ]
     Slaves: [ virt-291.ipv4.cluster-qe.lab.eng.brq.redhat.com ]
...
$ ssh virt-291 'mysql -u root -e "show slave status\G;"'
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: virt-282.cluster-qe.lab.eng.brq.redhat.com
                  Master_User: replication_user
>                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000014
          Read_Master_Log_Pos: 106
               Relay_Log_File: mysqld-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000014
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
                            ...
>                Last_IO_Errno: 2013
>                Last_IO_Error: error connecting to master 'replication_user.lab.eng.brq.redhat.com:3306' - retry-time: 60  retries: 86400
>               Last_SQL_Errno: 0
>               Last_SQL_Error: 

$ ssh virt-282 'mysql -u root -e "show master status\G;"'
Warning: Permanently added 'virt-282,10.34.71.153' (RSA) to the list of known hosts.
*************************** 1. row ***************************
            File: mysql-bin.000014
        Position: 106
    Binlog_Do_DB: tdb
Binlog_Ignore_DB:


> after the patch (resource-agents-3.9.5-43.el6.x86_64)
=====================================================
resource can be started and the port settings is respected

$ pcs resource enable mysql-master
$ sleep 60
$ pcs status
...
 Master/Slave Set: mysql-master [mysql]
     Masters: [ virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com ]
     Slaves: [ virt-291.ipv4.cluster-qe.lab.eng.brq.redhat.com ]
...

# ssh virt-282 "mysql -u root -e 'show master status\G;'"
*************************** 1. row ***************************
>           File: mysql-bin.000035
>       Position: 106
    Binlog_Do_DB: tdb
Binlog_Ignore_DB:

$ ssh virt-291 'mysql -u root -e "show slave status\G;"'
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: virt-282.cluster-qe.lab.eng.brq.redhat.com
                  Master_User: replication_user
>                 Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000035
>         Read_Master_Log_Pos: 106
               Relay_Log_File: mysqld-relay-bin.000002
                Relay_Log_Pos: 251
>       Relay_Master_Log_File: mysql-bin.000035
             Slave_IO_Running: Yes
                            ...
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 

>>(ports selinux)
The following commands have been run on all nodes of the cluster:

# getenforce
Enforcing
# semanage port -a -t mysqld_port_t -p tcp 3307
# semanage port -l | grep mysqld_port
mysqld_port_t                  tcp      3307, 1186, 3306, 63132-63164

[root@virt-291 my.cnf.d]# getenforce
Enforcing
[root@virt-291 my.cnf.d]# semanage port -a -t mysqld_port_t -p tcp 3307
[root@virt-291 my.cnf.d]# semanage port -l | grep mysqld
mysqld_port_t                  tcp      3307, 1186, 3306, 63132-63164

>>(mysql replication setup)
[root@virt-282 ~]# ssh virt-282 'mysql -u root -e "show slave status\G;" | head'
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: virt-282.cluster-qe.lab.eng.brq.redhat.com
                  Master_User: replication_user
                  Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000018
          Read_Master_Log_Pos: 106
               Relay_Log_File: mysqld-relay-bin.000001
                Relay_Log_Pos: 4

[root@virt-282 ~]# ssh virt-291 'mysql -u root -e "show master status\G;"'
*************************** 1. row ***************************
            File: mysql-bin.000018
        Position: 106
    Binlog_Do_DB: tdb
Binlog_Ignore_DB:

>>(pcs status)
[root@virt-282 my.cnf.d]# pcs status
Cluster name: STSRHTS4183
Stack: cman
Current DC: virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com (version 1.1.15-4.el6-e174ec8) - partition with quorum
Last updated: Tue Jan 17 18:31:47 2017          Last change: Tue Jan 17 18:31:42 2017 by root via crm_resource on virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com

2 nodes and 4 resources configured: 2 resources DISABLED and 0 BLOCKED from being started due to failures

Online: [ virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com virt-291.ipv4.cluster-qe.lab.eng.brq.redhat.com ]

Full list of resources:

 fence-virt-282 (stonith:fence_xvm):    Started virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com
 fence-virt-291 (stonith:fence_xvm):    Started virt-291.ipv4.cluster-qe.lab.eng.brq.redhat.com
 Master/Slave Set: mysql-master [mysql]
     Stopped (disabled): [ virt-282.ipv4.cluster-qe.lab.eng.brq.redhat.com virt-291.ipv4.cluster-qe.lab.eng.brq.redhat.com ]

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


>>(pcs resource)
[root@virt-282 ~]# pcs resource show mysql-master
 Master: mysql-master
  Meta Attrs: notify=true target-role=Stopped 
  Resource: mysql (class=ocf provider=heartbeat type=mysql)
   Attributes: replication_user=replication_user replication_port=3307 replication_passwd=password
   Operations: start interval=0s timeout=120 (mysql-start-interval-0s)
               stop interval=0s timeout=120 (mysql-stop-interval-0s)
               promote interval=0s timeout=120 (mysql-promote-interval-0s)
               demote interval=0s timeout=120 (mysql-demote-interval-0s)
               monitor interval=30s (mysql-monitor-interval-30s)

Comment 7 errata-xmlrpc 2017-03-21 09:27:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0602.html


Note You need to log in before you can comment on or make changes to this bug.