On Thu, Jun 5, 2014 at 8:16 PM, Adrian Lewis <adr...@alsiconsulting.co.uk> wrote:
> Hi all, > > > > Does anyone have any example configs or blog posts explaining the DB HA > features introduced in 4.3? Between the section in the design docs on the > wiki and the official docs, I’m a little confused as to how it’s supposed > to be set up – they appear to differ although there’s a lot more detail in > the design docs. Some of it is clearly MySQL stuff that’s outside of > Cloudstack but some of it is Cloudstack config as well. I’m just trying to > get a feel for what is the best way to use what’s made it into 4.3 final > (if different to the design docs). I’m not too strong on MySQL so I can’t > easily work out what’s a requirement, what’s just recommended (and > implications) and what the Cloudstack side actually does. Is the CS side > purely for failover or does it actually set up part of the replication for > you? Can you easily enable an existing DB for HA or is this best done > before there’s any data? Before you run cloudstack-setup-databases? > > > > Shanker – I don’t suppose this subject could add to your already excellent > blog post collection? > > > > Thanks in advance, > Hi. i have the same problem/restlessness and i think the same about the doc. On this part it's a little confused. I identify that you need to install all the management-servers before deploy the mySQL HA, for example if you will think to add a new management server after de MySQL HA it's not possible if so will erase all data from the DB (on my personal experience) so my step by step was: install the management server's accord the official 4.3 doc install mysql server on the 2 database servers (master and slave) #yum install mysql-server edit the MySQL configuration /etc/my.cnf q MASTER [mysqld] innodb_rollback_on_timeout=1 innodb_lock_wait_timeout=600 max_connections=700 binlog-format = 'ROW' bind-address = 0.0.0.0 datadir=/var/lib/mysql log-bin=mysql-bin server_id=1 SLAVE [mysqld] innodb_rollback_on_timeout=1 innodb_lock_wait_timeout=600 max_connections=700 binlog-format = 'ROW' datadir=/var/lib/mysql server_id=2 log-bin=mysql-bi On both servers grant privileges to root account mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.x.%' WITH GRANT OPTION; now add an account for replication # mysql -u root mysql> create user 'cloud-repl'@'192.168.1.%' identified by 'password'; mysql> grant replication slave on *.* TO 'cloud-repl'@'192.168.1.%'; mysql> flush privileges; mysql> flush tables with read lock; On master: mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000001 | 412 | | | +------------------+----------+--------------+------------------+ “don't forget the file and the position” then mysql> unlock tables; on the Slave: mysql> change master to -> master_host='192.168.1.16', -> master_user='cloud-repl', -> master_password='password', -> master_log_file='mysql-bin.000001', -> master_log_pos=412; now start the slave: mysql> start slave; I have 3 management servers with a centralised database on cluster I will write a blogpost in a few days with all the process. some references: http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/latest/choosing_deployment_architecture.html http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/latest/installation.html?highlight=separate%20node#install-database-on-separate-node http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/reliability.html?highlight=high%20availability#database-high-availability -- Hollman Eduardo Enciso R. http://algolibre.com @hollman