Cloudstack 的搭建
Note: 关闭了NFS Storage 的防火墙 service iptables stop
1. 新创建的Linux没有获取IP;
vi /etc/sysconfig/network-script/ifcfg-eth0
修改 ONBOOT="yes"
增加 BOOTPROTO="dhcp"
2. 通过命令 "hostname --fqdn"查看FQDN, 如果不能返回值,
vi /etc/hosts
增加 ip fqdn hostname
3. 查看selinux状态
/usr/sbin/sestatus -v 或 sestatus
得确定selinux状态为disable 或 permissive
Set the SELINUX variable in /etc/selinux/config to "permissive". This ensures that the
permissive setting will be maintained after a system reboot.
Then set SELinux to permissive starting immediately, without requiring a system reboot.
增加 setenforce 0
4. 配置本地yum源
加载光盘系统文件到本地 mount /dev/cdrom /media
Create a repo file at /etc/yum.repos.d/rhel6.repo. In the file, insert the following lines:
[rhel]
name=rhel6
baseurl=file:///media
enabled=1
gpgcheck=0
5. 安装ntp服务
yum install ntp
Edit the NTP configuration file to point to your NTP server.
# vi /etc/ntp.conf
Add one or more server lines in this file with the names of the NTP servers you want to use.
For example:
server 0.xenserver.pool.ntp.org
server 1.xenserver.pool.ntp.org
server 2.xenserver.pool.ntp.org
server 3.xenserver.pool.ntp.org
Restart the NTP client.
# service ntpd restart
Make sure NTP will start again upon reboot.
# chkconfig ntpd on
6. 安装ManagementServer
1. Download the CloudStack Management Server onto the host where it will run. Get the software
from the following link.
https://www.citrix.com/English/ss/downloads/.
2. Install the CloudStack packages. You should have a file in the form of "CloudStack-VERSION-NOSVERSION.
tar.gz". Untar the file and then run the install.sh script inside it. Replace the file and
directory names below with those you are using:
# tar xzf CloudStack-VERSION-N-OSVERSION.tar.gz
# cd CloudStack-VERSION-N-OSVERSION
# ./install.sh
You should see a few messages as the installer prepares, followed by a list of choices.
3. Choose M to install the Management Server software.
> M
4. When the installation is finished, run the following commands to start essential services:
# service rpcbind start
# service nfs start
# chkconfig nfs on
# chkconfig rpcbind on
7. Install and Configure the Database
1. If you already have a version of MySQL installed on the Management Server node, make one of
the following choices, depending on what version of MySQL it is. The most recent version tested is
5.1.58.
• If you already have installed MySQL version 5.1.58 or later, skip to step 4.
• If you have installed a version of MySQL earlier than 5.1.58, you can either skip to step 4 or
uninstall MySQL and proceed to step 2 to install a more recent version.
Warning
It is important that you choose the right database version. Never downgrade a MySQL
installation.
2. On the same computer where you installed the Management Server, re-run install.sh.
# ./install.sh
You should see a few messages as the installer prepares, followed by a list of choices.
3. Choose D to install the MySQL server from the distribution's repo.
> D
Troubleshooting: If you do not see the D option, you already have MySQL installed. Please go
back to step 1.
4. Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) and
insert the following lines in the [mysqld] section. You can put these lines below the datadir line.
The max_connections parameter should be set to 350 multiplied by the number of Management
Servers you are deploying. This example assumes one Management Server.
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
5. Restart the MySQL service, then invoke MySQL as the root user.
# service mysqld restart
# mysql -u root
6. Best Practice: MySQL does not set a root password by default. It is very strongly recommended
that you set a root password as a security precaution. Run the following commands, and
substitute your own desired root password.
mysql> SET PASSWORD = PASSWORD('password');
From now on, start MySQL with mysql -p so it will prompt you for the password.
7. To grant access privileges to remote users, perform the following steps.
a. Run the following commands from the mysql prompt:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
mysql> exit
b. Restart the MySQL service.
# service mysqld restart
c. Open the MySQL server port (3306) in the firewall to allow remote clients to connect.
# iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
d. Edit the /etc/sysconfig/iptables file and add the following line at the beginning of the INPUT
chain.
-A INPUT -p tcp --dport 3306 -j ACCEPT
8. Set up the database. The following command creates the cloud user on the database.
• In dbpassword, specify the password to be assigned to the cloud user. You can choose to
provide no password.
• In deploy-as, specify the username and password of the user deploying the database. In the
following command, it is assumed the root user is deploying the database and creating the
cloud user.
• (Optional) For encryption_type, use file or web to indicate the technique used to pass in the
database encryption password. Default: file. See About Password and Key Encryption.
• (Optional) For management_server_key, substitute the default key that is used to encrypt
confidential parameters in the CloudPlatform properties file. Default: password. It is highly
recommended that you replace this with a more secure value. See About Password and Key
Encryption.
• (Optional) For database_key, substitute the default key that is used to encrypt confidential
parameters in the CloudPlatform database. Default: password. It is highly recommended that
you replace this with a more secure value. See About Password and Key Encryption.
# cloudstack-setup-databases cloud:<dbpassword>@localhost --deploy-as=root:<password> -e
<encryption_type> -m <management_server_key> -k <database_key>
9. Now that the database is set up, you can finish configuring the OS for the Management Server.
This command will set up iptables, sudoers, and start the Management Server.
# cloudstack-setup-management
7. Deploy a Separate NFS Server (最简单的方法,不要设置防火墙的相关信息,直接关闭防火墙 service iptables stop)
1. On the storage server, create an NFS share for secondary storage and, if you are using NFS for
primary storage as well, create a second NFS share. For example:
# mkdir -p /export/primary
# mkdir -p /export/secondary
2. To configure the new directories as NFS exports, edit /etc/exports. Export the NFS share(s) with
rw,async,no_root_squash. For example:
# vi /etc/exports
Insert the following line.
/export *(rw,async,no_root_squash)
3. Export the /export directory.
# exportfs -a
4. On the management server, create a mount point for secondary storage. For example:
# mkdir -p /mnt/secondary
5. Mount the secondary storage on your Management Server. Replace the example NFS server
name and NFS share paths below with your own.
# mount -t nfs nfsservername:/nfs/share/secondary /mnt/secondary
Edit the /etc/sysconfig/nfs file.
# vi /etc/sysconfig/nfs
Uncomment the following lines:
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
Edit the /etc/sysconfig/iptables file.
# vi /etc/sysconfig/iptables
Add the following lines at the beginning of the INPUT chain:
-A INPUT -m state --state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -p udp --dport 662 -j ACCEPT
Run the following commands:
# service iptables restart
# service iptables save
9. Prepare the System VM Template
1. On the Management Server, run one or more of the following cloud-install-sys-tmplt commands
to retrieve and decompress the system VM template. Run the command for each hypervisor type
that you expect end users to run in this Zone.
If your secondary storage mount point is not named /mnt/secondary, substitute your own mount
point name.
If you set the CloudPlatform database encryption type to "web" when you set up the database, you
must now add the parameter -s <management-server-secret-key>. See About Password and Key
Encryption.
This process will require approximately 5 GB of free space on the local file system and up to 30
minutes each time it runs.
• For XenServer:
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /
mnt/secondary -u http://download.cloud.com/templates/4.2/systemvmtemplate-2013-07-12-
master-xen.vhd.bz2 -h xenserver -s <optional-management-server-secret-key> -F
• For vSphere:
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /
mnt/secondary -u http://download.cloud.com/templates/4.2/systemvmtemplate-4.2-vh7.ova -
h vmware -s <optional-management-server-secret-key> -F
• For KVM:
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /
mnt/secondary -u http://download.cloud.com/templates/4.2/systemvmtemplate-2013-06-12-
master-kvm.qcow2.bz2 -h kvm -s <optional-management-server-secret-key> -F
2. If you are using a separate NFS server, perform this step. If you are using the Management
Server as the NFS server, you MUST NOT perform this step.
Chapter 5. Installation
62
When the script has finished, unmount secondary storage and remove the created directory.
# umount /mnt/secondary
# rmdir /mnt/secondary
3. Repeat these steps for each secondary storage server.
Cloudstack 的搭建的更多相关文章
- 搭建自己的XenServer+CloudStack云平台,提供IaaS服务(一)环境搭建
目标 搭建一个完整的基于XenServer和CloudStack的虚拟化平台,提供IaaS服务. 搭建三台安装了XenServer的服务器 搭建一台安装了CloudStack的服务器用以管理云平台 搭 ...
- CloudStack+KVM环境搭建(步骤很详细,说明ClockStack是用来管理虚拟机的)
文章目录环境准备配置本地域名解析关闭selinux安装ntp服务安装管理端安装Mysql数据库安装服务端RPM:初始化CloudStack数据库:初始化cloudstack管理服务器安装系统虚拟机安装 ...
- CloudStack搭建KVM环境
软件环境:agent:CentOS 6.3,minimal安装,CPU启用VT management server:CentOS 6.3,minimal安装 存储:CentOS 6.3 搭建在mana ...
- 为cloudstack搭建ceph文件系统
1. 安装dell服务器, raid卡需要采用直通模式(non-raid); 各磁盘独立运行. 网络依赖硬件不同,使用万兆网卡或者两个千兆网卡做bonding6. 2. 配置host map(1 ...
- 【恒天云】OpenStack和CloudStack对比研究报告
摘自恒天云:http://www.hengtianyun.com/download-show-id-8.html 1. 概述 常见的IaaS开源平台有OpenStack.CloudStack.Euca ...
- CloudStack 云计算平台框架
前言 CloudStack 和OpenStack 一样都是IaaS层 开源框架,可以管理XenServer.ESXI.KVM.OVM等主流虚拟机,相对OpenStack比较简单.稳定: 二.Cloud ...
- CloudStack学习-1
环境准备 实验使用的虚拟机配置 Vmware Workstation 虚拟机系统2个 系统版本:centos6.6 x86_64 内存:4GB 网络:两台机器都是nat 磁盘:装完系统后额外添加个50 ...
- CloudStack学习-3
此次试验主要是CloudStack结合openvswitch 背景介绍 之所以引入openswitch,是因为如果按照之前的方式,一个网桥占用一个vlan,假如一个zone有20个vlan,那么岂不是 ...
- Cloudstack安装(二)
Cloudstack安装 官方文档参考: http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/4.9/qig.h ...
随机推荐
- Android放大镜效果的简单实现
package com.example.myapi.pictobig; import com.example.myapi.R; import android.content.Context; impo ...
- 蓝桥杯之大臣的旅费(两次dfs)
Description 很久以前,T王国空前繁荣.为了更好地管理国家,王国修建了大量的快速路,用于连接首都和王国内的各大城市. 为节省经费,T国的大臣们经过思考,制定了一套优秀的修建方案,使得任何一个 ...
- 学习ASP.NET Core,你必须了解无处不在的“依赖注入”(转载)
ASP.NET Core的核心是通过一个Server和若干注册的Middleware构成的管道,不论是管道自身的构建,还是Server和Middleware自身的实现,以及构建在这个管道的应用,都需要 ...
- Eclipse安装Git插件(在线和离线)
在线安装: help-->install new software-->add location就是安装的地址:http://download.eclipse.org/egit/updat ...
- OO——电梯作业总结
目录 电梯作业总结 程序结构与复杂度的分析 第一次作业 第二次作业 第三次作业 程序BUG的分析 互测 自动评测 有效性 总结 电梯作业总结 程序结构与复杂度的分析 第一次作业 1.设计思路 第一次作 ...
- JavaEE笔记(十三)
#单一职责原则 一个类只做一件事 #开闭原则 拓展开,修改源码闭 #动态代理 1 基于接口的方式 jdk的动动代理2 基于类的方式 cglib的代理 #SSH整合 1.spring(容器) 1& ...
- mount状态下表空间情报试验
SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> sta ...
- 蓝牙重启case之:hardware error
蓝牙的通信分为host和controller,host端发送数据和命令到controller,controller 上传event以及数据到host端,这要求上下两端的通信要求状态一致性. 当发生状态 ...
- CS190.1x Scalable Machine Learning
这门课是CS100.1x的后续课,看课程名字就知道这门课主要讲机器学习.难度也会比上一门课大一点.如果你对这门课感兴趣,可以看看我这篇博客,如果对PySpark感兴趣,可以看我分析作业的博客. Cou ...
- vue中v-if 和 v-show的区别
简单来说,v-if 的初始化较快,但切换代价高:v-show 初始化慢,但切换成本低 1.共同点 v-if 和 v-show 都可以动态地显示DOM元素 2.区别 (1)手段: v-if 是动态的向D ...