Mysql clustering

Discussion in 'Server Operation' started by hello1, Sep 3, 2008.

  1. hello1

    hello1 New Member

    Hi All

    I am trying to setup a mysql cluster with 2 data nodes and two load balancers. I have followed the same instrauctions given http://www.howtoforge.com/setting-up-a-loadbalanced-mysql-cluster-with-mysql5.1-p3 .

    Issues

    1. On both load balancers

    /usr/sbin/ldirectord ldirectord.cf status
    ldirectord stale pid file /var/run/ldirectord.ldirectord.cf.pid for /etc/ha.d/ldirectord.cf
    ldirectord is stopped for /etc/ha.d/ldirectord.cf

    AND

    ipvsadm -L -n
    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:port Scheduler Flags
    -> RemoteAddress:port Forward Weight ActiveConn InActConn
    TCP 10.10.10.15:3306 wrr
    -> 10.10.10.3:3306 Route 0 0 0
    -> 10.10.10.2:3306 Route 0 0 0

    Also, getting the following error while starting heartbeat

    ldirectord stale pid file /var/run/ldirectord.ldirectord.cf.pid for /etc/ha.d/ldirectord.cf
    [ OK ]

    What may be the reason? BTW i have verified that failover is happening
    when i stop heartbeat on active node.



    ~Vincent
     
    Last edited: Sep 3, 2008
  2. zer0

    zer0 New Member

    i'm having exactly the same problem i', desperated, yesterday it worked just fine, pliz help!
     
  3. falko

    falko Super Moderator

    You might want to try MySQL master-master replication instead of a MySQL cluster. Replication is easier to manage, and with MySQL version 5, a cluster holds all data in memory only!
     
  4. maykel535

    maykel535 New Member

    I have th same problem

    I have installed two loadbalanced and two webserver and it running OK very good. But i have installed two loadbalanced with two mysql server master/master with follow configuration in ldirectord.conf and in two nodes:


    # Global Directives
    checktimeout=10
    checkinterval=2
    autoreload=no
    logfile="local0"
    quiescent=yes

    virtual=10.100.100.150:3306
    real=10.100.100.151:3306 gate
    real=10.100.100.152:3306 gate
    fallback=127.0.0.1:3306 gate
    service=mysql
    checktype=negotiate
    login="root"
    passwd="comnet"
    database="mysql"
    request="SELECT * FROM user"
    scheduler=wrr
    protocol=tcp

    I follow the tutorial as two webserver and I work fine but with two mysql server not found...No packet forwarding...

    And the log /var/log/messages:

    ResourceManager[3328]: 2011/11/16_14:25:54 info: Running /etc/ha.d/resource.d/ldirectord ldirectord.cf start
    ResourceManager[3328]: 2011/11/16_14:25:55 info: Running /etc/ha.d/resource.d/LVSSyncDaemonSwap master start
    LVSSyncDaemonSwap[3429]: 2011/11/16_14:25:55 info: ipvs_syncbackup down
    LVSSyncDaemonSwap[3429]: 2011/11/16_14:25:55 info: ipvs_syncmaster up
    LVSSyncDaemonSwap[3429]: 2011/11/16_14:25:55 info: ipvs_syncmaster obtained
    IPaddr2[3476]: 2011/11/16_14:25:55 INFO: Resource is stopped
    ResourceManager[3328]: 2011/11/16_14:25:55 info: Running /etc/ha.d/resource.d/IPaddr2 10.100.100.150/24/eth0/10.100.100.255 start
    IPaddr2[3577]: 2011/11/16_14:25:55 INFO: ip -f inet addr add 10.100.100.150/24 brd 10.100.100.255 dev eth0
    IPaddr2[3577]: 2011/11/16_14:25:55 INFO: ip link set eth0 up
    IPaddr2[3577]: 2011/11/16_14:25:56 INFO: /usr/lib/heartbeat/send_arp -i 200 -r 5 -p /var/run/heartbeat/rsctmp/send_arp/send_arp-10.100.100.150 eth0 10.100.100.150 auto not_used not_used
    IPaddr2[3553]: 2011/11/16_14:25:56 INFO: Success



    I execute:

    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:port Scheduler Flags
    -> RemoteAddress:port Forward Weight ActiveConn InActConn
    TCP 10.100.100.150:3306 wrr
    -> 10.100.100.151:3306 Route 0 0 0
    -> 10.100.100.152:3306 Route 0 0 0
    -> 127.0.0.1:3306 Local 1 0 0

    But I think failed the ldirectord, because not running with mysql:

    root@loadb1:/etc/ha.d# /etc/init.d/ldirectord status
    * Running ldirectord status ldirectord stale pid file /var/run/ldirectord.ldirectord.cf.pid for /etc/ha.d/ldirectord.cf
    ldirectord is stopped for /etc/ha.d/ldirectord.cf

    Can I help me Falko, thanks in advanced.
     
  5. maykel535

    maykel535 New Member

    I resolved the problem

    Hi!! I resolve the problem. Thanks falko and all.
     
  6. Seif

    Seif New Member

    Hi,

    I have the same problem, plz tell how did you fix it.

    Thx.
     
  7. maykel535

    maykel535 New Member

    Ok

    You need install the follow:

    apt-get install libdbi-perl

    Now, perl connect to mysql.

    Good luck.
     

Share This Page