CloudStack 4.4+KVM之管理服务器安装

本文涉及的产品
RDS MySQL DuckDB 分析主实例,集群系列 4核8GB
RDS AI 助手,专业版
RDS MySQL DuckDB 分析主实例,基础系列 4核8GB
简介:

说明:由于cloudstack初次接触,先用NFS搭建cloudstack主辅助存储,可随着了解的深入的,主存储可以采用集群文件系统进行配置。本系统文章仅说明Cloudstack管理KVM虚拟化平台,对其它服务器虚拟化不做示例说明,如对KVM虚拟化不太了解,可以参考本博客KVM虚拟化学习笔记进行了解,Cloudstack系统文章也是对KVM虚拟化的技术的延伸。  

2014.12.31更新:Cloudstack4.4.2+KVM 详细安装手册 下载地址

http://koumm.blog.51cto.com/703525/1597968

 

操作系统采用CentOS6.5 x64, 安装时选择图形界面,开发包及开发工具等。本文出自:http://koumm.blog.51cto.com/  

本系统文章列表

CloudStack 4.4+KVM之管理服务器安装   
http://koumm.blog.51cto.com/703525/1558660
CloudStack 4.4+KVM之KVM计算节点安装
http://koumm.blog.51cto.com/703525/1558670
CloudStack 4.4+KVM之配置CloudStack过程
http://koumm.blog.51cto.com/703525/1558683

CloudStack 4.4+KVM之通过ISO文件创建CentOS虚拟机
http://koumm.blog.51cto.com/703525/1564958 

CloudStack 4.4+KVM之虚拟机模板创建
http://koumm.blog.51cto.com/703525/1565551
CloudStack 4.4+KVM之虚拟机在线动态迁移
http://koumm.blog.51cto.com/703525/1565556

一、cloudstack管理服务器网络准备

1. 主机规划

nfs            192.168.10.180  (secondary)    
cloudstack     192.168.10.185  (primary)    
node01         192.168.10.190    
node02         192.168.10.191

 

2. 修改主机名

在hosts中增加   

1
2
3
4
# vi /etc/hosts 
192.168.10.185 cloudstack cloudstack.abc.com 
# vi /etc/sysconfig/network 
HOSTNAME=cloudstack.abc.com

 

3. 关闭SELINUX设置

1
2
# vi /etc/selinux/config 
SELINUX=disabled

需要重启生效,直接生效配置。

1
2
3
# setenforce 0 
# getenforce 
disabled

 

4. 关闭防火墙

1
2
service iptables stop 
chkconfig iptables off

 

5. 配置NTP时间服务同步互联网时间服务器

1
2
# crontab -e 
01 * /3  * * *  /usr/sbin/ntpdate  ntp.fudan.edu.cn

 

6. 配置系统YUM源

1)配置163 CentOS系统安装源

1
2
3
# cd /etc/yum.repos.d/ 
# mv *.repo ../ 
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

 

2)添加cloudstack软件包的官方源(可选方式)

1
2
3
4
5
6
# vi /etc/yum.repos.d/cloudstack.repo
[cloudstack] 
name=cloudstack 
baseurl=http: //cloudstack .apt-get.eu /rhel/4 .4/ 
enabled=1 
gpgcheck=0

 

7. 安装Management Server

1
# yum -y install cloudstack-management

 

8. 安装mysql并配置数据库

1)安装mysql-server

1
# yum -y install mysql-server

 

2)修改mysql配置并加入以下几行

1
2
3
4
5
6
7
# vi /etc/my.cnf
datadir= /var/lib/mysql 
innodb_rollback_on_timeout=1 
innodb_lock_wait_timeout=600 
max_connections=350 
log-bin=mysql-bin 
binlog- format  'ROW'

 

3)重启mysql,并加入开机自启动

1
2
# service mysqld start 
# chkconfig mysqld on

 

4)执行mysql的安全配置,设置密码等过程,如需要简单可直接全选Y.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL 
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current 
password  for  the root user. If you've just installed MySQL, and 
you haven't  set  the root password yet, the password will be blank, 
so you should just press enter here. 
Enter current password  for  root (enter  for  none): 
OK, successfully used password, moving on... 
Setting the root password ensures that nobody can log into the MySQL 
root user without the proper authorisation. 
Set root password? [Y /n ] y 
New password: 
Re-enter new password: 
Password updated successfully! 
Reloading privilege tables.. 
... Success! 
By default, a MySQL installation has an anonymous user, allowing anyone 
to log into MySQL without having to have a user account created  for 
them. This is intended only  for  testing, and to  make  the installation 
go a bit smoother. You should remove them before moving into a 
production environment. 
Remove anonymous  users ? [Y /n ] y 
... Success! 
Normally, root should only be allowed to connect from  'localhost' . This 
ensures that someone cannot guess at the root password from the network. 
Disallow root login remotely? [Y /n ] n 
... skipping. 
By default, MySQL comes with a database named  'test'  that anyone can 
access. This is also intended only  for  testing, and should be removed 
before moving into a production environment. 
Remove  test  database and access to it? [Y /n ] y 
- Dropping  test  database... 
... Success! 
- Removing privileges on  test  database... 
... Success! 
Reloading the privilege tables will ensure that all changes made so far 
will take effect immediately. 
Reload privilege tables now? [Y /n ] y 
... Success! 
Cleaning up... 
All  done ! If you've completed all of the above steps, your MySQL 
installation should now be secure. 
Thanks  for  using MySQL! 
#

