阅读背景:

cloudstack安装部署与常见问题解决

来源:互联网 

CloudStack的安装<注意:在装系统Centos6.3的时候一定要选择最小化安装>

0.      设置安全项Selinux

[root@cloudstack yum.repos.d]# vi /etc/sysconfig/selinux

 

 

# 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=permissive

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

 

重启服务器

 

1.      制作yum安装镜像

[root@cloudstackms yum.repos.d]# pwd

/etc/yum.repos.d

[root@cloudstackms yum.repos.d]# vi cloudstack.repo

[cloudstack]

name=cloudstack

baseurl=https://cloudstack.apt-get.eu/rhel/4.0/

enabled=1

gpgcheck=0

2.      管理服务器的安装Management Server,我们的安装情况是管理服务器和mysql安装在同一台机子上面,且只安装一个管理服务节点。

2.1    安装之前的准备

1.       以root用户登录

2.       检查一个合格的主机名

Hostname –fqdn

应该是形如:management.lab.example.org形式的,如果不是请修改/etc/hosts文件,我的修改完之后的hostname为:cloudstackms.houqd.pub

3.       确保机器可以连上Internet,ping www.cloudstack.org

4.       安装时间同步的NTP服务器

Yum install ntp

 

 

2.2    安装Management Server

1.       Yum install cloud-client,回自动安装相应的依赖包

[root@coms-cluster etc]# yum install cloud-client

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package cloud-client.x86_64 0:4.0.2-1.el6 will be installed

--> Processing Dependency: cloud-client-ui = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-server = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-utils = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-python = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-setup = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-deps = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-aws-api = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: cloud-scripts = 4.0.2 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: java >= 1.6.0 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: jpackage-utils for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: tomcat6 for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: python-paramiko for package: cloud-client-4.0.2-1.el6.x86_64

--> Processing Dependency: ws-commons-util for package: cloud-client-4.0.2-1.el6.x86_64

--> Running transaction check

---> Package cloud-aws-api.x86_64 0:4.0.2-1.el6 will be installed

--> Processing Dependency: jakarta-commons-lang for package: cloud-aws-api-4.0.2-1.el6.x86_64

---> Package cloud-client-ui.x86_64 0:4.0.2-1.el6 will be installed

---> Package cloud-deps.x86_64 0:4.0.2-1.el6 will be installed

--> Processing Dependency: mysql-connector-java for package: cloud-deps-4.0.2-1.el6.x86_64

---> Package cloud-python.x86_64 0:4.0.2-1.el6 will be installed

---> Package cloud-scripts.x86_64 0:4.0.2-1.el6 will be installed

---> Package cloud-server.x86_64 0:4.0.2-1.el6 will be installed

--> Processing Dependency: cloud-core = 4.0.2 for package: cloud-server-4.0.2-1.el6.x86_64

--> Processing Dependency: tomcat6-servlet-2.5-api for package: cloud-server-4.0.2-1.el6.x86_64

---> Package cloud-setup.x86_64 0:4.0.2-1.el6 will be installed

---> Package cloud-utils.x86_64 0:4.0.2-1.el6 will be installed

---> Package java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.45.1.11.1.el6 will be installed

--> Processing Dependency: tzdata-java for package: 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64

--> Processing Dependency: rhino for package: 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64

---> Package jpackage-utils.noarch 0:1.7.5-3.12.el6 will be installed

---> Package python-paramiko.noarch 0:1.7.5-2.1.el6 will be installed

--> Processing Dependency: python-crypto >= 1.9 for package: python-paramiko-1.7.5-2.1.el6.noarch

---> Package tomcat6.noarch 0:6.0.24-45.el6 will be installed

cloudstack/filelists                                     |  17 kB     00:00    

--> Processing Dependency: tomcat6-lib = 6.0.24-45.el6 for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: mx4j for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: log4j for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: log4j for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: jakarta-commons-pool for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: jakarta-commons-logging for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: jakarta-commons-dbcp for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: jakarta-commons-daemon for package: tomcat6-6.0.24-45.el6.noarch

--> Processing Dependency: jakarta-commons-collections for package: tomcat6-6.0.24-45.el6.noarch

---> Package ws-commons-util.noarch 0:1.0.1-13.el6 will be installed

--> Running transaction check

---> Package cloud-core.x86_64 0:4.0.2-1.el6 will be installed

---> Package jakarta-commons-collections.noarch 0:3.2.1-3.4.el6 will be installed

---> Package jakarta-commons-daemon.x86_64 1:1.0.1-8.9.el6 will be installed

--> Processing Dependency: java-gcj-compat for package: 1:jakarta-commons-daemon-1.0.1-8.9.el6.x86_64

--> Processing Dependency: java-gcj-compat for package: 1:jakarta-commons-daemon-1.0.1-8.9.el6.x86_64

---> Package jakarta-commons-dbcp.noarch 0:1.2.1-13.8.el6 will be installed

---> Package jakarta-commons-lang.noarch 0:2.4-1.1.el6 will be installed

---> Package jakarta-commons-logging.noarch 0:1.0.4-10.el6 will be installed

---> Package jakarta-commons-pool.x86_64 0:1.3-12.7.el6 will be installed

---> Package log4j.x86_64 0:1.2.14-6.4.el6 will be installed

---> Package mx4j.noarch 1:3.0.1-9.13.el6 will be installed

--> Processing Dependency: javamail >= 1.2-5jpp for package: 1:mx4j-3.0.1-9.13.el6.noarch

--> Processing Dependency: bcel >= 5.0 for package: 1:mx4j-3.0.1-9.13.el6.noarch

--> Processing Dependency: axis >= 1.1 for package: 1:mx4j-3.0.1-9.13.el6.noarch

--> Processing Dependency: xml-commons-resolver for package: 1:mx4j-3.0.1-9.13.el6.noarch

--> Processing Dependency: xml-commons for package: 1:mx4j-3.0.1-9.13.el6.noarch

--> Processing Dependency: jaf for package: 1:mx4j-3.0.1-9.13.el6.noarch

---> Package mysql-connector-java.noarch 1:5.1.17-6.el6 will be installed

--> Processing Dependency: jta >= 1.0 for package: 1:mysql-connector-java-5.1.17-6.el6.noarch

--> Processing Dependency: slf4j for package: 1:mysql-connector-java-5.1.17-6.el6.noarch

