cloudstack-management 安装教程-总结
安装总体上分为:管理节点的安装,受控节点的安装。
其中管理节点是可以在虚拟机下安装,受控节点则需要创建虚拟机,所以受控节点的安装最好在独立的主机上安装。
安装管理节点只有唯一的一种方法,而受控节点可以根据不同的虚拟化方案(KVM,Xen,Xenserve,VMware)来选择不同的安装方案。但是,KVM,Xen在安装受控节点之前必须要先安装 CloudStack-Agent。
https://my.oschina.net/qinerg/blog?sort=time&p=1&temp=1493780323200
以下是官方网站的介绍
http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/4.9/management-server/index.html
安装大致可以分为三部曲:
1.管理服务器的安装
2.配置cloudstack
3.主机KVM安装
管理服务器的安装又可以分为:
一个单一的Management Server 节点,MYQSL在同一个节点上
多个管理服务器节点,与管理服务器分离的节点上
安装cloudstack之前,先安装net-tools工具。
然后考虑/home分区大小,规划好配置后在决定安装
大致介绍:
1.运行环境
cloudstack-4.9.2.0
Centos7.2.0
2.IP分配
cloudstack-management 所在IP:192.168.77.232
cloudstack-agent 所在IP:192.68.77.18
3.所用的VM模版为
KVM
一、管理服务器的安装步骤:
1.准备所需要的操作系统
a.以root的身份登陆到操作系统修改ip
vim /etc/sysconfig/network-scripts/ifcfg-em1
#修改BOOTPROTO="static"ONBOOT='yes'#添加IPADDR=192.168.77.18NETMASK=255.255.255.0
确保能够与互联网通讯vim /etc/sysconfig/network
#添加网关:GATEWAY=192.168.77.254
需要域名解析vim /etc/resolv.conf
nameserver 192.168.77.254
b.配置主机名
hostname B-MS.china.cs
重启也更改:vim /etc/sysconfig/networkHOSTNAME=B-MS.china.csvim /etc/hosts添加:192.168.77.16 B-MS.china.cs检查主机名字是否合法hostname --fqdn检查机器能否连接到internetping cloudstack.apach.org
c.ntp时间同步
ntp-server查看服务状态service ntpd status安装ntpdyum install ntp在配置前,先使用ntpdate手动同步下时间,免得本机与外部时间服务器时间差距太大,让ntpd不能正常同步。# ntpdate -u 202.112.10.36
22 Dec 16:52:38 ntpdate[6400]: adjust time server 202.112.10.36 offset 0.012135 sec*记住在防火墙中写入udp 123端口,不然无法同步时间* 3.vim /etc/ntpd.conf
# 允许内网其他机器同步时间restrict 192.168.77.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cnserver 210.72.145.44 perfer # 中国国家受时中心server 202.112.10.36 # 1.cn.pool.ntp.orgserver 59.124.196.83 # 0.asia.pool.ntp.org#broadcast 192.168.1.255 autokey # broadcast server#broadcastclient # broadcast client#broadcast 224.0.1.1 autokey # multicast server#multicastclient 224.0.1.1 # multicast client#manycastserver 239.255.254.254 # manycast server#manycastclient 239.255.254.254 autokey # manycast client# allow update time by the upper server # 允许上层时间服务器主动修改本机时间restrict 210.72.145.44 nomodify notrap noqueryrestrict 202.112.10.36 nomodify notrap noqueryrestrict 59.124.196.83 nomodify notrap noquery# Undisciplined Local Clock. This is a fake driver intended for backup# and when no outside source of synchronized time is available. # 外部时间服务器不可用时,以本地时间作为时间服务server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10
ntp时间同步具体介绍来源:
http://acooly.iteye.com/blog/1993484
ntp---client
vim /etc/ntpd.conf
server 192.168.77.232restrict 192.168.77.232 nomodify notrap noqueryserver 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10
OK,保存退出,请求服务器前,请先使用ntpdate手动同步下时间
# ntpdate -u 192.168.0.135
22 Dec 17:09:57 ntpdate[6439]: adjust time server 192.168.1.135 offset 0.004882 sec这里有可能出现同步失败,一般情况下原因都是本地的NTPD服务器还没有正常启动起来,一般需要几分钟时间后才能开始同步。
如果还是无法同步,有一个简单粗暴的办法,禁止防火墙的启动# service ntpd start
....
启动后,查看同步情况
# ntpq -p
# ntpstat
.....
因为是内网,一般ntpstat很快就可以同步上,几分钟需要等下.
OK,本机客户端配置完成后,使用SCP拷贝/etc/ntp.conf到其他需要同步的客户端机器,启动NTPD服务即可。其他客户端机器上操作配置如下:
# ntpdate -u 192.168.77.232
22 Dec 17:09:57 ntpdate[6439]: adjust time server 192.168.77.232 offset 0.004882 sec
# scp 192.168.1.xxx:/etc/ntp.conf /etc/ntp.conf
# service ntpd start
查看
chkconfig |grep ntpd
3.在第一台主机上安装管理服务器
先判断管理服务器是要安装在单节点还是多节点。
配置安装包的仓库。
RPM包仓库:vim /etc/yum.repos.d/cloudstack.repo,并添加一下信息
[cloudestack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/centos/$releasever/4.9/
enable=1
gpgcheck=0
安装管理服务器。
yum install cloudstack-management
or 用去官网上直接下载到本地,利用yum localinstall 命令执行本地安装
2.在管理服务器节点上安装数据库
在centos7系统下mysql被mariadb所替换,如果想要安装mysql,请按以下步骤
在命令行下输入:
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
centos下mysql的卸载
http://blog.csdn.net/typa01_kk/article/details/49057073
安装成功后启动mysql服务。
# service mysqld start
初次安装mysql,root账户没有密码。
来源: http://blog.csdn.net/huangjingqian/article/details/53894191
初次安装设置root密码:
mysql -u root
mysql> set password for ‘root’@’localhost’ =password(‘1’);
打开配置文件,vim /etc/my.conf,在[mysqld]中加入以下语句
innodb_rollback_on_timeout=1 innodb_lock_wait_timeout=600
log-bin=mysql-bin binlog-format='ROW'
启动mysql
service mysqld start
查看mysql运行状态
service mysqld status
确保开机也启动mysql
chkconfig mysqld on
确保mysql安装向导
mysql_secure_installation –一路yes即可
禁用SELinux 来确保代理工具能够启动
centos7下:关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下
1、直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、设置 iptables service
yum -y install iptables-services
如果要修改防火墙配置,如增加防火墙端口3306
vi /etc/sysconfig/iptables
增加规则
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
保存退出后
systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
最后重启系统使设置生效即可。
1.检查机器是否安装SELniux
sestatus查看se状态
rpm -qa |grep selinux
2.selinux为允许模式
vim /etc/selinux/config
SELINUX = permissive
执行:setenforce permissive
f.在数据库上创建云用户
cloudstack-setup-databases cloud:123456@localhost --deploy-as=root:1cloudstack-setup-databases cloud:<dbpassword> @localhost \
--deploy-as = root:<password> \
-e <encryption_type> \
-m <management_server_key> \
-k <database_key> \
-i <management_server_ip>
在dbpassword中,指定要分配给“云”用户的密码。您可以选择不提供密码,尽管不推荐。
在deploy-as中,指定部署数据库的用户的用户名和密码。在以下命令中,假定root用户正在部署数据库并创建“云”用户。
(可选)对于encryption_type,请使用文件或Web来指示用于传递数据库加密密码的技术。默认:文件。请参阅关于密码和密钥加密。
(可选)对于manage_server_key,替换CloudStack属性文件中用于加密机密参数的默认密钥。默认值:密码。强烈建议您用更安全的值替换它。请参阅 关于密码和密钥加密。
(可选)对于database_key,替换CloudStack数据库中用于加密机密参数的默认密钥。默认值:密码。强烈建议您用更安全的值替换它。请参阅 关于密码和密钥加密。
(可选)对于manage_server_ip,您可以明确指定集群管理服务器节点IP。如果未指定,将使用本地IP地址。
设置iptables,并启动管理服务器。
cloudstack-setup-management
3.在管理服务器上设置NFS服务器
这是一个链接:nfs在centos下配置
安装nfs-utils
yum install nfs-utils
在管理服务器上,为你将要使用的primary,secondary创建两个存储目录
mkdir -p /export/primary
mkdir -p /export/secondary
配置一个新的目录为NFS exports,
vim /etc/exports
通过rw,async,no_root_squash,no_subtree_check,导出NFS共享
vim /etc/exports/
/export *(rw,async,no_root_squash,no_subtree_check)
挂载所有nfs目录
exportfs -a
vim /etc/sysconfig/nfs
取消以下行的注释
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
vim /etc/sysconfig/iptables
在[INPUT] 的开始出增加以下行,NETWORK是要使用的网络IP
-A INPUT -s <NETWORK> -m state--state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -s <NETWORK> -m state--state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -s <NETWORK> -m state--state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -s <NETWORK>-m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -s <NETWORK> -m state --state NEW -p udp --dport 662 -j ACCEPT
service iptables restart
service iptables save
如果在客户点和服务器之间使用NFS V4进行通信,在虚拟机管理程序主机和管理服务器的/etc/idmapd.conf中添加你的domain
vi /etc/idmapd.conf
从idmapd.conf中的Domain行开头删除字符#,并将文件中的值替换为您自己的域。在下面的示例中,该域名是 company.com。
service rpcbind start
service nfs start
service nfs status
nfsclient查询:
showmount -e
重新启动管理服务器所在的主机。
测试
登录管理程序主机。
确保NFS和rpcbind正在运行。根据您的操作系统,命令可能会有所不同。例如:
service rpcbind start
service nfs start
chkconfig nfs on
chkconfig rpcbind on
reboot
mkdir /mnt/secondary
<在安装NFS的主机上运行:mount -t nfs :/export/secondary /mnt/secondary
4.导入系统VM模板
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -f /root/opt/模版 -h kvm -F
PS:NFS客户端挂载nfs共享文件一般都挂在/mnt目录下,笔者曾经挂载/tmp/ios 文件下导致存储无法添加
5.运行WEB-UI
初始化管理节点
cloudstack-setup-management –tomcat7
启动cloudstack服务
service cloudstack-management restart
chown cloud:cloud /var/log/cloudstack/ -R
启动成功能后,你现在就可以用谷歌、火狐浏览器访问管理节点
http:/192.168.77.232:8080/client/
报错: Unable to execute upgrade script:
/usr/share/cloudstack-management/setup/db/schema-40to410.sql
解决方法:
http://www.ithao123.cn/content-2719344.html
数据库导入两次即可
如何快速重装cloudstack-management:
停掉服务器
service cloudstack-management stop
删除数据库
mysql -u root -p
1
drop database cloud;
drop database cloud_usage;
重新导入数据库
cloudstack-setup-databases cloud:123456@localhost –deploy-as=root:1
导入系统模版
rm -rf /mnt/secondary
mount -t nfs :/export/primary /mnt/secondary
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -f /root/opt/模版 -h kvm -F
PS:日志位于/var/log/cloudstack/mangement/magement-server.log
一些小错误总结:
WebUI上显示辅助存储为0,且console Proxu VM Secondary Storage VM stopped并且不断的删除重建,那么可能 1.hostname 有误,可能是HOSTNAME写错
2.在你的cloudstack计算节点上的libvirt出错了,仔细查看log日志。如果你在/etc/cloudstack/agent/agent.properties 中添加了cpu
1、管理节点的webui 无法访问
检查iptables是否阻挡了8080端口。检查cloudstack-management服务是否正常启动。
server cloudstack-management status
如果启动状态不正常,则需要检查一下日志。
日志位于 /var/log/cloudstack/management/catalina.out 。根据日志中的错误提示,进行相应的处理,绝大多数问题都可以得到解决。
如果日志信息不够详细,可以修改 /etc/cloudstack/management/log4j-cloud.xml来调整日志的输出级别。
2、登陆时提示用户名密码不正确。
默认的登陆用户名为 admin 密码是 password 。
如果登陆时提示不正确,可能是导入基础数据库时有的问题。
重新导入基础数据库:
cloudstack-setup-databases cloud:123456@localhost –deploy-as=root:1
如果还不行,将数据库删掉再重新导入。
3、CloudStack不能添加主存储或二级存储
检查/etc/sysconfig/nfs配置文件是否把端口都开放了。
检查iptables是否有阻挡。
检查CloudStack的“全局设置”,secstorage.allowed.internal.sites属性是否设置正确。
4、CloudStack无法导入IOS或虚拟机模板
创建好“基础架构”后,就可以导入ISO文件或虚拟机模板,为创建虚机做准备了。
如果你发现注册ISO或注册模板时,状态字段一直不动,已就绪永远都是no,那一般都是因为二级存储有问题或Secondary Storage VM 有问题了。
选择“控制板”->系统容量,检查二级存储容量是否正确。
检查系统VM中的Secondary Storage VM是否正常启动。
https://my.oschina.net/qinerg/blog/145013
若因为外界因素,cloudstack环境崩溃,所有的虚拟机都是stopped,应该先查看cloudstack-management /cloudstack-agent /nfs/ rpcbind等程序是否启动,NFS文件挂载是否存在,如果不在,请手动添加挂载。然后检测计算节点主机的运行状态是否up,主存储与二级存储是否正确,请注意libvirt的状态.
注意:二级存储为0 的主要原因就是secondstorage VM这台虚拟机创建失败,而虚拟机的创建又与libvirt息息相关。
模版iso的注册失败也可能和上述原因相似,可以手动摧毁Second StorageVM虚拟机,然后重新生成。
cloudstack-management 安装教程-总结相关推荐
- Zabbix的客户端安装教程
Zabbix的客户端安装教程 一.Zabbix客户端及其它相关介绍 二.Zabbix客户端安装步骤 三.测试安装结果 一.Zabbix客户端及其它相关介绍 1.zabbix是一个基于WEB界面的提供分 ...
- Mysql数据库的安装教程
Mysql数据库的安装教程 一.Mysql数据库介绍 二.Mysql数据库特性 1.Mysql现状 2.Mysql的几个特点 三.Mysql数据库中术语介绍 四.检查MySQL 是否安装 1.检测系统 ...
- cloudstack centOS安装(一)
近来采用 CentOS 6.3 作开发环境,参考CloudStack 的相关文档,一阵折腾,才把开发环境 建立起来,写下面的文字,只为记录,以备需要. 环境要求: 操作系统 centos 6.3 64 ...
- cloudstack centOS安装(二)
安装一之后,我又进行了以下的安装 安装 CloudStack软件包 在home 中放入 安装包 CloudStack-oss-3.0.2-1-rhel6.2.tar.gz tar -xvf Clou ...
- ssms安装_SQLServer 2019下载及安装教程
宸1分钟前 这可是我珍藏多年的资源啊. SQL Server 2019 SQL是英文Structured Query Language的缩写,意思为结构化查询语言.SQL语言的主要功能就是同各种数据库 ...
- redis和zookeeper安装教程并配置开机自启
redis和zookeeper安装教程并配置开机自启 redis安装并且配置开机自启 1.windows环境下的redis需要去github上获取: https://github.com/Micros ...
- SQL Server2008下载链接以及安装教程
1. SQLEXPR_x64_CHS.exe,标准SQL Server Express edition,只有数据库引擎,甚至连图形管理界面都没有. 2.SQLEXPRWT_x64_CHS.exe,多了 ...
- Keil 4 安装教程及简单使用【嵌入式系统】
Keil 4 安装教程及简单使用[嵌入式系统] 前言 推荐 说明 Keil 4 for Arm安装教程 1.安装MDK 2.激活mdk keil 4 for arm 的简单使用 1建立新工程 2在工程 ...
- SQL Server 下载安装教程
--------------------------2021.3.9更新---------------------------------------- 有几位读者私聊我遇到了如下问题 针对如上问题& ...
- SQL Server 2008R2(SQL Server)数据库的安装教程,这里提供SQL Sewrver 安装包)
SQL Server 2008R2(SQL Server)数据库的安装教程,这里提供SQL Sewrver 安装包) 阿源是个女程序员哦 如何安装SQL Server2008R2数据库呢?其实我刚开始 ...
最新文章
- 技术 | 苹果最新博文剑指汉字手写识别!专家回应:并没有技术含量
- 数据中毒防不胜防,别让你的机器学习模型“学坏”
- OSChina 周一乱弹 —— 还一星期就要和女神约会了
- C语言的一些有趣的冷知识
- CSS选择器笔记,element element和element element 的区别
- angular 路由页面不刷新
- bzoj 4487: [Jsoi2015]染色问题
- @Resource,@Autowired,@Inject3种注入方式详解
- 程序员 sql面试_非程序员SQL使用指南
- PowerShell遍历文件夹下的子文件夹和文件
- C++模版 (一) ----- 函数模版
- 网站去色的通用方法(简单)
- Android 5.0+(RecycleView、CardView、Palette)
- Python程序-生成回文
- P1262 间谍网络
- 39.Linux清除用户登录记录和命令历史方法
- 七月算法机器学习 9 推荐系统与应用
- Python大数据分析(一):认识大数据
- 基于Vue+nodejs+Web的网上书城系统
- Adobe Photoshop CC 2019 精简版