centos7 手动安装OpenStack


我现在日常安装OSmmp。
不想删ubuntu里面的,也不太会删除。。干脆重新装,这次用centos7,这个看起来比较简洁。
(图片文件夹是openstack-3)
我觉得这个更靠谱一些,比之前ubuntu手动装好多了,奇怪的报错也少了。

准备

环境是

  • centos 7
  • 6G RAM
  • 4核 CPU
  • 35G 硬盘

老规矩先换源,用阿里源
先备份再下载

su
mv /etc/yum.repos.d/CentOS-Base.repo /home/kang/Desktop/mydir/CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

更新缓存

yum clean all
yum makecache

环境

第一节

修改Host

设置主机名和映射

hostnamectl set-hostname controller

编辑/etc/hosts,添加

192.168.119.130 controller
防火墙和selinux

关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl statuc firewalld.service

关闭selinux,修改/etc/sysconfig/selinuxSELINUX=enfoecinf改为SELINUX=disabled,保存,重启才会生效。

时间同步

安装chrony

yum install chrony -y

直接用阿里云的时间服务器,编辑配置文件/etc/chrony.conf

server ntp1.aliyun.com iburst
server ntp2.aliyun.com iburst
allow 192.168.119.130

设置开机启动

systemctl restart chronyd.service
systemctl status chronyd.service
systemctl enable chronyd.service
systemctl list-unit-files |grep chronyd.service

设置时区

timedatectl set-timezone Asia/Shanghai
chronyc sources
timedatectl status

image-1
安装openstack-rocky的仓库,再更新一下缓存

yum install centos-release-openstack-rocky -y
yum clean all
yum makecache

执行yum update -y更新软件。
很慢很慢,更新一半不弄了,太慢了。
然后安装客户端相关软件

yum install python-openstackclient openstack-selinux -y

我觉得可能是源的问题,下载还是慢。

maridadb

yum install mariadb mariadb-server MySQL-python python2-PyMySQL -y

配置密码

mysql_secure_installation

可能会报错

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
Enter current password for root (enter for none): 

因为服务没打开,打开一下就行了。systemctl start/status/stop mariadb.service
编辑配置文件/etc/my.cnf.d/mariadb_openstack.cnf,这里好像需要新建,添加如下内容

[mysqld]
bind-address = 0.0.0.0
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
init-connect = 'SET NAMES utf8'

设置开机自启动

systemctl restart mariadb.service
systemctl status mariadb.service 
systemctl enable mariadb.service 
systemctl list-unit-files |grep mariadb.service

消息队列

安装兔子

yum install rabbitmq-server -y

启动和设置自启动

systemctl start rabbitmq-server.service
systemctl status rabbitmq-server.service
systemctl enable rabbitmq-server.service
systemctl list-unit-files |grep rabbitmq-server.service

创建密码,配置权限

rabbitmqctl add_user openstack openstack
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
rabbitmqctl set_permissions -p "/" openstack ".*" ".*" ".*"

启动插件,重启服务

rabbitmq-plugins list

rabbitmq-plugins enable rabbitmq_management
systemctl restart rabbitmq-server.service
rabbitmq-plugins list
lsof -i:15672

memcache

Keystone

CentOS7安装OpenStack(Rocky版)-02.安装Keyston认证服务组件(控制节点)

创建数据库

CREATE DATABASE KEYSTONE;

授权

GRANT ALL PRIVILEGES ON KEYSTONE.* TO 'keystone'@'localhost' IDENTIFIED BY 'openstack';
GRANT ALL PRIVILEGES ON KEYSTONE.* TO 'keystone'@'%' IDENTIFIED BY 'openstack';

安装,慢死了

yum install openstack-keystone httpd mod_wsgi -y

编辑配置文件/etc/keystone/keystone.conf,修改两处

...
[database]
connection=mysql+pymysql://keystone:openstack@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

然后就是配置httpd,用了这么久终于能用httpd了,编辑/etc/httpd/conf/httpd.conf ,添加ServerName controller
创建快捷方式

ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

启动服务,开机自启动

systemctl start httpd.service
systemctl enable httpd.service

创建keystone服务实体和身份认证服务,不会有回显 ,可以cat /var/log/keystone/keystone.log查看。管理员密码是admin。

keystone-manage bootstrap --bootstrap-password admin --bootstrap-admin-url http://controller:5000/v3/ --bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://contr
  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值