---> Package python-crypto.x86_64 0:2.0.1-22.el6 will be installed

---> Package rhino.noarch 0:1.7-0.7.r2.2.el6 will be installed

--> Processing Dependency: jline for package: rhino-1.7-0.7.r2.2.el6.noarch

---> Package tomcat6-lib.noarch 0:6.0.24-45.el6 will be installed

--> Processing Dependency: tomcat6-jsp-2.1-api = 6.0.24-45.el6 for package: tomcat6-lib-6.0.24-45.el6.noarch

--> Processing Dependency: tomcat6-el-2.1-api = 6.0.24-45.el6 for package: tomcat6-lib-6.0.24-45.el6.noarch

--> Processing Dependency: ecj for package: tomcat6-lib-6.0.24-45.el6.noarch

---> Package tomcat6-servlet-2.5-api.noarch 0:6.0.24-45.el6 will be installed

---> Package tzdata-java.noarch 0:2012c-1.el6 will be installed

--> Running transaction check

---> Package axis.noarch 0:1.2.1-7.2.el6 will be installed

--> Processing Dependency: wsdl4j for package: axis-1.2.1-7.2.el6.noarch

--> Processing Dependency: jakarta-commons-httpclient for package: axis-1.2.1-7.2.el6.noarch

--> Processing Dependency: jakarta-commons-discovery for package: axis-1.2.1-7.2.el6.noarch

---> Package bcel.x86_64 0:5.2-7.2.el6 will be installed

--> Processing Dependency: regexp for package: bcel-5.2-7.2.el6.x86_64

---> Package classpathx-jaf.x86_64 0:1.0-15.4.el6 will be installed

---> Package classpathx-mail.noarch 0:1.1.1-9.4.el6 will be installed

---> Package ecj.x86_64 1:3.4.2-6.el6 will be installed

---> Package geronimo-specs-compat.noarch 0:1.0-3.4.M2.el6 will be installed

--> Processing Dependency: geronimo-specs = 1.0-3.4.M2.el6 for package: geronimo-specs-compat-1.0-3.4.M2.el6.noarch

---> Package java-1.5.0-gcj.x86_64 0:1.5.0.0-29.1.el6 will be installed

--> Processing Dependency: sinjdoc for package: java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64

---> Package jline.noarch 0:0.9.94-0.8.el6 will be installed

---> Package slf4j.noarch 0:1.5.8-7.el6 will be installed

---> Package tomcat6-el-2.1-api.noarch 0:6.0.24-45.el6 will be installed

---> Package tomcat6-jsp-2.1-api.noarch 0:6.0.24-45.el6 will be installed

---> Package xml-commons-apis.x86_64 0:1.3.04-3.6.el6 will be installed

---> Package xml-commons-resolver.x86_64 0:1.1-4.18.el6 will be installed

--> Running transaction check

---> Package geronimo-specs.noarch 0:1.0-3.4.M2.el6 will be installed

--> Processing Dependency: apache-tomcat-apis for package: geronimo-specs-1.0-3.4.M2.el6.noarch

---> Package jakarta-commons-discovery.noarch 1:0.4-5.4.el6 will be installed

---> Package jakarta-commons-httpclient.x86_64 1:3.1-0.6.el6 will be installed

---> Package regexp.x86_64 0:1.5-4.4.el6 will be installed

---> Package sinjdoc.x86_64 0:0.5-9.1.el6 will be installed

--> Processing Dependency: java_cup >= 0.10 for package: sinjdoc-0.5-9.1.el6.x86_64

---> Package wsdl4j.noarch 0:1.5.2-7.8.el6 will be installed

--> Running transaction check

---> Package apache-tomcat-apis.noarch 0:0.1-1.el6 will be installed

---> Package java_cup.x86_64 1:0.10k-5.el6 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================

 Package                     Arch   Version                    Repository  Size

================================================================================

Installing:

 cloud-client                x86_64 4.0.2-1.el6                cloudstack 3.2 M

Installing for dependencies:

 apache-tomcat-apis          noarch 0.1-1.el6                  Rocks-6.0  164 k

 axis                        noarch 1.2.1-7.2.el6              Rocks-6.0  1.5 M

 bcel                        x86_64 5.2-7.2.el6                Rocks-6.0  1.4 M

 classpathx-jaf              x86_64 1.0-15.4.el6               Rocks-6.0  100 k

 classpathx-mail             noarch 1.1.1-9.4.el6              Rocks-6.0  479 k

 cloud-aws-api               x86_64 4.0.2-1.el6                cloudstack  22 M

 cloud-client-ui             x86_64 4.0.2-1.el6                cloudstack 3.0 M

 cloud-core                  x86_64 4.0.2-1.el6                cloudstack 352 k

 cloud-deps                  x86_64 4.0.2-1.el6                cloudstack  30 M

 cloud-python                x86_64 4.0.2-1.el6                cloudstack  77 k

 cloud-scripts               x86_64 4.0.2-1.el6                cloudstack  17 M

 cloud-server                x86_64 4.0.2-1.el6                cloudstack 3.6 M

 cloud-setup                 x86_64 4.0.2-1.el6                cloudstack 158 k

 cloud-utils                 x86_64 4.0.2-1.el6                cloudstack 1.4 M

 ecj                         x86_64 1:3.4.2-6.el6              Rocks-6.0  2.8 M

 geronimo-specs              noarch 1.0-3.4.M2.el6             Rocks-6.0  110 k

 geronimo-specs-compat       noarch 1.0-3.4.M2.el6             Rocks-6.0  7.1 k

 jakarta-commons-collections noarch 3.2.1-3.4.el6              Rocks-6.0  523 k

 jakarta-commons-daemon      x86_64 1:1.0.1-8.9.el6            Rocks-6.0   45 k

 jakarta-commons-dbcp        noarch 1.2.1-13.8.el6             Rocks-6.0  116 k

 jakarta-commons-discovery   noarch 1:0.4-5.4.el6              Rocks-6.0   73 k

 jakarta-commons-httpclient  x86_64 1:3.1-0.6.el6              Rocks-6.0  580 k

 jakarta-commons-lang        noarch 2.4-1.1.el6                Rocks-6.0  252 k

 jakarta-commons-logging     noarch 1.0.4-10.el6               Rocks-6.0   52 k

 jakarta-commons-pool        x86_64 1.3-12.7.el6               Rocks-6.0  122 k

 java-1.5.0-gcj              x86_64 1.5.0.0-29.1.el6           Rocks-6.0  139 k

 java-1.6.0-openjdk          x86_64 1:1.6.0.0-1.45.1.11.1.el6  Rocks-6.0   25 M

 java_cup                    x86_64 1:0.10k-5.el6              Rocks-6.0  197 k

 jline                       noarch 0.9.94-0.8.el6             Rocks-6.0   86 k

 jpackage-utils              noarch 1.7.5-3.12.el6             Rocks-6.0   59 k

 log4j                       x86_64 1.2.14-6.4.el6             Rocks-6.0  679 k

 mx4j                        noarch 1:3.0.1-9.13.el6           Rocks-6.0  1.1 M

 mysql-connector-java        noarch 1:5.1.17-6.el6             Rocks-6.0  1.4 M

 python-crypto               x86_64 2.0.1-22.el6               Rocks-6.0  159 k

 python-paramiko             noarch 1.7.5-2.1.el6              Rocks-6.0  728 k

 regexp                      x86_64 1.5-4.4.el6                Rocks-6.0  105 k

 rhino                       noarch 1.7-0.7.r2.2.el6           Rocks-6.0  778 k

 sinjdoc                     x86_64 0.5-9.1.el6                Rocks-6.0  705 k

 slf4j                       noarch 1.5.8-7.el6                Rocks-6.0  132 k

 tomcat6                     noarch 6.0.24-45.el6              Rocks-6.0   87 k

 tomcat6-el-2.1-api          noarch 6.0.24-45.el6              Rocks-6.0   43 k

 tomcat6-jsp-2.1-api         noarch 6.0.24-45.el6              Rocks-6.0   80 k

 tomcat6-lib                 noarch 6.0.24-45.el6              Rocks-6.0  2.8 M

 tomcat6-servlet-2.5-api     noarch 6.0.24-45.el6              Rocks-6.0   94 k

 tzdata-java                 noarch 2012c-1.el6                Rocks-6.0  154 k

 ws-commons-util             noarch 1.0.1-13.el6               Rocks-6.0   37 k

 wsdl4j                      noarch 1.5.2-7.8.el6              Rocks-6.0  157 k

 xml-commons-apis            x86_64 1.3.04-3.6.el6             Rocks-6.0  439 k

 xml-commons-resolver        x86_64 1.1-4.18.el6               Rocks-6.0  145 k

 

