OpenStack实战安装部署教程,OpenStack安装教程

本文提供了一步一步的OpenStack在CentOS 7上的安装部署教程,涵盖了从基础准备、mariadb数据库配置、消息队列服务、用户认证组件keystone、glance组件、计算节点、网络节点的设置,到dashboard安装和访问测试的全过程。
摘要由CSDN通过智能技术生成

OpenStack安装部署

一、基础准备工作

部署环境:CentOS 7 64

1、关闭本地iptables防火墙并设置开机不自启动

# systemctl stop firewalld.service# systemctl disable firewalld.service
  • 1.

2、关闭本地selinux防火墙

# vim /etc/sysconfig/selinux SELINUX=disabled# setenforce 0
  • 1.

3、设置主机计算机名称

# hostnamectl set-hostname controller
  • 1.

4、本地主机名称和ip的解析

# vim /etc/hosts192.168.0.104 controller
  • 1.

5、安装ntp时间校准工具

# yum -y install ntp# ntpdate asia.pool.ntp.org
  • 1.

6、安装第三方yum源

# yum -y install yum-plugin-priorities# yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm	# yum -y install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm
  • 1.

7、升级系统软件包并重新系统

# yum upgrade# reboot
  • 1.

二、安装配置mariadb数据库

1、安装mariadb数据库

# yum -y install mariadb mariadb-server MySQL-python
  • 1.

2、配置mariadb数据库

# cp /etc/my.cnf /etc/my.cnf.bak# rpm -ql mariadb# vim /etc/my.cnf.d/server.cnf[mysqld]bind-address = 0.0.0.0
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'character-set-server = utf8
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

3、启动mariadb数据库

# systemctl enable mariadb.service# systemctl start mariadb.service
  • 1.

三、安装消息队列服务

1、安装rabbit所需软件包

# yum -y install rabbitmq-server
  • 1.

2、启动rabbit服务

# systemctl enable rabbitmq-server.service# systemctl start rabbitmq-server.service
  • 1.

3、设置rabbit服务密码

# rabbitmqctl change_password guest rabbit
  • 1.

四、安装keyston用户认证组件

1、创建keystone数据库和授权用户

mysql -u root -p
CREATE DATABASE keystone;GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
  • 1.
  • 2.

2、安装keystone组件包

# yum -y install openstack-utils openstack-keystone python-keystoneclient
  • 1.

3、配置keystone文件

# cp /etc/keystone/keystone.conf /etc/keystone/keystone.conf.bak# vim /etc/keystone/keystone.conf [DEFAULT]verbose = True[database]connection = mysql://keystone:keystone@controller/keystone[token]provider = keystone.token.providers.uuid.Provider
driver = keystone.token.persistence.backends.sql.Token
  • 1.
  • 2.

4、创建证书和秘钥文件

# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone# chown -R keystone:keystone /var/log/keystone# chown -R keystone:keystone /etc/keystone/ssl# chmod -R o-rwx /etc/keystone/ssl
  • 1.

5、同步keystone到mariadb数据库

# su -s /bin/sh -c "keystone-manage db_sync" keystone
  • 1.

6、启动keystone服务并开机自启动

# systemctl enable openstack-keystone.service# systemctl start openstack-keystone.service
  • 1.

7、清除过期的令牌

默认情况下,身份服务存储在数据库中过期的令牌无限。到期令牌的积累大大增加数据库的大小,可能会降低服务的性能,特别是在资源有限的环境中。我们建议您使用cron配置一个周期性任务,清除过期的令牌时

# (crontab -l -u keystone 2>&1 | grep -q token_flush) || \
  echo '@hourly /usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1' \  >> /var/spool/cron/keystone
  • 1.
  • 2.

----------------------------Create tenants,user,and roles---------------------------------

1、配置admin的token

# export OS_SERVICE_TOKEN=$(openssl rand -hex 10)# export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0# echo $OS_SERVICE_TOKEN > ~/ks_admin_token# openstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token  $OS_SERVICE_TOKEN# service openstack-keystone restart
  • 1.

2、创建tenant、user and role

a.Create the admin tenant、user、role# keystone tenant-create --name admin --description "Admin Tenant"# keystone user-create --name admin --pass admin --email admin@zhengyansheng.com# keystone role-create --name adminb.Add the admin tenant and user to the admin role:# keystone user-role-add --tenant admin --user admin --role adminc.By default, the dashboard limits access to users with the _member_ role.# keystone role-create --na
  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

格瑞丝网络

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值