当前位置:文档之家› CloudStack管理节点高可用部署

CloudStack管理节点高可用部署

CloudStack管理服务器的高可用部署1.1. 环境规划节点名称说明VLAN ID IPhaproxy 负载均衡节点,安装haproxy。

3 192.168.3.14/24 manager1 管理节点1,安装CloudStack的3 192.168.3.15/24management部分。

3 192.168.3.26/24 manager2 管理节点2,安装CloudStack的management部分。

3 192.168.3.27/24 mysql1 数据库节点1,安装CloudStack的mysql数据库,作为主库。

3 192.168.3.28/24 mysql2 数据库节点2,安装CloudStack的mysql数据库,作为从库。

Host 安装虚拟化管理软件xen。

4 192.168.4.41/24 storage CloudStack环境需要的存储。

5 192.168.5.5/24 结构图:以root用户登录管理服务器。

修改/etc/Hosts文件,添加fqdn名称。

#vi /etc/Hosts192.168.3.15 manager1#Hostname manager1配置安装光盘为YUM源。

#vi /etc/yum.repo.d/rhel.repo[rhel-cdrom]name=rhel-cdrombaseurl=file:///mediaenabled=1gpgcheck=0修改/etc/selinux/config文件关闭SELINUX,并重启服务器。

# vi /etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted上传CloudStack安装包并解压缩。

安装管理服务器[M]。

配置NFS服务。

# chkconfig rpcbind on# chkconfig NFS on# service rpcbind start# service NFS startStarting NFS services:[ OK ]Starting NFS quotas:[ OK ]Starting NFS daemon:[ OK ]Starting NFS mountd:[ OK ]按照第一台的安装方法安装第二台管理节点1.4. 安装第一台数据库节点以root用户登录192.168.3.27服务器。

修改/etc/Hosts文件,添加fqdn名称。

#vi /etc/Hosts192.168.3.27 mysql1#Hostname mysql1配置安装光盘为YUM源。

#vi /etc/yum.repo.d/rhel.repo[rhel-cdrom]name=rhel-cdrombaseurl=file:///mediaenabled=1gpgcheck=0修改/etc/selinux/config文件关闭SELINUX,并重启服务器。

# vi /etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted上传CloudStack安装包并解压缩。

安装MySQL数据库[D]。

修改/etc/my.conf文件。

# vi /etc/f[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0innodb_rollback_on_timeout=1innodb_lock_wait_timeout=600max_connections=700log-bin=mysql-binbinlog-format = 'ROW'server_id=1[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid设置MySQL的root密码,删除不必要的登录权限,创建复制用户。

并刷新权限。

#mysql –u rootmysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option; mysql> delete from er where PASSWORD="";mysql> delete from er where HOST='localhost';mysql> grant replication slave on *.* to 'slaver'@'192.168.3.%' identified by '123456';mysql>flush privileges;重新启动mysql并用新密码重新登录。

如能正常登录mysql,则配置正确。

#/etc/init.d/mysqld restart#mysql –u root –p123456关闭掉mysql服务为下面的步骤做准备。

#/etc/init.d/mysqld stop1.5. 安装第二台数据库节点以root用户登录192.168.3.28服务器。

修改/etc/Hosts文件,添加fqdn名称。

#vi /etc/Hosts192.168.3.28 mysql2#Hostname mysql2配置安装光盘为YUM源。

#vi /etc/yum.repo.d/rhel.repo[rhel-cdrom]name=rhel-cdrombaseurl=file:///mediaenabled=1gpgcheck=0修改/etc/selinux/config文件关闭SELINUX,并重启服务器。

# vi /etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted上传CloudStack安装包并解压缩。

安装MySQL数据库[D]。

修改/etc/my.conf文件。

# vi /etc/f[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0innodb_rollback_on_timeout=1innodb_lock_wait_timeout=600max_connections=700server_id=2[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid删除掉初始数据。

#/etc/init.d/mysqld stop#cd /var/lib/mysql/确保当前目录为/var/lib/mysql/,再执行下一行的命令:[root@Hostname mysql]#rm -fr *1.6. 做数据库复制从mysql1机器拷贝数据文件到mysql2机器,在mysql1机器上操作:#scp -fr /var/lib/mysql/* 192.168.3.28:/var/lib/mysql/启动mysql1与mysql2上的mysql服务分别在两台机器上执行#/etc/init.d/mysqld start查看mysql1机器的binlog位置点,在mysql1机器上执行:#mysql –u root -p123456mysql>show master status\G;看到如下显示,记录下File字段和Position字段的值:*************************** 1. row ***************************File:mysql-bin.000002Position:106Binlog_Do_DB:Binlog_Ignore_DB:1 row in set (0.00 sec)在mysql2机器上设置同步,并启动同步线程。

相关主题