Transaction Summary

================================================================================

Install      50 Package(s)

 

Total download size: 125 M

Installed size: 233 M

Downloading Packages:

(1/50): apache-tomcat-apis-0.1-1.el6.noarch.rpm          | 164 kB     00:00    

(2/50): axis-1.2.1-7.2.el6.noarch.rpm                    | 1.5 MB     00:00    

(3/50): bcel-5.2-7.2.el6.x86_64.rpm                      | 1.4 MB     00:00    

(4/50): classpathx-jaf-1.0-15.4.el6.x86_64.rpm           | 100 kB     00:00    

(5/50): classpathx-mail-1.1.1-9.4.el6.noarch.rpm         | 479 kB     00:00    

(6/50): cloud-aws-api-4.0.2-1.el6.x86_64.rpm             |  22 MB     01:16    

(7/50): cloud-client-4.0.2-1.el6.x86_64.rpm              | 3.2 MB     00:11    

(8/50): cloud-client-ui-4.0.2-1.el6.x86_64.rpm           | 3.0 MB     00:13    

(9/50): cloud-core-4.0.2-1.el6.x86_64.rpm                | 352 kB     00:01    

(10/50): cloud-deps-4.0.2-1.el6.x86_64.rpm               |  30 MB     02:01    

(11/50): cloud-python-4.0.2-1.el6.x86_64.rpm             |  77 kB     00:00    

(12/50): cloud-scripts-4.0.2-1.el6.x86_64.rpm            |  17 MB     01:14    

(13/50): cloud-server-4.0.2-1.el6.x86_64.rpm             | 3.6 MB     00:23    

(14/50): cloud-setup-4.0.2-1.el6.x86_64.rpm              | 158 kB     00:01    

(15/50): cloud-utils-4.0.2-1.el6.x86_64.rpm              | 1.4 MB     00:06    

(16/50): ecj-3.4.2-6.el6.x86_64.rpm                      | 2.8 MB     00:00    

(17/50): geronimo-specs-1.0-3.4.M2.el6.noarch.rpm        | 110 kB     00:00    

(18/50): geronimo-specs-compat-1.0-3.4.M2.el6.noarch.rpm | 7.1 kB     00:00    

(19/50): jakarta-commons-collections-3.2.1-3.4.el6.noarc | 523 kB     00:00    

(20/50): jakarta-commons-daemon-1.0.1-8.9.el6.x86_64.rpm |  45 kB     00:00    

(21/50): jakarta-commons-dbcp-1.2.1-13.8.el6.noarch.rpm  | 116 kB     00:00    

(22/50): jakarta-commons-discovery-0.4-5.4.el6.noarch.rp |  73 kB     00:00    

(23/50): jakarta-commons-httpclient-3.1-0.6.el6.x86_64.r | 580 kB     00:00    

(24/50): jakarta-commons-lang-2.4-1.1.el6.noarch.rpm     | 252 kB     00:00    

(25/50): jakarta-commons-logging-1.0.4-10.el6.noarch.rpm |  52 kB     00:00    

(26/50): jakarta-commons-pool-1.3-12.7.el6.x86_64.rpm    | 122 kB     00:00    

(27/50): java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64.rpm      | 139 kB     00:00    

(28/50): java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_ |  25 MB     00:00    

(29/50): java_cup-0.10k-5.el6.x86_64.rpm                 | 197 kB     00:00    

(30/50): jline-0.9.94-0.8.el6.noarch.rpm                 |  86 kB     00:00    

(31/50): jpackage-utils-1.7.5-3.12.el6.noarch.rpm        |  59 kB     00:00    

(32/50): log4j-1.2.14-6.4.el6.x86_64.rpm                 | 679 kB     00:00    

(33/50): mx4j-3.0.1-9.13.el6.noarch.rpm                  | 1.1 MB     00:00    

(34/50): mysql-connector-java-5.1.17-6.el6.noarch.rpm    | 1.4 MB     00:00    

(35/50): python-crypto-2.0.1-22.el6.x86_64.rpm           | 159 kB     00:00    

