Bug 1304711

Summary: Galera resource agent cannot connect to custom host/port
Product: Red Hat Enterprise Linux 7 Reporter: Marcel Kolaja <mkolaja>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: Ofer Blaut <oblaut>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.3CC: agk, cfeist, cluster-maint, dciabrin, fdinitto, mbayer, mjuricek, mkolaja, oalbrigt, royoung, snagar
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-3.9.5-54.el7_2.4 Doc Type: Bug Fix
Doc Text:
Cause: The galera resource agent is only able to connect to a local MariaDB socket. Consequence: The resource agent can fail due to uncontrolled events, like for instance max connection reached, or slow connections (e.g. when mariadb threadpool is engaged). Fix: Add support for custom host/port options, in order to benefit from MariaDB's extra-port and extra-max-connections. Result: Able to connect to other MariaDB resources.
Story Points: ---
Clone Of: 1299404 Environment:
Last Closed: 2016-02-16 11:17:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1299404    
Bug Blocks:    

Description Marcel Kolaja 2016-02-04 12:38:15 UTC
This bug has been copied from bug #1299404 and has been proposed
to be backported to 7.2 z-stream (EUS).

Comment 4 Damien Ciabrini 2016-02-05 14:21:46 UTC
Instruction for test

While galera cluster is up, create a new user for the test

    create user 'testuser'@'%' identified by 'test';

Allow user to log in to a tcp socket

    grant all privileges on 'testuser'@'%';

Stop galera.

    pcs resource disable galera

Once stopped, change /etc/my.cnf.d/galera.cnf to have mysql listen to
port 4242 on an available interface:

    bind_address=0.0.0.0
    port=4242

Then configure /etc/sysconfig/clustercheck to make the resource
agent contact mysqld on the tcp port above. Modify the entries so
that the file looks like:

    MYSQL_USERNAME="testuser"
    MYSQL_PASSWORD="test"
    MYSQL_HOST="127.0.0.1"
    MYSQL_PORT="4242"

(don't set MYSQL_HOST to "localhost" otherwise mysql will try to
connect via UNIX socket)

Start galera again.

    pcs resource enable galera

After all machine are marked as master, verify that mysqld is listening
to port 4242.

    netstat -tnlp | grep mysqld

If so, the test is working as expected since the resource agent polls
mysqld regularly to ensure that galera has started properly and is
still running.

For cleaning up, stop galera, reset the two config files to their
original values, and restart galera. Once started, you can delete the
test user

    drop user 'testuser'@'%';

Comment 7 errata-xmlrpc 2016-02-16 11:17:38 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-2016-0217.html