简介
OpenStack系统由几个单独安装的关键服务组成。这些服务根据需求协同工作,包括计算、身份、网络、图像、块存储、对象存储、遥测、编排和数据库服务。
部署版本:pike
部署环境:CentOS7.6
配置文件中所有controller可修改为控制节点ip地址
配置过程中使用 echo $?
验证命令执行情况
部署前可以修改hosts文件配置控制节点IP为controller
部署前准备
SQL配置
数据库:MariaDB
一、安装和配置组件
1.安装MariaDB相关软件
[root@controller ~]# yum install mariadb mariadb-server python2-PyMySQL
2.创建/etc/my.cnf.d/openstack.cnf文件并编辑
创建[mysqld]部分,并将绑定地址密钥设置为控制器节点的管理IP地址,以允许其他节点通过管理网络进行访问。
[root@controller ~]# vi /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
3.启动服务与开机自启
[root@controller ~]# systemctl enable mariadb.service
[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# echo $?
0
4.通过运行mysql_Secure_installation安装脚本来保护数据库服务并设置密码
[root@controller ~]# mysql_secure_installation
按照提示进行安装并设置合适的密码
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'controller'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Message queue消息队列配置
OpenStack使用消息队列来协调服务之间的操作和状态信息,通常在控制节点上运行
消息队列服务:RabbitMQ
一、安装和配置组件
1.需要先安装epel源(若无法安装可能是源的问题)
[root@controller ~]# yum -y install epel-release
[root@controller ~]# yum install socat
2.安装rabbitmq-server软件
[root@controller ~]# yum install rabbitmq-server
3.启动服务与开机自启
[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# echo $?
0
[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# echo $?
0
4.添加OpenStack用户
[root@controller ~]# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack" ...
...done.
5.允许openstack用户进行配置、写入和读取访问:
[root@controller ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...
...done.
Memcached缓存
服务的身份服务身份验证机制使用Memcached来缓存令牌。memcached服务通常在控制器节点上运行。
一、安装和配置组件
1.安装memcached软件
[root@controller ~]# yum install memcached python-memcached
2.编辑/etc/sysconfig/memcached文件
[root@controller ~]# vi /etc/sysconfig/memcached
将服务配置为使用控制器节点的管理IP地址
OPTIONS="-l 127.0.0.1,::1,controller"
3.启动服务与开机自启
[root@controller ~]# systemctl start memcached.service
[root@controller ~]# echo $?
0
[root@controller ~]# systemctl enable memcached.service
[root@controller ~]# echo $?
0
Etcd
OpenStack服务可能会使用Etcd,这是一种分布式可靠密钥值存储,用于分布式密钥锁定、存储配置、跟踪服务活动和其他场景。
一、安装和配置组件
1.安装Etcd软件
[root@controller ~]# yum install etcd
2.编辑/etc/etcd/etcd.conf文件,并将ETCD_INITIAL_集群、ETCD_INITIAL_advision_PEER_URL、ETCD_advision_CLIENT_URL、ETCD_LISTEN_CLIENT_URL设置为控制器节点的管理IP地址,以允许其他节点通过管理网络进行访问:文章来源:https://www.toymoban.com/news/detail-404393.html
[root@controller ~]# vi /etc/etcd/etcd.conf
#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://controller:2380"
ETCD_LISTEN_CLIENT_URLS="http://controller:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://controller:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://controller:2379"
ETCD_INITIAL_CLUSTER="controller=http://controller:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"
3.启动服务与开机自启文章来源地址https://www.toymoban.com/news/detail-404393.html
[root@controller ~]# systemctl enable etcd
[root@controller ~]# echo $?
0
[root@controller ~]# systemctl start etcd
[root@controller ~]# echo $?
0
到了这里,关于OpenStack部署(一)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!