5)安装cloudstack数据库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# cloudstack-setup-databases cloud:cloud@localhost --deploy-as=root:111111
Mysql user name:cloud [ OK ] 
Mysql user password:****** [ OK ] 
Mysql server ip:localhost [ OK ] 
Mysql server port:3306 [ OK ] 
Mysql root user name:root [ OK ] 
Mysql root user password:****** [ OK ] 
Checking Cloud database files ... [ OK ] 
Checking  local  machine  hostname  ... [ OK ] 
Checking SELinux setup ... [ OK ] 
Detected  local  IP address as 192.168.10.185, will use as cluster management server node IP[ OK ] 
Preparing  /etc/cloudstack/management/db .properties [ OK ] 
Applying  /usr/share/cloudstack-management/setup/create-database .sql [ OK ] 
Applying  /usr/share/cloudstack-management/setup/create-schema .sql [ OK ] 
Applying  /usr/share/cloudstack-management/setup/create-database-premium .sql [ OK ] 
Applying  /usr/share/cloudstack-management/setup/create-schema-premium .sql [ OK ] 
Applying  /usr/share/cloudstack-management/setup/server-setup .sql [ OK ] 
Applying  /usr/share/cloudstack-management/setup/templates .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_db .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_schema .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_multipart .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_index .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_multipart_alter .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_bucketpolicy .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_policy_alter .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_offering .sql [ OK ] 
Applying  /usr/share/cloudstack-bridge/setup/cloudbridge_offering_alter .sql [ OK ] 
Processing encryption ... [ OK ] 
Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration  in  /etc/cloudstack/management/db .properties
#

9. 初始化cloudstack管理节点

1
2
3
4
5
6
# cloudstack-setup-management
Starting to configure CloudStack Management Server: 
Configure sudoers ... [OK] 
Configure Firewall ... [OK] 
Configure CloudStack Management Server ...[OK] 
CloudStack Management Server setup is Done!

 

10. 启动cloudstack-management

1
# service cloudstack-management start

 

11. 配置NFS存储,该内容可以独立配置。

配置说明: 安装是主存储采用NFS进行测试,NFS可以由其它服务器单独提供,这里供测试,根据如下要求,在另一服务器及管理机上配置NFS服务。

NFS(辅助存储): 192.168.10.180   
NFS(主存储)   : 192.168.10.185

1)配置域名(主要配合NFS配置使用)

1
2
# vi /etc/idmapd.conf 
Domain = abc.com

2) 准备NFS目录

1
# mkdir -p /data/{primary,secondary}

3) 修改nfs服务参数

1
2
3
4
5
6
7
8
# vi /etc/sysconfig/nfs
LOCKD_TCPPORT=32803 
LOCKD_UDPPORT=32769 
RQUOTAD_PORT=875 
MOUNTD_PORT=892 
STATD_PORT=662 
STATD_OUTGOING_PORT=2020 
RPCNFSDARGS= "-N 4"

 

4)配置文件

1
2
3
# vi /etc/exports 
/data/primary  *(rw,fsid=1,async,no_root_squash,no_subtree_check) 
/data/secondary  *(rw,fsid=1,async,no_root_squash,no_subtree_check)

 

5) 配置nfs服务启动

1
2
3
4
5
service rpcbind start 
service nfs start 
chkconfig rpcbind on 
chkconfig nfs on 
showmount -e 127.0.0.1

 

6) 挂载测试,测试完毕后卸载掉,不需要手动挂载.

1
2
3
4
5
6
7
8
9
10
mount  -t nfs 192.168.10.185: /data/primary  /mnt/1/ 
mount  -t nfs 192.168.10.180: /data/secondary  /mnt/2/
# df -h 
Filesystem Size Used Avail Use% Mounted on 
/dev/mapper/vg_cloudstack-lv_root  36G 5.1G 29G 16% / 
tmpfs 1.9G 68K 1.9G 1%  /dev/shm 
/dev/sda1  485M 39M 421M 9%  /boot 
192.168.10.185: /data/primary  36G 5.1G 29G 16%  /mnt/1 
192.168.10.180: /data/secondary  36G 6.1G 28G 19%  /mnt/2 
[root@cloudstack mnt] #

 注:CentOS6.5 NFS在配置的时出现过疑似BUG,同一服务器上两个输出目录,客户端挂载时挂载的是同一个目录,非两个不同目录,在如下/var/log/message日志中有证明。这就是我搞两个NFS服务器的原因。

