2021-04-15

openstack victoria 部署

环境准备

1.配置网络

2.vi /etc/hosts 添加controller信息
10.0.0.11 controller

3.安装sql
yum install mariadb mariadb-server python-PyMySQL

vim /etc/my.cnf.d/openstack.cnf创建并编辑以下内容
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

启动服务
systemctl enable mariadb.service
systemctl start mariadb.service

4.安装RabbitMQ
yum install rabbitmq-server
启动服务
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
2021-04-15
rabbitmqctl add_user openstack RABBIT_PASS添加用户

rabbitmqctl set_permissions openstack “." ".” “.*” 设置读写权限

5.安装 Memcached
yum install memcached python3-memcached
2021-04-15
vim /etc/sysconfig/memcached 编辑
2021-04-15
启动服务
systemctl enable memcached.service
systemctl start memcached.service

安装openstack

1.创建keystone并授权
mysql -u root -p
MariaDB [(none)]> CREATE DATABASE keystone;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone’@‘localhost’
IDENTIFIED BY ‘KEYSTONE_DBPASS’;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone’@’%’
IDENTIFIED BY ‘KEYSTONE_DBPASS’;
MariaDB [(none)]> exit
2021-04-15
安装软件包
yum install openstack-keystone httpd mod_wsgi

配置数据库入口
vim /etc/keystone/keystone.conf
[database]
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
[token]
provider = fernet
此处文件全为注释,去掉前面的#号。否则同步数据库时报错。

同步数据库
su -s /bin/sh -c “keystone-manage db_sync” keystone

初始化fernet密钥仓库
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
权限需要修改否则出现错误
2021-04-15
修改该文件的权限
2021-04-15
成功执行

启动身份服务
keystone-manage bootstrap --bootstrap-password ADMIN_PASS
–bootstrap-admin-url http://controller:5000/v3/
–bootstrap-internal-url http://controller:5000/v3/
–bootstrap-public-url http://controller:5000/v3/
–bootstrap-region-id RegionOne

配置serverName
vim /etc/httpd/conf/httpd.conf,去掉前面的#号
2021-04-15
创建符号链接
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
2021-04-15
完成安装
systemctl enable httpd.service
systemctl start httpd.service

设置环境变量
$ export OS_USERNAME=admin
$ export OS_PASSWORD=ADMIN_PASS
$ export OS_PROJECT_NAME=admin
$ export OS_USER_DOMAIN_NAME=Default
$ export OS_PROJECT_DOMAIN_NAME=Default
$ export OS_AUTH_URL=http://controller:5000/v3
$ export OS_IDENTITY_API_VERSION=3

环境准备

虚拟机

三级目录

上一篇:k8s是否正在重蹈OpenStack的覆辙?


下一篇:openstack宿主机故障,虚拟实例恢复