cloudstack安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cloudstack安装相关的知识,希望对你有一定的参考价值。

1.安装cloudstack

1.1:配置本地yum

1)创建存放rpm包的目录

[[email protected] ~]# mkdir /soft/cloudstack/

2)将下载的包上传到对应的服务器目录中

下载路径:http://cloudstack.apt-get.eu/centos/6/4.9/

[[email protected] cloudstack]# pwd

/soft/cloudstack

[[email protected] cloudstack]# ls

cloudstack-agent-4.9.0-1.el6.x86_64.rpm            cloudstack-management-4.9.0-1.el6.x86_64.rpm

cloudstack-baremetal-agent-4.9.0-1.el6.x86_64.rpm  cloudstack-usage-4.9.0-1.el6.x86_64.rpm

cloudstack-cli-4.9.0-1.el6.x86_64.rpm

cloudstack-common-4.9.0-1.el6.x86_64.rpm

3)安装createrepo工具并创建repo

[[email protected] cloudstack]# yum -y install createrepo

[[email protected] cloudstack]# createrepo /soft/cloudstack/

Spawning worker 0 with 6 pkgs

Workers Finished

Gathering worker results

 

Saving Primary metadata

Saving file lists metadata

Saving other metadata

Generating sqlite DBs

Sqlite DBs complete

4)编辑.repo文件

[[email protected] cloudstack]# vim /etc/yum.repos.d/cloudstack.repo

[cloudstack]

name=cloudstack

baseurl=file:///soft/cloudstack/

enabled=1

gpgcheck=0

5)查看配置情况

[[email protected] cloudstack]# yum clean all

已加载插件:fastestmirror, security

Cleaning repos: base cloudstack extras mysql-connectors-community updates

清理一切

Cleaning up list of fastest mirrors

[[email protected] cloudstack]# yum repolist

[[email protected] cloudstack]# yum repolist

已加载插件:fastestmirror, security

Loading mirror speeds from cached hostfile

 * base: mirrors.tuna.tsinghua.edu.cn

 * extras: mirrors.tuna.tsinghua.edu.cn

 * updates: mirrors.tuna.tsinghua.edu.cn

仓库标识                   仓库名称       状态

base                       CentOS-6 - Bas 6,696

cloudstack                 cloudstack         6

extras                     CentOS-6 - Ext    62

mysql-connectors-community MySQL Communit    24

updates                    CentOS-6 - Upd   686

repolist: 7,474                                                                        

1.2:使用yum安装cloudstack

1)安装cloudstack-management

[[email protected] cloudstack]# yum -y install cloudstack-management

[[email protected] cloudstack]# yum -y install cloud-client

2.配置数据库(mysql)服务

2.1准备 mysql服务器

1)安装mysql服务

[[email protected] cloudstack]# yum -y install mysql-server

2)修改mysql配置文件

[[email protected] cloudstack]# vim /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

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

user=mysql

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

symbolic-links=0

innodb_rollback_on_timeout=1

innodb_lock_wait_timeout=600

max_connections=350

log-bin=mysql-bin

binlog-format=‘ROW‘

[mysqld_safe]

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

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

3)启动数据库

[[email protected] cloudstack]# service mysqld start

正在启动 mysqld:                                          [确定]

4)设置mysql root密码

[[email protected] cloudstack]# mysqladmin -uroot password 123456

5)设置root远程登录权限

[[email protected] cloudstack]# mysql -uroot -p123456 -e "GRANT ALL PRIVILEGES ON *.* TO [email protected]‘%‘ IDENTIFIED BY ‘123456‘"

2.2创建cloudstack的初始化数据库文件

[[email protected] cloudstack]# cloudstack-setup-databases cloud:[email protected] --deploy-as=root:123456 -e file -m 123456 -k 123456

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.1.130, 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 ]

Processing encryption ...                                                       

 

[ OK ]

Finalizing setup ...                                                            [ OK ]

 

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

本文出自 “庭中有奇树” 博客,请务必保留此出处http://zhangdl.blog.51cto.com/11050780/1881824

以上是关于cloudstack安装的主要内容,如果未能解决你的问题,请参考以下文章

我不是九爷 带你了解 CloudStack+XenServer详细部署方案:CloudStack管理节点的安装和配置

Cloudstack安装

如何在 RHEL 7.4 上安装 cloudstack

cloudstack 开源虚拟化平台

一次cloudstack启动cloudstack-agent报错的处理过程

(转)CloudStack 安装及使用过程中常见问题汇总