Sep 19 15:05:59 cloudstack rpc.mountd[13097]: /data/primary and /data/secondary have same filehandle for *, using first

12. 导入系统虚拟机模板

说明: 系统虚拟机模板按要求要存放在辅助存储上的,我们可以先手动挂载nfs辅助存储, 然后把290M KVM虚拟化模板先下载到辅助存储目录下,然后在导入, 导入系统虚拟机模板步是必须要配置的内容。本例采用KVM虚拟化,下载导入KVM虚拟机模板。

1
2
3
4
5
6
7
8
# mount -t nfs 192.168.10.180:/data/secondary /mnt/2/ 
# cd /mnt/2/ 
# wget http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.0-6-kvm.qcow2.bz2 
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/2/ -f systemvm64template-4.4.0-6-kvm.qcow2.bz2 -h kvm -F
Uncompressing to  /usr/share/cloudstack-common/scripts/storage/secondary/e5a0ec24-0ae5-4740-8f54-94e08898a3c4 .qcow2.tmp ( type  bz2)...could take a long  time 
Moving to  /data/secondary/template/tmpl/1/3///e5a0ec24-0ae5-4740-8f54-94e08898a3c4 .qcow2...could take a  while 
Successfully installed system VM template systemvm64template-4.4.0-6-kvm.qcow2.bz2 to  /data/secondary/template/tmpl/1/3/ 
#

cloudstack4.4.x系统虚拟机默认用户名密码:root/password      2014.12.31更正

 

13. 安装完成, 访问http://192.168.10.185:8080/client

clip_image002    
默认用户名和密码为admin, password

跳过此指南。

clip_image002[13]

image

安装完毕。




本文转自 koumm 51CTO博客,原文链接:http://blog.51cto.com/koumm/1558660,如需转载请自行联系原作者

相关文章
|
7月前
|
Ubuntu Linux 网络安全
Linux服务器之Ubuntu的安装与配置
Ubuntu Desktop是目前最成功、最流行的图形界面的Linux发行版;而Ubuntu Server也在服务器端市场占据了较大的份额。今天为大家详细介绍了Ubuntu Server的安装与配置,希望对你能有所帮助。关于VMware、VirtualBox等虚拟化软件的使用,朱哥还会在后续的文章中为大家详细介绍,敬请关注!
|
5月前
|
Shell Linux 网络安全
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
964 3
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
|
11月前
|
安全 Ubuntu 网络安全
本地服务器 Odoo 安装指南,并实现公网访问
本指南详细介绍基于 Odoo 的企业应用部署流程。首先通过 VMware 安装虚拟机并配置 Ubuntu 系统,为运行环境打下基础;接着利用 Websoft9 平台简化中间件与 Odoo 服务的安装,实现快速部署与版本管理;然后借助 cpolar 实现内网穿透并完成域名解析,确保公网访问畅通;最后进行功能测试与性能优化,提供运维建议以保障系统稳定性和安全性。适合初学者及中小型企业参考实施。
1155 4
|
6月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
401 18
|
6月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
453 15
|
6月前
|
弹性计算 安全 Linux
使用阿里云服务器安装Z-Blog博客网站流程,新手一键部署教程
本教程教你如何在阿里云99元服务器上,通过宝塔Linux面板一键部署Z-Blog博客。基于CentOS 7.9系统,从远程连接、安装宝塔面板、开放端口到部署Z-Blog全流程详解,操作简单,新手也能轻松搭建个人博客网站。
703 13
|
7月前
|
弹性计算 安全 Linux
阿里云服务器ECS安装宝塔Linux面板、安装网站(新手图文教程)
本教程详解如何在阿里云服务器上安装宝塔Linux面板,涵盖ECS服务器手动安装步骤,包括系统准备、远程连接、安装命令执行、端口开放及LNMP环境部署,手把手引导用户快速搭建网站环境。
|
7月前
|
Ubuntu Linux
如何在 Ubuntu 服务器上安装桌面环境(GUI)
如果你有任何问题,请在评论区留言。你会在服务器上使用 GUI 吗?参照本文后你遇到了什么问题吗?
1364 0
|
8月前
|
Windows
Windows下版本控制器(SVN)-验证是否安装成功+配置版本库+启动服务器端程序
Windows下版本控制器(SVN)-验证是否安装成功+配置版本库+启动服务器端程序
240 2
|
8月前
|
存储 Ubuntu 安全
如何在服务器上快速安装 ERPNext 最新版本?
ERPNext 是一款开源且功能全面的企业资源规划软件,在企业信息化管理中广泛应用。本文介绍如何通过 Websoft9 控制台安装其最新版本,以提升部署效率。内容涵盖安装前的服务器准备、Websoft9 控制台登录,到通过应用市场安装 ERPNext 的详细步骤,以及安装后的验证与基础配置。帮助企业快速搭建稳定高效的信息化管理平台,满足财务、采购、销售、库存等多方面业务需求,助力企业降本增效,实现可持续发展。