共计 7708 个字符,预计需要花费 20 分钟才能阅读完成。
分享 CentOS 7.2 安装部署 OpenStack 教程,希望对大家有所帮助。
1、系统环境
# uname -r
3.10.0-327.el7.x86_64
# cat /etc/RedHat-release
CentOS Linux release 7.2.1511 (Core)
2、服务器部署
IP |
主机名 |
角色 |
配置 |
192.168.56.108 |
controller |
控制节点 |
M:4G;C:2C;50G |
192.168.56.109 |
compute |
计算节点 |
M:2G;C:2C;50G |
3、基础环境准备
3.1、配置 hosts
# cat /etc/hosts
192.168.56.108 controller
192.168.56.109 compute
3.2、配置时间同步
[root@controller ~]# yum install -y ntp
[root@controller ~]# vim /etc/ntp.conf
15 restrict -6 ::1
16 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
27 restrict 0.centos.pool.ntp.org nomodify notrap noquery
28 restrict 1.centos.pool.ntp.org nomodify notrap noquery
29 restrict 2.centos.pool.ntp.org nomodify notrap noquery
30 restrict 3.centos.pool.ntp.org nomodify notrap noquery
31 server 127.127.1.0
32 fudge 127.127.1.0 stratum 10
[root@controller ~]# systemctl enable ntpd
[root@controller ~]# systemctl start ntpd
在控制节点和计算节点配置定时任务
[root@compute ~]# crontab -l */5 * * * * /usr/sbin/ntpdate 192.168.56.108 >/dev/null 2>&1
3.3、关闭防火墙
# systemctl stop firewalld
3.4、关闭 selinux
# SELINUX=disabled /etc/selinux/config // 需要重启
3.5、安装基础包
[root@controller ~]# yum install -yhttp://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm
[root@controller ~]# yum install -y centos-release-openstack-liberty
[root@controller ~]# yum install -y Python-openstackclient
3.6、安装 mysql
[root@controller ~]# yum install -y mariadb mariadb-server MySQL-python
[root@controller ~]# vim /etc/my.cnf
在 mysqld 模块添加如下几行:
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8’
character-set-server = utf8
[root@controller ~]# systemctl enable mariadb.service
[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# mysql_secure_installation
3.7、安装 rabbitmq
[root@controller ~]# yum install -y rabbitmq-server
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# rabbitmqctl add_user openstack openstack
Creating user “openstack” …
…done.
[root@controller ~]# rabbitmqctl set_permissions openstack ‘.*’ ‘.*’ ‘.*’
Setting permissions for user “openstack” in vhost “/”…
…done.
[root@controller ~]# rabbitmqctl set_user_tags openstack administrator
[root@controller ~]# rabbitmq-plugins enable rabbitmq_management
[root@controller ~]# systemctl restart rabbitmq-server.service
在浏览器中输入 http://192.168.56.108:15672,默认账户和密码为 guest
登录后将前面创建的 openstack 用户加入到 admin 中,结果如下图:
更多详情见请继续阅读下一页的精彩内容 :http://www.linuxidc.com/Linux/2017-06/144673p2.htm
[root@controller ~]# mysql -u root -p
[root@controller ~]# CREATE DATABASE keystone;
[root@controller ~]# GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'PWS';
[root@controller ~]# GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'PWS';
[root@controller ~]# openssl rand -hex 10
yum install openstack-keystone httpd mod_wsgi Python-openstackclient memcached python-memcached
# systemctl enable memcached.service
# systemctl start memcached.service
-
Edit the
/etc/keystone/keystone.conf
file and complete the following actions:-
In the
[DEFAULT]
section, define the value of the initial administration token:123[DEFAULT]
...
admin_token = ADMIN_TOKEN
Replace
ADMIN_TOKEN
with the random value that you generated in a previous step. -
In the
[database]
section, configure database access:123[database]
...
connection = mysql:
//keystone
:KEYSTONE_DBPASS@controller
/keystone
Replace
KEYSTONE_DBPASS
with the password you chose for the database. -
In the
[memcache]
section, configure the Memcache service:123[memcache]
...
servers = localhost:11211
-
In the
[token]
section, configure the UUID token provider and Memcached driver:1234[token]
...
provider = keystone.token.providers.uuid.Provider
driver = keystone.token.persistence.backends.memcache.Token
-
In the
[revoke]
section, configure the SQL revocation driver:123[revoke]
...
driver = keystone.contrib.revoke.backends.sql.Revoke
-
(Optional) To assist with troubleshooting, enable verbose logging in the
[DEFAULT]
section:123[DEFAULT]
...
verbose = True
-
-
Populate the Identity service database:
# su -s /bin/sh -c "keystone-manage db_sync" keystone
5、 设置 HTTP
- Edit the
/etc/httpd/conf/httpd.conf
file and configure theServerName
option to reference the controller node:ServerName
controller
- Create the
/etc/httpd/conf.d/wsgi-keystone.conf
file with the following content:Listen 5000 Listen 35357 <VirtualHost *:5000> WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-public WSGIScriptAlias / /var/www/cgi-bin/keystone/main WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On LogLevel info ErrorLogFormat "%{cu}t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined </VirtualHost> <VirtualHost *:35357> WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} WSGIProcessGroup keystone-admin WSGIScriptAlias / /var/www/cgi-bin/keystone/admin WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On LogLevel info ErrorLogFormat "%{cu}t %M" ErrorLog /var/log/httpd/keystone-error.log CustomLog /var/log/httpd/keystone-access.log combined </VirtualHost>
- Create the directory structure for the WSGI components:
# mkdir -p /var/www/cgi-bin/keystone
- Copy the WSGI components from the upstream repository into this directory:
# curl http://git.openstack.org/cgit/openstack/keystone/plain/httpd/keystone.py?h=stable/kilo | tee /var/www/cgi-bin/keystone/main /var/www/cgi-bin/keystone/admin
- Adjust ownership and permissions on this directory and the files in it:
# chown -R keystone:keystone /var/www/cgi-bin/keystone # chmod 755 /var/www/cgi-bin/keystone/*
- Restart the Apache HTTP server:
# systemctl enable httpd.service # systemctl start httpd.service
-
6、 设置 HTTP
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-06/144673.htm
分享 CentOS 7.2 安装部署 OpenStack 教程,希望对大家有所帮助。
1、系统环境
# uname -r
3.10.0-327.el7.x86_64
# cat /etc/RedHat-release
CentOS Linux release 7.2.1511 (Core)
2、服务器部署
IP |
主机名 |
角色 |
配置 |
192.168.56.108 |
controller |
控制节点 |
M:4G;C:2C;50G |
192.168.56.109 |
compute |
计算节点 |
M:2G;C:2C;50G |
3、基础环境准备
3.1、配置 hosts
# cat /etc/hosts
192.168.56.108 controller
192.168.56.109 compute
3.2、配置时间同步
[root@controller ~]# yum install -y ntp
[root@controller ~]# vim /etc/ntp.conf
15 restrict -6 ::1
16 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
27 restrict 0.centos.pool.ntp.org nomodify notrap noquery
28 restrict 1.centos.pool.ntp.org nomodify notrap noquery
29 restrict 2.centos.pool.ntp.org nomodify notrap noquery
30 restrict 3.centos.pool.ntp.org nomodify notrap noquery
31 server 127.127.1.0
32 fudge 127.127.1.0 stratum 10
[root@controller ~]# systemctl enable ntpd
[root@controller ~]# systemctl start ntpd
在控制节点和计算节点配置定时任务
[root@compute ~]# crontab -l */5 * * * * /usr/sbin/ntpdate 192.168.56.108 >/dev/null 2>&1
3.3、关闭防火墙
# systemctl stop firewalld
3.4、关闭 selinux
# SELINUX=disabled /etc/selinux/config // 需要重启
3.5、安装基础包
[root@controller ~]# yum install -yhttp://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm
[root@controller ~]# yum install -y centos-release-openstack-liberty
[root@controller ~]# yum install -y Python-openstackclient
3.6、安装 mysql
[root@controller ~]# yum install -y mariadb mariadb-server MySQL-python
[root@controller ~]# vim /etc/my.cnf
在 mysqld 模块添加如下几行:
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8’
character-set-server = utf8
[root@controller ~]# systemctl enable mariadb.service
[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# mysql_secure_installation
3.7、安装 rabbitmq
[root@controller ~]# yum install -y rabbitmq-server
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# rabbitmqctl add_user openstack openstack
Creating user “openstack” …
…done.
[root@controller ~]# rabbitmqctl set_permissions openstack ‘.*’ ‘.*’ ‘.*’
Setting permissions for user “openstack” in vhost “/”…
…done.
[root@controller ~]# rabbitmqctl set_user_tags openstack administrator
[root@controller ~]# rabbitmq-plugins enable rabbitmq_management
[root@controller ~]# systemctl restart rabbitmq-server.service
在浏览器中输入 http://192.168.56.108:15672,默认账户和密码为 guest
登录后将前面创建的 openstack 用户加入到 admin 中,结果如下图:
更多详情见请继续阅读下一页的精彩内容 :http://www.linuxidc.com/Linux/2017-06/144673p2.htm