阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 7.2安装部署OpenStack 教程

224次阅读
没有评论

共计 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 中,结果如下图:

CentOS 7.2 安装部署 OpenStack 教程

更多详情见请继续阅读下一页的精彩内容 :http://www.linuxidc.com/Linux/2017-06/144673p2.htm

1、创建数据库

[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

2、安装 keystone

yum install openstack-keystone httpd mod_wsgi Python-openstackclient memcached python-memcached

3、 启动 memcache

# systemctl enable memcached.service
# systemctl start memcached.service

4、 设置环境

  1. Edit the /etc/keystone/keystone.conf file and complete the following actions:
    1. In the [DEFAULT] section, define the value of the initial administration token:
      1
      2
      3
      [DEFAULT]
      ...
      admin_token = ADMIN_TOKEN
      Replace ADMIN_TOKEN with the random value that you generated in a previous step.
    2. In the [database] section, configure database access:
      1
      2
      3
      [database]
      ...
      connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone
      Replace KEYSTONE_DBPASS with the password you chose for the database.
    3. In the [memcache] section, configure the Memcache service:
      1
      2
      3
      [memcache]
      ...
      servers = localhost:11211
    4. In the [token] section, configure the UUID token provider and Memcached driver:
      1
      2
      3
      4
      [token]
      ...
      provider = keystone.token.providers.uuid.Provider
      driver = keystone.token.persistence.backends.memcache.Token
    5. In the [revoke] section, configure the SQL revocation driver:
      1
      2
      3
      [revoke]
      ...
      driver = keystone.contrib.revoke.backends.sql.Revoke
    6. (Optional) To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:
      1
      2
      3
      [DEFAULT]
      ...
      verbose = True
  2. Populate the Identity service database:
    # su -s /bin/sh -c "keystone-manage db_sync" keystone

5、 设置 HTTP

  1. Edit the /etc/httpd/conf/httpd.conf file and configure the ServerName option to reference the controller node:
    ServerName controller
  2. 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>
  3. Create the directory structure for the WSGI components:
    # mkdir -p /var/www/cgi-bin/keystone
  4. 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
  5. 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 中,结果如下图:

CentOS 7.2 安装部署 OpenStack 教程

更多详情见请继续阅读下一页的精彩内容 :http://www.linuxidc.com/Linux/2017-06/144673p2.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计7708字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中