You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Stavros Konstantaras <s....@uva.nl> on 2015/11/23 22:54:37 UTC

Failed to configure HA in active/active setup

Hi there,

I am trying to setup High Availability on Cloudstack 4.5.2 in a Master-Master implementation with MySQL DB but I get the following error:
——
2015-11-24 00:29:01,988 INFO  [c.c.u.d.T.Transaction] (main:null) Is Data Base High Availiability enabled? Ans : true
2015-11-24 00:29:02,043 INFO  [c.c.u.d.T.Transaction] (main:null) The slaves configured for Cloud Data base is/are : 10.0.60.2
2015-11-24 00:29:02,087 ERROR [c.c.u.d.Merovingian2] (main:null) Unable to get a new db connection
java.sql.SQLException: Invalid load balancing strategy 'com.cloud.utils.db.StaticStrategy'.
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
	at com.mysql.jdbc.Util.loadExtensions(Util.java:588)
	…
	…
——

The target is fault tolerance so in case of failure of the first server then we can continue working as normal with the second server. I tried to debug this but unfortunately it still goes on. 
I checked open ports with netstat and mysql listens to all interfaces “0.0.0.0:3306”

I enabled HA in db.properties and I inserted  the IP of the second server in db.cloud.slaves and db.usage.slaves (it is also viewable in the error above).

——
Of course I configured my.cnf file which is quite simple:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql

symbolic-links=0
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
default-storage-engine=InnoDB
character-set-server=utf8
transaction-isolation=READ-COMMITTED
innodb_flush_log_at_trx_commit=1
max_connections=350

# ~ HA ~
server-id=1 (THIS VALUE IS 2 IN THE SAME FILE OF THE SECOND SERVER)
log-bin=mysql-bin
binlog-format='ROW'
sync_binlog=1

# Bin logs cleanup configuration
expire_logs_days=10
max_binlog_size=100M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
——

I place the HA java plug-in under "/usr/share/cloudstack-mysql-ha/lib/cloud-plugin-database-mysqlha-4.5.2.jar”
——

In catalina.properties my common.loader looks normal: "common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/usr/share/java/mysql-connector-java.jar,/usr/share/cloudstack-mysql-ha/lib/*jar”

After unlimited restarts of both cloudstack-management and mysqld the problem still remains. Both IPs are pingable between the two servers. Any other idea or suggestion on solving that? Thank you in advance. 

Best regards
Stavros

----------------------------
Stavros Konstantaras
Science faculty Research IT support (FEIOG) 
University of Amsterdam, Science Park 904, 1098 XH

Fingerprint: E5E5 9B19 D1CD 88CD 4763  3465 A8DC 7C92 330F D59A