(36/50): python-paramiko-1.7.5-2.1.el6.noarch.rpm        | 728 kB     00:00    

(37/50): regexp-1.5-4.4.el6.x86_64.rpm                   | 105 kB     00:00    

(38/50): rhino-1.7-0.7.r2.2.el6.noarch.rpm               | 778 kB     00:00    

(39/50): sinjdoc-0.5-9.1.el6.x86_64.rpm                  | 705 kB     00:00    

(40/50): slf4j-1.5.8-7.el6.noarch.rpm                    | 132 kB     00:00    

(41/50): tomcat6-6.0.24-45.el6.noarch.rpm                |  87 kB     00:00    

(42/50): tomcat6-el-2.1-api-6.0.24-45.el6.noarch.rpm     |  43 kB     00:00    

(43/50): tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch.rpm    |  80 kB     00:00    

(44/50): tomcat6-lib-6.0.24-45.el6.noarch.rpm            | 2.8 MB     00:00    

(45/50): tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch.rp |  94 kB     00:00    

(46/50): tzdata-java-2012c-1.el6.noarch.rpm              | 154 kB     00:00    

(47/50): ws-commons-util-1.0.1-13.el6.noarch.rpm         |  37 kB     00:00    

(48/50): wsdl4j-1.5.2-7.8.el6.noarch.rpm                 | 157 kB     00:00    

(49/50): xml-commons-apis-1.3.04-3.6.el6.x86_64.rpm      | 439 kB     00:00    

(50/50): xml-commons-resolver-1.1-4.18.el6.x86_64.rpm    | 145 kB     00:00    

--------------------------------------------------------------------------------

Total                                           380 kB/s | 125 MB     05:35    

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing : jpackage-utils-1.7.5-3.12.el6.noarch                        1/50

  Installing : java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64                      2/50

  Installing : 1:java_cup-0.10k-5.el6.x86_64                               3/50

  Installing : sinjdoc-0.5-9.1.el6.x86_64                                  4/50

  Installing : jakarta-commons-logging-1.0.4-10.el6.noarch                 5/50

  Installing : jakarta-commons-pool-1.3-12.7.el6.x86_64                    6/50

  Installing : classpathx-jaf-1.0-15.4.el6.x86_64                          7/50

  Installing : xml-commons-apis-1.3.04-3.6.el6.x86_64                      8/50

  Installing : log4j-1.2.14-6.4.el6.x86_64                                 9/50

  Installing : tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch               10/50

  Installing : jakarta-commons-collections-3.2.1-3.4.el6.noarch           11/50

  Installing : jakarta-commons-dbcp-1.2.1-13.8.el6.noarch                 12/50

  Installing : cloud-scripts-4.0.2-1.el6.x86_64                           13/50

  Installing : cloud-python-4.0.2-1.el6.x86_64                            14/50

  Installing : tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch                   15/50

  Installing : xml-commons-resolver-1.1-4.18.el6.x86_64                   16/50

  Installing : 1:jakarta-commons-discovery-0.4-5.4.el6.noarch             17/50

  Installing : 1:jakarta-commons-httpclient-3.1-0.6.el6.x86_64            18/50

  Installing : 1:ecj-3.4.2-6.el6.x86_64                                   19/50

  Installing : 1:jakarta-commons-daemon-1.0.1-8.9.el6.x86_64              20/50

  Installing : jakarta-commons-lang-2.4-1.1.el6.noarch                    21/50

  Installing : apache-tomcat-apis-0.1-1.el6.noarch                        22/50

  Installing : tzdata-java-2012c-1.el6.noarch                             23/50

  Installing : jline-0.9.94-0.8.el6.noarch                                24/50

  Installing : rhino-1.7-0.7.r2.2.el6.noarch                              25/50

  Installing : 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64        26/50

  Installing : cloud-utils-4.0.2-1.el6.x86_64                             27/50

  Installing : classpathx-mail-1.1.1-9.4.el6.noarch                       28/50

  Installing : slf4j-1.5.8-7.el6.noarch                                   29/50

  Installing : regexp-1.5-4.4.el6.x86_64                                  30/50

  Installing : bcel-5.2-7.2.el6.x86_64                                    31/50

  Installing : wsdl4j-1.5.2-7.8.el6.noarch                                32/50

  Installing : axis-1.2.1-7.2.el6.noarch                                  33/50

  Installing : 1:mx4j-3.0.1-9.13.el6.noarch                               34/50

  Installing : geronimo-specs-1.0-3.4.M2.el6.noarch                       35/50

  Installing : geronimo-specs-compat-1.0-3.4.M2.el6.noarch                36/50

  Installing : 1:mysql-connector-java-5.1.17-6.el6.noarch                 37/50

  Installing : cloud-deps-4.0.2-1.el6.x86_64                              38/50

  Installing : cloud-core-4.0.2-1.el6.x86_64                              39/50

  Installing : cloud-server-4.0.2-1.el6.x86_64                            40/50

  Installing : cloud-setup-4.0.2-1.el6.x86_64                             41/50

  Installing : ws-commons-util-1.0.1-13.el6.noarch                        42/50

  Installing : python-crypto-2.0.1-22.el6.x86_64                          43/50

  Installing : python-paramiko-1.7.5-2.1.el6.noarch                       44/50

  Installing : tomcat6-el-2.1-api-6.0.24-45.el6.noarch                    45/50

  Installing : tomcat6-lib-6.0.24-45.el6.noarch                           46/50

  Installing : tomcat6-6.0.24-45.el6.noarch                               47/50

  Installing : cloud-aws-api-4.0.2-1.el6.x86_64                           48/50

  Installing : cloud-client-ui-4.0.2-1.el6.x86_64                         49/50

  Installing : cloud-client-4.0.2-1.el6.x86_64                            50/50

  Verifying  : tomcat6-el-2.1-api-6.0.24-45.el6.noarch                     1/50

  Verifying  : classpathx-mail-1.1.1-9.4.el6.noarch                        2/50

  Verifying  : jakarta-commons-collections-3.2.1-3.4.el6.noarch            3/50

  Verifying  : geronimo-specs-1.0-3.4.M2.el6.noarch                        4/50

  Verifying  : 1:jakarta-commons-discovery-0.4-5.4.el6.noarch              5/50

  Verifying  : tomcat6-lib-6.0.24-45.el6.noarch                            6/50

  Verifying  : 1:java_cup-0.10k-5.el6.x86_64                               7/50

  Verifying  : python-crypto-2.0.1-22.el6.x86_64                           8/50

  Verifying  : rhino-1.7-0.7.r2.2.el6.noarch                               9/50

  Verifying  : sinjdoc-0.5-9.1.el6.x86_64                                 10/50

  Verifying  : tomcat6-servlet-2.5-api-6.0.24-45.el6.noarch               11/50

  Verifying  : tomcat6-6.0.24-45.el6.noarch                               12/50

  Verifying  : slf4j-1.5.8-7.el6.noarch                                   13/50

  Verifying  : bcel-5.2-7.2.el6.x86_64                                    14/50

  Verifying  : jakarta-commons-pool-1.3-12.7.el6.x86_64                   15/50

  Verifying  : jakarta-commons-lang-2.4-1.1.el6.noarch                    16/50

  Verifying  : 1:ecj-3.4.2-6.el6.x86_64                                   17/50

  Verifying  : regexp-1.5-4.4.el6.x86_64                                  18/50

  Verifying  : jakarta-commons-logging-1.0.4-10.el6.noarch                19/50

  Verifying  : wsdl4j-1.5.2-7.8.el6.noarch                                20/50

  Verifying  : log4j-1.2.14-6.4.el6.x86_64                                21/50

  Verifying  : cloud-setup-4.0.2-1.el6.x86_64                             22/50

  Verifying  : cloud-client-ui-4.0.2-1.el6.x86_64                         23/50

  Verifying  : axis-1.2.1-7.2.el6.noarch                                  24/50

  Verifying  : python-paramiko-1.7.5-2.1.el6.noarch                       25/50

  Verifying  : cloud-core-4.0.2-1.el6.x86_64                              26/50

  Verifying  : 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64        27/50

  Verifying  : classpathx-jaf-1.0-15.4.el6.x86_64                         28/50

  Verifying  : jpackage-utils-1.7.5-3.12.el6.noarch                       29/50

  Verifying  : java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64                     30/50

  Verifying  : ws-commons-util-1.0.1-13.el6.noarch                        31/50

  Verifying  : cloud-deps-4.0.2-1.el6.x86_64                              32/50

  Verifying  : cloud-python-4.0.2-1.el6.x86_64                            33/50

  Verifying  : jline-0.9.94-0.8.el6.noarch                                34/50

  Verifying  : geronimo-specs-compat-1.0-3.4.M2.el6.noarch                35/50

  Verifying  : 1:mx4j-3.0.1-9.13.el6.noarch                               36/50

  Verifying  : 1:jakarta-commons-httpclient-3.1-0.6.el6.x86_64            37/50

  Verifying  : jakarta-commons-dbcp-1.2.1-13.8.el6.noarch                 38/50

  Verifying  : 1:jakarta-commons-daemon-1.0.1-8.9.el6.x86_64              39/50

  Verifying  : xml-commons-apis-1.3.04-3.6.el6.x86_64                     40/50

  Verifying  : cloud-scripts-4.0.2-1.el6.x86_64                           41/50

  Verifying  : cloud-utils-4.0.2-1.el6.x86_64                             42/50

  Verifying  : 1:mysql-connector-java-5.1.17-6.el6.noarch                 43/50

  Verifying  : cloud-client-4.0.2-1.el6.x86_64                            44/50

  Verifying  : cloud-server-4.0.2-1.el6.x86_64                            45/50

  Verifying  : apache-tomcat-apis-0.1-1.el6.noarch                        46/50

  Verifying  : xml-commons-resolver-1.1-4.18.el6.x86_64                   47/50

  Verifying  : cloud-aws-api-4.0.2-1.el6.x86_64                           48/50

  Verifying  : tomcat6-jsp-2.1-api-6.0.24-45.el6.noarch                   49/50

  Verifying  : tzdata-java-2012c-1.el6.noarch                             50/50

 

