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 的搭建的更多相关文章

  1. 搭建自己的XenServer+CloudStack云平台,提供IaaS服务(一)环境搭建

    目标 搭建一个完整的基于XenServer和CloudStack的虚拟化平台,提供IaaS服务. 搭建三台安装了XenServer的服务器 搭建一台安装了CloudStack的服务器用以管理云平台 搭 ...

  2. CloudStack+KVM环境搭建(步骤很详细,说明ClockStack是用来管理虚拟机的)

    文章目录环境准备配置本地域名解析关闭selinux安装ntp服务安装管理端安装Mysql数据库安装服务端RPM:初始化CloudStack数据库:初始化cloudstack管理服务器安装系统虚拟机安装 ...

  3. CloudStack搭建KVM环境

    软件环境:agent:CentOS 6.3,minimal安装,CPU启用VT management server:CentOS 6.3,minimal安装 存储:CentOS 6.3 搭建在mana ...

  4. 为cloudstack搭建ceph文件系统

    1. 安装dell服务器,  raid卡需要采用直通模式(non-raid); 各磁盘独立运行.  网络依赖硬件不同,使用万兆网卡或者两个千兆网卡做bonding6.  2. 配置host map(1 ...

  5. 【恒天云】OpenStack和CloudStack对比研究报告

    摘自恒天云:http://www.hengtianyun.com/download-show-id-8.html 1. 概述 常见的IaaS开源平台有OpenStack.CloudStack.Euca ...

  6. CloudStack 云计算平台框架

    前言 CloudStack 和OpenStack 一样都是IaaS层 开源框架,可以管理XenServer.ESXI.KVM.OVM等主流虚拟机,相对OpenStack比较简单.稳定: 二.Cloud ...

  7. CloudStack学习-1

    环境准备 实验使用的虚拟机配置 Vmware Workstation 虚拟机系统2个 系统版本:centos6.6 x86_64 内存:4GB 网络:两台机器都是nat 磁盘:装完系统后额外添加个50 ...

  8. CloudStack学习-3

    此次试验主要是CloudStack结合openvswitch 背景介绍 之所以引入openswitch,是因为如果按照之前的方式,一个网桥占用一个vlan,假如一个zone有20个vlan,那么岂不是 ...

  9. Cloudstack安装(二)

    Cloudstack安装 官方文档参考: http://docs.cloudstack.apache.org/projects/cloudstack-installation/en/4.9/qig.h ...

随机推荐

  1. php 微信公众号接入支付宝支付

    真是无力吐槽这个需求了,好端端的非要在微信公众号接入支付宝,都知道微信公众号是拒绝支付宝的,屏蔽了支付宝,所以在微信公众号接入支付宝的话就必须手动复制链接跳出微信内置浏览器,强制性打开web浏览器完成 ...

  2. docker devicemapper 问题

    DOCKER_OPTS= "--storage-driver=devicemapper  --storage-opt  dm.basesize=50G --storage-opt dm.da ...

  3. WorldWind源码剖析系列:表面瓦片类SurfaceTile

    表面瓦片类SurfaceTile描述星球类(如地球)表面纹理影像的瓦片模型.其类图如下. 表面瓦片类SurfaceTile包含的主要的字段.属性和方法如下: int m_Level;//该瓦片所属金字 ...

  4. STlinkSWD模式连线方式

    若使用SWD模式,则只需要连接4根线,7,9,20,1即SWDIO,SWDCLK,GND,VCC.VCC为3.3V

  5. A - Zebras

    Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Ol ...

  6. 通过cgroup给docker的CPU和内存资源做限制

    1.cpu docker run -it --cpu-period=100000 --cpu-quota=2000 ubuntu /bin/bash 相当于只能使用20%的CPU 在每个100ms的时 ...

  7. [Lydsy1805月赛]quailty 算法 BZOJ5362

    分析: 题目中描述了一个二分图,让我们求最小权最大匹配,实际上其实是求n个点,在n*(n-1)/2中选n条边的权值和最小,形成一个每个点都有出边的体系,也就是基环树,(证明:因为我们需要二分图最大匹配 ...

  8. 关于EL表达式中requestScope和param区别

    今天演示EL表达式的时候发现自己jsp的基础实在是薄弱,在这个很简单的问题上迷惑了很久. 首先在看遇到的问题: 在浏览器地址输入,表示传入一个参数test,值为123 http://localhost ...

  9. WPF编程,将控件所呈现的内容保存成图像的一种方法。

    原文:WPF编程,将控件所呈现的内容保存成图像的一种方法. 版权声明:我不生产代码,我只是代码的搬运工. https://blog.csdn.net/qq_43307934/article/detai ...

  10. lnmp如何实现伪静态,默认目录伪静态

    LNMP一键安装包一直是我小内存VPS的首选安装环境,因为它占用资源少,性能高.最新发布的lnmp0.7还增加了对LNMPA的支持,LNMPA使用Nginx作为前端服务能够更快更及时的静态页面.js. ...