一、构建实验:IdentityService(keystone)在controller节点安装和配置认证服务(实验专题)
### --- (controller节点)keystone部署:基础环境配置环境
~~~ yum源更新完成之后,yum官方的配置文件会重新覆盖在yum.repos.d目录下,
~~~ 再次重新放在bak目录下
[root@controller ~]# mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/back/
[root@controller ~]# yum clean all
### --- 为controller节点安装数据库
~~~ 安装mariadb软件包
[root@controller ~]# yum install -y mariadb mariadb-server MySQL-python
Installed:
MySQL-python.x86_64 0:1.2.3-11.el7 mariadb.x86_64 1:5.5.37-1.el7_0 mariadb-server.x86_64 1:5.5.37-1.el7_0
Dependency Installed:
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBD-MySQL.x86_64 0:4.023-5.el7 perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7
Complete!
~~~ 编辑/etc/my.cnf软件,设置绑定IP,默认数据库引擎及默认字符集为UTF-8
[root@controller ~]# vim /etc/my.cnf
[mysqld]
bind-address = 192.168.222.5
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 start mariadb.service
[root@controller ~]# systemctl enable mariadb.service
~~~ 初始化数据库脚本
[root@controller ~]# mysql_secure_installation
Enter current password for root (enter for none): // 直接回车
Set root password? [Y/n] y // 是否设置root密码
New password: // 123456
Re-enter new password: // 123456
Remove anonymous users? [Y/n] y // 是否要移除匿名用户
Disallow root login remotely? [Y/n] y // 是否禁止远程登录,尽运行本地登录
Remove test database and access to it? [Y/n] y // 是否移除测试数据库
Reload privilege tables now? [Y/n] y // 是否刷新权限
[root@controller ~]# mysql -u root -p
Enter password: 123456
MariaDB [(none)]> exit
### --- 安装Messaing Server服务
~~~ 功能:协调操作和状态信息服务
~~~ 常用的消息代理软件
RabbitMQ:openstack官方推荐使用
Qpid
ZeroMQ
~~~ 在controller节点安装RabbitMQ
~~~ 安装RabbitMQ软件包
[root@controller ~]# yum install -y rabbitmq-server
~~~ 启动服务并设置为开机自启动
[root@controller ~]# systemctl enable rabbitmq-server
[root@controller ~]# systemctl start rabbitmq-server
~~~ rabbitmq默认用户名和密码是guest,可以通过下列命令修改
~~~ 使用默认密码即可,若想修改可以修改下,此环境不修改
[root@controller ~]# rabbitmqctl change_password guest new_password
### --- 配置时间同步服务器
[root@controller ~]# yum install -y ntp
[root@compute ~]# vim /etc/ntp.conf
restrict 192.168.222.0 mask 255.255.255.0 nomodify notrap
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 10
[root@controller ~]# systemctl start ntpd.service
[root@controller ~]# systemctl enable ntpd.service
[root@controller ~]# ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
### --- DNS解析添加,测试环境推荐使用hosts文件
[root@controller ~]# vim /etc/hosts
192.168.222.5 controller.nice.com
192.168.222.6 network.nice.com
192.168.222.10 compute1.nice.com
192.168.222.20 b