Installed:

  cloud-client.x86_64 0:4.0.2-1.el6                                            

 

Dependency Installed:

  apache-tomcat-apis.noarch 0:0.1-1.el6                                        

  axis.noarch 0:1.2.1-7.2.el6                                                  

  bcel.x86_64 0:5.2-7.2.el6                                                    

  classpathx-jaf.x86_64 0:1.0-15.4.el6                                         

  classpathx-mail.noarch 0:1.1.1-9.4.el6                                       

  cloud-aws-api.x86_64 0:4.0.2-1.el6                                           

  cloud-client-ui.x86_64 0:4.0.2-1.el6                                         

  cloud-core.x86_64 0:4.0.2-1.el6                                              

  cloud-deps.x86_64 0:4.0.2-1.el6                                              

  cloud-python.x86_64 0:4.0.2-1.el6                                             

  cloud-scripts.x86_64 0:4.0.2-1.el6                                           

  cloud-server.x86_64 0:4.0.2-1.el6                                            

  cloud-setup.x86_64 0:4.0.2-1.el6                                              

  cloud-utils.x86_64 0:4.0.2-1.el6                                             

  ecj.x86_64 1:3.4.2-6.el6                                                     

  geronimo-specs.noarch 0:1.0-3.4.M2.el6                                        

  geronimo-specs-compat.noarch 0:1.0-3.4.M2.el6                                

  jakarta-commons-collections.noarch 0:3.2.1-3.4.el6                           

  jakarta-commons-daemon.x86_64 1:1.0.1-8.9.el6                                 

  jakarta-commons-dbcp.noarch 0:1.2.1-13.8.el6                                 

  jakarta-commons-discovery.noarch 1:0.4-5.4.el6                               

  jakarta-commons-httpclient.x86_64 1:3.1-0.6.el6                              

  jakarta-commons-lang.noarch 0:2.4-1.1.el6                                    

  jakarta-commons-logging.noarch 0:1.0.4-10.el6                                

  jakarta-commons-pool.x86_64 0:1.3-12.7.el6                                   

  java-1.5.0-gcj.x86_64 0:1.5.0.0-29.1.el6                                     

  java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.45.1.11.1.el6                          

  java_cup.x86_64 1:0.10k-5.el6                                                

  jline.noarch 0:0.9.94-0.8.el6                                                 

  jpackage-utils.noarch 0:1.7.5-3.12.el6                                       

  log4j.x86_64 0:1.2.14-6.4.el6                                                

  mx4j.noarch 1:3.0.1-9.13.el6                                                  

  mysql-connector-java.noarch 1:5.1.17-6.el6                                   

  python-crypto.x86_64 0:2.0.1-22.el6                                          

  python-paramiko.noarch 0:1.7.5-2.1.el6                                        

  regexp.x86_64 0:1.5-4.4.el6                                                  

  rhino.noarch 0:1.7-0.7.r2.2.el6                                              

  sinjdoc.x86_64 0:0.5-9.1.el6                                                  

  slf4j.noarch 0:1.5.8-7.el6                                                   

  tomcat6.noarch 0:6.0.24-45.el6                                               

  tomcat6-el-2.1-api.noarch 0:6.0.24-45.el6                                    

  tomcat6-jsp-2.1-api.noarch 0:6.0.24-45.el6                                   

  tomcat6-lib.noarch 0:6.0.24-45.el6                                           

  tomcat6-servlet-2.5-api.noarch 0:6.0.24-45.el6                               

  tzdata-java.noarch 0:2012c-1.el6                                             

  ws-commons-util.noarch 0:1.0.1-13.el6                                        

  wsdl4j.noarch 0:1.5.2-7.8.el6                                                

  xml-commons-apis.x86_64 0:1.3.04-3.6.el6                                     

  xml-commons-resolver.x86_64 0:1.1-4.18.el6                                   

 

