[ClusterLabs] Fwd: Issue with resource-agents ocf:heartbeat:mariadb

Ken Gaillot kgaillot at redhat.com
Fri Apr 9 10:14:01 EDT 2021


Hi,

I'm not very familiar with the mariadb agent, but one thing to check is
that the output of "uname -n" can be used in the CHANGE MASTER command.
If not, you need to set node attributes for the right names to use.

I believe you have to configure and start replication manually once
before the cluster can manage it automatically.

On Fri, 2021-04-09 at 10:04 +0200, Olivier POUILLY wrote:
> Hi team,
> Thanks for this great job on those library.
> I would like to know if it was possible to get some help on the
> mariadb resource.
> After the configuration of my cluster pcs command shows me:
> root at node1:~# pcs status
> Cluster name: clusterserver
> Stack: corosync
> Current DC: node1 (version 2.0.1-9e909a5bdd) - partition with quorum
> Last updated: Thu Apr  8 15:45:35 2021
> Last change: Thu Apr  8 15:45:25 2021 by root via cibadmin on node1
> 
> 2 nodes configured
> 2 resources configured
> 
> Online: [ node1 node2 ]
> 
> Full list of resources:
> 
>  Clone Set: mariadb_server-clone [mariadb_server] (promotable)
>      Masters: [ node1 ]
>      Slaves: [ node2 ]
> 
> Daemon Status:
>   corosync: active/disabled
>   pacemaker: active/disabled
>   pcsd: active/enabled
> 
> But when I go to mysql on server2 I see my slave statys off:
> MariaDB [(none)]> SHOW SLAVE STATUS\G
> *************************** 1. row ***************************
>                 Slave_IO_State: 
>                    Master_Host: node1
>                    Master_User: replication
>                    Master_Port: 3306
>                  Connect_Retry: 60
>                Master_Log_File: master-bin.000001
>            Read_Master_Log_Pos: 463
>                 Relay_Log_File: master-relay-bin.000002
>                  Relay_Log_Pos: 672
>          Relay_Master_Log_File: master-bin.000001
>               Slave_IO_Running: No
>              Slave_SQL_Running: No
>                Replicate_Do_DB: 
>            Replicate_Ignore_DB: 
>             Replicate_Do_Table: 
>         Replicate_Ignore_Table: 
>        Replicate_Wild_Do_Table: 
>    Replicate_Wild_Ignore_Table: 
>                     Last_Errno: 0
>                     Last_Error: 
>                   Skip_Counter: 0
>            Exec_Master_Log_Pos: 463
>                Relay_Log_Space: 2935
>                Until_Condition: None
>                 Until_Log_File: 
>                  Until_Log_Pos: 0
>             Master_SSL_Allowed: No
>             Master_SSL_CA_File: 
>             Master_SSL_CA_Path: 
>                Master_SSL_Cert: 
>              Master_SSL_Cipher: 
>                 Master_SSL_Key: 
>          Seconds_Behind_Master: NULL
>  Master_SSL_Verify_Server_Cert: No
>                  Last_IO_Errno: 0
>                  Last_IO_Error: 
>                 Last_SQL_Errno: 0
>                 Last_SQL_Error: 
>    Replicate_Ignore_Server_Ids: 
>               Master_Server_Id: 0
>                 Master_SSL_Crl: 
>             Master_SSL_Crlpath: 
>                     Using_Gtid: Current_Pos
>                    Gtid_IO_Pos: 
>        Replicate_Do_Domain_Ids: 
>    Replicate_Ignore_Domain_Ids: 
>                  Parallel_Mode: conservative
>                      SQL_Delay: 0
>            SQL_Remaining_Delay: NULL
>        Slave_SQL_Running_State: 
>               Slave_DDL_Groups: 0
> Slave_Non_Transactional_Groups: 0
>     Slave_Transactional_Groups: 0
> 
> On pacemaker log I got the following message:
> Apr 08 19:26:18 node2 pacemaker-execd     [6899] (operation_finished)
>     notice: mariadb_server_start_0:7072:stderr [ Error performing
> operation: No such device or address ]
> 
> Here is the detailed of my configuration:
> - pcs : 0.10.1
> - Pacemaker 2.0.1
> - Corosync Cluster Engine, version '3.0.1'
> - mariadb  Ver 15.1 Distrib 10.3.27-MariaDB
> - Debian 10.8
> Mysql configuration:
> [server]
> [mysqld]
> user                    = mysql
> pid-file                = /run/mysqld/mysqld.pid
> socket                  = /run/mysqld/mysqld.sock
> basedir                 = /usr
> datadir                 = /var/lib/mysql
> tmpdir                  = /tmp
> lc-messages-dir         = /usr/share/mysql
> bind-address            = 0.0.0.0
> query_cache_size        = 16M
> log_error = /var/log/mysql/error.log
> server-id=2
> expire_logs_days        = 10
> character-set-server  = utf8mb4
> collation-server      = utf8mb4_general_ci
> [embedded]
> [mariadb]
> log-bin
> server-id=2
> log-basename=master
> [mariadb-10.3]
> 
> Corosync configuration:
> <cib crm_feature_set="3.1.0" validate-with="pacemaker-3.2" epoch="21"
> num_updates="0" admin_epoch="0" cib-last-written="Thu Apr  8 19:26:13
> 2021" update-origin="node1" update-client="cibadmin" update-
> user="root" have-quorum="1" dc-uuid="1">
>   <configuration>
>     <crm_config>
>       <cluster_property_set id="cib-bootstrap-options">
>         <nvpair id="cib-bootstrap-options-stonith-enabled"
> name="stonith-enabled" value="false"/>
>         <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-
> quorum-policy" value="ignore"/>
>         <nvpair id="cib-bootstrap-options-have-watchdog" name="have-
> watchdog" value="false"/>
>         <nvpair id="cib-bootstrap-options-dc-version" name="dc-
> version" value="2.0.1-9e909a5bdd"/>
>         <nvpair id="cib-bootstrap-options-cluster-infrastructure"
> name="cluster-infrastructure" value="corosync"/>
>         <nvpair id="cib-bootstrap-options-cluster-name"
> name="cluster-name" value="clusterserver"/>
>       </cluster_property_set>
>       <cluster_property_set id="mysql_replication">
>         <nvpair id="mysql_replication-mariadb_server_REPL_INFO"
> name="mariadb_server_REPL_INFO" value="node1"/>
>       </cluster_property_set>
>     </crm_config>
>     <nodes>
>       <node id="1" uname="node1"/>
>       <node id="2" uname="node2"/>
>     </nodes>
>     <resources>
>       <clone id="mariadb_server-clone">
>         <primitive class="ocf" id="mariadb_server"
> provider="heartbeat" type="mariadb">
>           <instance_attributes id="mariadb_server-
> instance_attributes">
>             <nvpair id="mariadb_server-instance_attributes-binary"
> name="binary" value="/usr/sbin/mysqld"/>
>             <nvpair id="mariadb_server-instance_attributes-config"
> name="config" value="/etc/mysql/my.cnf"/>
>             <nvpair id="mariadb_server-instance_attributes-datadir"
> name="datadir" value="/var/lib/mysql"/>
>             <nvpair id="mariadb_server-instance_attributes-node_list" 
> name="node_list" value="node1 node2"/>
>             <nvpair id="mariadb_server-instance_attributes-pid"
> name="pid" value="/var/run/mysqld/mysqld.pid"/>
>             <nvpair id="mariadb_server-instance_attributes-
> replication_passwd" name="replication_passwd" value="similarly-
> secure-password"/>
>             <nvpair id="mariadb_server-instance_attributes-
> replication_user" name="replication_user" value="replication"/>
>             <nvpair id="mariadb_server-instance_attributes-socket"
> name="socket" value="/var/run/mysqld/mysqld.sock"/>
>           </instance_attributes>
>           <meta_attributes id="mariadb_server-meta_attributes">
>             <nvpair id="mariadb_server-meta_attributes-clone-max"
> name="clone-max" value="2"/>
>             <nvpair id="mariadb_server-meta_attributes-clone-node-
> max" name="clone-node-max" value="1"/>
>             <nvpair id="mariadb_server-meta_attributes-master-max"
> name="master-max" value="1"/>
>             <nvpair id="mariadb_server-meta_attributes-master-node-
> max" name="master-node-max" value="1"/>
>             <nvpair id="mariadb_server-meta_attributes-notify"
> name="notify" value="true"/>
>             <nvpair id="mariadb_server-meta_attributes-promotable-
> max" name="promotable-max" value="1"/>
>             <nvpair id="mariadb_server-meta_attributes-promotable-
> node-max" name="promotable-node-max" value="1"/>
>           </meta_attributes>
>           <operations>
>             <op id="mariadb_server-demote-interval-0" interval="0"
> name="demote" timeout="120"/>
>             <op id="mariadb_server-monitor-interval-10" interval="10"
> name="monitor" role="Master" timeout="30"/>
>             <op id="mariadb_server-monitor-interval-20" interval="20"
> name="monitor" role="Slave" timeout="30"/>
>             <op id="mariadb_server-notify-interval-0s" interval="0s"
> name="notify" timeout="60s"/>
>             <op id="mariadb_server-promote-interval-0" interval="0"
> name="promote" timeout="120"/>
>             <op id="mariadb_server-start-interval-0" interval="0"
> name="start" timeout="120"/>
>             <op id="mariadb_server-stop-interval-0" interval="0"
> name="stop" timeout="120"/>
>           </operations>
>         </primitive>
>         <meta_attributes id="mariadb_server-clone-meta_attributes">
>           <nvpair id="mariadb_server-clone-meta_attributes-
> promotable" name="promotable" value="true"/>
>         </meta_attributes>
>       </clone>
>     </resources>
>     <constraints/>
>     <rsc_defaults>
>       <meta_attributes id="rsc_defaults-options">
>         <nvpair id="rsc_defaults-options-failure-timeout"
> name="failure-timeout" value="30"/>
>         <nvpair id="rsc_defaults-options-migration-threshold"
> name="migration-threshold" value="2"/>
>       </meta_attributes>
>     </rsc_defaults>
>   </configuration>
> </cib>
> 
> Did I miss something on my configuration ? Or do I need more than two
> servers ?
> 
> Regards,
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list