Complete!

[root@coms-cluster etc]#

 

2.3    下载vhd-util

https://download.cloud.com.s3.amazonaws.com/tools/vhd-util下载vhd-util文件

如果Management Server安装在RHEL或CentOS上,将vhd-util放在/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver目录下

如果Management Server安装在Ubuntu上,将vhd-util文件放在/usr/lib64/cloud/commom/scripts/vm/hypervisor/xenserver/vhd-util目录下

 

 

 

3.      配置DNS服务

3.1    验证与安装DNS所需软件

[root@cloudstack ~]# rpm -qa | grep '^bind'

bind-libs-9.8.2-0.10.rc1.el6.x86_64

bind-9.8.2-0.10.rc1.el6.x86_64

bind-utils-9.8.2-0.10.rc1.el6.x86_64

bind-chroot-9.8.2-0.10.rc1.el6.x86_64

[root@cloudstack ~]#

[root@cloudstack ~]# yum install bind bind-utils

 

3.2    配置正项解析文件

[root@cloudstack named]# cp -p named.localhost named.cuc.edu.cn #-p的选项是将所有的文件关联的关系一起复制

[root@cloudstack named]# vi named.cuc.edu.cn

 

$TTL 1D

@       IN SOA  @ rname.invalid. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        NS      @

        A       192.168.1.118   #主机的ip

        AAAA    ::1

named-checkzone cuc.edu.cn ./named.cuc.edu.cn  (验证文件格式)

 

3.3    配置反向解析

[root@cloudstack named]# cp -p named.localhost 192.168.named

[root@cloudstack named]# vi 192.168.named

 

$TTL 1D

@       IN SOA  @ rname.invalid. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        NS      @

        A       192.168.1.118

        AAAA    ::1

named-checkzone cuc.edu.cn ./ 192.168.named (验证文件格式)

 

3.4    配置/etc/named.conf文件(配置之前先把默认网关给配置了,/etc/sysconfig/network:GATEWAY=192.168.1.254)

[root@cloudstack named]# vi /etc/named.conf

 

//

// named.conf

//

// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS

// server as a caching only nameserver (as a localhost DNS resolver only).

//

// See /usr/share/doc/bind*/sample/ for example named configuration files.

//

 

options {

        listen-on port 53 { any; };

        listen-on-v6 port 53 { ::1; };

        directory       "/var/named";

        dump-file       "/var/named/data/cache_dump.db";

        statistics-file "/var/named/data/named_stats.txt";

        memstatistics-file "/var/named/data/named_mem_stats.txt";

        allow-query     { any; };

        recursion yes;

 

        dnssec-enable yes;

        dnssec-validation yes;

        dnssec-lookaside auto;

 

        /* Path to ISC DLV key */

        bindkeys-file "/etc/named.iscdlv.key";

 

        managed-keys-directory "/var/named/dynamic";

        forwarders{192.168.1.254;};

};

 

logging {

        channel default_debug {

                file "data/named.run";

                severity dynamic;

        };

};

 

zone "." IN {

        type hint;

        file "named.ca";

};

 

zone "cuc.edu.cn" IN {

        type master;

        file "/var/named/named.cuc.edu.cn";

};

 

 

zone "168.192.in-addr.arpa" IN {

        type master;

        file "/var/named/192.168.named";

};

 

include "/etc/named.rfc1912.zones";

include "/etc/named.root.key";

 

3.5 验证服务

[root@cloudstack named]# service named restart

Stopping named:                                            [  OK  ]

Generating /etc/rndc.key:^C      # 然后就停在这里不动了,运行下面的命令导入key

[root@cloudstack named]# rndc-confgen -r /dev/urandom -a

wrote key file "/etc/rndc.key"

[root@cloudstack named]# service named restart

Stopping named:                                            [  OK  ]

Starting named:                                             [  OK  ]

 

[root@cloudstack named]# dig sina.com.cn

 

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> sina.com.cn

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31543

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4

 

;; QUESTION SECTION:

;sina.com.cn.                     IN     A

 

;; ANSWER SECTION:

sina.com.cn.             29     IN     A       202.108.33.60

 

;; AUTHORITY SECTION:

sina.com.cn.             9483         IN     NS    ns1.sina.com.cn.

sina.com.cn.             9483         IN     NS    ns2.sina.com.cn.

sina.com.cn.             9483         IN     NS    ns3.sina.com.cn.

sina.com.cn.             9483         IN     NS    ns4.sina.com.cn.

 

;; ADDITIONAL SECTION:

ns1.sina.com.cn.     1685         IN     A       202.106.184.166

ns2.sina.com.cn.     1644         IN     A       61.172.201.254

ns3.sina.com.cn.     1645         IN     A       123.125.29.99

ns4.sina.com.cn.     1723         IN     A       121.14.1.22

 

;; Query time: 4 msec

;; SERVER: 192.168.1.248#53(192.168.1.248)

;; WHEN: Sun Jun  9 16:30:09 2013

;; MSG SIZE  rcvd: 181

 

 

 

 

4.      安装数据库MySql(Version 5.1 /5.5可以工作的很好,注:这里是mysqlManagement Server安装在同一台机器上的情况)

4.1    yum install mysql-server

[root@coms-cluster etc]# yum install mysql-server

Setting up Install Process

Package mysql-server-5.1.61-4.el6.x86_64 already installed and latest version

Nothing to do

[root@coms-cluster etc]#

 

4.2    编辑MySQL的配置文件(/etc/my.cnf),在[mysqld]区域下面插入下面的内容。

[root@coms-cluster etc]# vi /etc/my.cnf

 

[mysqld]

datadir=/var/lib/mysql

innodb_rollback_on_timeout=1    # 红色标注的地方是需要插入的内容

innodb_lock_wait_timeout=600

max_connections=350

log-bin=mysql-bin

binlog-format='ROW'

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

 

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

注:max_connections参数应当设置为350*你配置的Management Server的数目

 

4.3    手动开启mysql:service mysqld start

[root@coms-cluster etc]# service mysqld start

Initializing MySQL database:  Installing MySQL system tables...

OK

Filling help tables...

OK

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

 

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

 

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h cloudstackms.houqd.pub password 'new-password'

 

Alternatively you can run:

/usr/bin/mysql_secure_installation

 

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

 

See the manual for more instructions.

 

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd /usr/mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the /usr/bin/mysqlbug script!

 

                                                           [  OK  ]

Starting mysqld:                                           [  OK  ]

[root@coms-cluster etc]#

 

4.4    在RHEL和CentOS上mysql默认没有设置root的密码,强烈建议为了确保安全设置一个密码。在Ununtu上不同执行,因为在安装的时候会询问你设置root的密码。

[root@coms-cluster etc]# 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): #提示输入当前密码,由于是空直接回车,设置完新密码后,其它的询问均为Yes

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] y

 ... Success!

 

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!

 

 

[root@coms-cluster etc]#

 

4.5    配置数据库,在数据库上创建一个名为“cloud”的用户

[root@coms-cluster etc]# cloud-setup-databases cloud:dell_456@localhost --deploy-as=root:dell_456

Mysql user name:cloud                                                           [ OK ]

Mysql user password:dell_456                                                    [ OK ]

Mysql server ip:localhost                                                       [ OK ]

Mysql server port:3306                                                          [ OK ]

Mysql root user name:root                                                       [ OK ]

Mysql root user password:dell_456                                               [ OK ]

Checking Cloud database files ...                                               [ OK ]

Checking local machine hostname ...                                             [ OK ]

Checking SELinux setup ...                                                      [ OK ]

Detected local IP address as 100.1.1.1, will use as cluster management server node IP[ OK ]

Preparing /etc/cloud/management/db.properties                                   [ OK ]

Applying /usr/share/cloud/setup/create-database.sql                             [ OK ]

Applying /usr/share/cloud/setup/create-schema.sql                               [ OK ]

Applying /usr/share/cloud/setup/create-database-premium.sql                     [ OK ]

Applying /usr/share/cloud/setup/create-schema-premium.sql                       [ OK ]

Applying /usr/share/cloud/setup/server-setup.sql                                [ OK ]

Applying /usr/share/cloud/setup/templates.sql                                   [ OK ]

Applying /usr/share/cloud/setup/create-index-fk.sql                             [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_db.sql                    [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_schema.sql                [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_multipart.sql             [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_index.sql                 [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_multipart_alter.sql       [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_bucketpolicy.sql          [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_policy_alter.sql          [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_offering.sql              [ OK ]

Applying /usr/share/cloud/setup/bridge/db/cloudbridge_offering_alter.sql        [ OK ]

Processing encryption ...                                                       [ OK ]

Finalizing setup ...                                                            [ OK ]

 

CloudStack has successfully initialized database, you can check your database configuration in /etc/cloud/management/db.properties

 

[root@coms-cluster etc]#

 

可能发生的错误:

[root@cloudstack ~]# cloud-setup-databases cloud:dell_456@localhost --deploy-as=root:dell_456

Mysql user name:cloud                                                           [ OK ]

Mysql user password:dell_456                                                    [ OK ]

Mysql server ip:localhost                                                       [ OK ]

Mysql server port:3306                                                          [ OK ]

Mysql root user name:root                                                       [ OK ]

Mysql root user password:dell_456                                               [ OK ]

Checking Cloud database files ...                                               [ OK ]

Checking local machine hostname ...                                             [ OK ]

Checking SELinux setup ...                                                      [ OK ]

Detected local IP address as 100.1.1.100, will use as cluster management server node IP[ OK ]

Preparing /etc/cloud/management/db.properties                                   [ OK ]

Applying /usr/share/cloud/setup/create-database.sql                            

 

We apologize for below error:

***************************************************************

Encountering an error when executing mysql script

----------------------------------------------------------------------

table:

/usr/share/cloud/setup/create-database.sql

 

Error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)     # 这说明你的mysql还没有启动,需要手动启动

 

 

Sql parameters:

{'passwd': 'dell_456', 'host': 'localhost', 'user': 'root', 'port': 3306}

----------------------------------------------------------------------

           

***************************************************************

Please run:

 

    cloud-setup-database -h

 

for full help

[root@cloudstack ~]#

 

 

4.6    配置cloud-management(注:这一步一定不要忘记执行,开始的时候我忘记执行了,结果在web界面输入默认的adminpassword提示无效的用户名或密码,虽然现在在数据库中是正确的也不行,还是在群里问的。)

 [root@cloudstack management]# cloud-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!

[root@cloudstack management]#

 

5.      安装NFS共享(CloudStack需要一个地方来作为第一和第二存储,所有的这些都可以用NFS共享来实现,通常来说配置NFS Server需要一个单独的服务器,但是将Management Server作为NFS服务器也是可行的,这是一个典型的配置。注:这里我们将ManagementServer作为NFS服务器)

5.1    创建两个目录用来作为第一和第二存储

[root@coms-cluster etc]# mkdir -p /export/primary

[root@coms-cluster etc]# mkdir -p /export/secondary

[root@coms-cluster etc]# cd /export/

[root@coms-cluster export]# ll

total 40

drwxr-xr-x 2 root root  4096 May 24 16:52 apps

drwxr-xr-x 3 root root  4096 Jun  4 14:38 home

drwx------ 2 root root 16384 May 24 16:21 lost+found

drwxr-xr-x 2 root root  4096 Jun  8 15:00 primary

drwxr-xr-x 3 root root  4096 May 29  2012 rocks

drwxr-xr-x 2 root root  4096 Jun  8 15:00 secondary

drwxr-xr-x 3 root root  4096 May 24 16:50 site-roll

[root@coms-cluster export]#

 

5.2    将上面创建的目录加入NFS共享中,编辑/etc/exports文件。

[root@coms-cluster export]#

[root@coms-cluster export]# vi /etc/exports

 

/export 100.1.1.1(rw,async,no_root_squash) 100.1.0.0/255.255.0.0(rw,async)

/export/primary *(rw,async,no_root_squash)

/export/secondary *(rw,async,no_root_squash)

 

[root@coms-cluster export]# exportfs -a

[root@coms-cluster export]# showmount -e localhost

Export list for localhost:

/export/secondary *        #共享出去的两个目录

/export/primary   *

/export           (everyone)

[root@coms-cluster export]#

 

5.3    修改NFS的配置文件/etc/sysconf/nfs,取消下面的注释。(CetOS和RHEL必须,Ubuntu不用设置)

LOCKD_TCPPORT=32803

LOCKD_UDPPORT=32769

MOUNTD_PORT=892

RQUOTAD_PORT=875

STATD_PORT=662

STATD_OUTGOING_PORT=2020

 

5.4    修改/etc/sysconfig/iptables文件,添加一些规则到INPUT chain

[root@coms-cluster sysconfig]# vi iptables

 

*nat

#  MASQUERADE (host) :

-A POSTROUTING -o eth1 -j MASQUERADE

COMMIT

 

*filter

:INPUT ACCEPT [0:0]

-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

:FORWARD DROP [0:0]

:OUTPUT ACCEPT [0:0]

#  A10-REJECT-411-TCP (host) :

-A INPUT -p tcp --dport 372 -j REJECT --sport 1024:65535

#  A10-REJECT-411-UDP (host) :

-A INPUT -p udp --dport 372 -j REJECT --sport 1024:65535

#  A15-ALL-LOCAL (global) :

-A INPUT -j ACCEPT -i lo

#  A20-ALL-PRIVATE (global) :

-A INPUT -i eth0 -j ACCEPT

#  A20-SSH-PUBLIC (global) :

-A INPUT -i eth1 -p tcp --dport ssh -j ACCEPT -m state --state NEW

#  A30-RELATED-PUBLIC (global) :

-A INPUT -i eth1 -j ACCEPT -m state --state RELATED,ESTABLISHED

#  A40-HTTPS-PUBLIC-LAN (host) :

-A INPUT -i eth1 -p tcp --dport https -j ACCEPT -m state --state NEW --source 192.168.1.0/255.255.255.0

#  A40-WWW-PUBLIC-LAN (host) :

-A INPUT -i eth1 -p tcp --dport www -j ACCEPT -m state --state NEW --source 192.168.1.0/255.255.255.0

#  A50-FORWARD-RELATED (host) :

-A FORWARD -i eth1 -o eth0 -j ACCEPT -m state --state RELATED,ESTABLISHED

#  A60-FORWARD (host) :

-A FORWARD -i eth0 -j ACCEPT

#  R10-GANGLIA-UDP (host) : block ganglia traffic from non-private interfaces

-A INPUT -p udp --dport 8649 -j REJECT

#  R20-MYSQL-TCP (host) : block mysql traffic from non-private interfaces

-A INPUT -p tcp --dport 3306 -j REJECT

#  R30-FOUNDATION-MYSQL (host) : block foundation mysql traffic from non-private interfaces

-A INPUT -p tcp --dport 40000 -j REJECT

#  R900-PRIVILEGED-TCP (global) :

-A INPUT -i eth1 -p tcp -j REJECT --dport 0:1023

#  R900-PRIVILEGED-UDP (global) :

-A INPUT -i eth1 -p udp -j REJECT --dport 0:1023

COMMIT

 

运行iptables:

[root@coms-cluster sysconfig]# service iptables start

iptables: Applying firewall rules:                         [  OK  ]

[root@coms-cluster sysconfig]# service iptables save

iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

[root@coms-cluster sysconfig]#

 

5.5    如果NFS v4的通信是在client和server,将domain加入到/etc/idmapd.conf中,同时在hypervisior和Management Server主机上设置。

[root@coms-cluster sysconfig]# cat /etc/idmapd.conf | grep Domain

Domain = cuc.edu.cn

[root@coms-cluster sysconfig]#

 

挂载共享目录:

mount –t nfs 192.168.1.117:/export/primary /primary

mount –t nfs 192.168.1.117:/export/secondary /secondary

 

   将挂载命令写入/etc/fstab和/etc/rc.local,使其开机自启动

192.168.1.118:/export/primary  /primary                nfs     defaults        0 0

192.168.1.118:/export/secondary  /secondary                nfs     defaults        0 0

 

mount –a      /etc/rc.local

 

6.      准备系统虚拟机模板

https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/management-server-install-flow.html

根据使用不同的hypervisior使用不同的命令,这里我使用的是vmware vsphere的:

/usr/lib64/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt -m /secondary/ -u https://download.cloud.com/templates/burbank/burbank-systemvm-08012012.ova -h vmware -F

 

注意:这里遇到一个超级恶心的问题/分区下的大小不够了,因此在执行上面那条命令的时候报错:Insufficient free disk space for local temporary folder /usr/lib64/cloud/common/scripts/storage/secondary: avail=2017020k req=5120000k

Installation failed 提示这个目录下的可用空间不够了,用df –h 查看它是/目录下的。于是就想办法使/目录扩容,使用的是gparted-LiveCD这个工具,使用方式:https://blog.sina.com.cn/s/blog_573860a90101039x.html ,这个使分区减少很容易,使分区增大就得让它相邻的那个分区减少,蛋疼的是和/dev/sda1靠着的是/boot是启动数据存放的地方,谢天谢地没有出现启动错误。

 

7.      用户界面的使用

Web:https://192.168.1.117:8080/client/   #这里的IP为你的Management Server的IP

 

这里碰到admin/password无法登陆的问题,问了穆老师,重装系统,最小化安装。(注:这里不是最小化安装的问题,是因为没有执行cloud-setup-management,执行完之后就可以登录进去了,在cloudstack群里面问到的)

service --status-all

 

后面的安装做完后再写。


分享到: