安装数据库:Controller

官方文档:https://docs.openstack.org/install-guide/environment-sql-database.html

1. 安装相关包:

mariadb mariadb-server python2-PyMySQL

2. 创建编辑/etc/my.cnf.d/openstack.cnf文件

[root@controller ~]# touch /etc/my.cnf.d/openstack.cnf
[root@controller ~]# vim /etc/my.cnf.d/openstack.cnf
复制粘贴下方数据 
 [mysqld]
 bind-address = 192.168.100.10 // 绑定IP地址选择管理网络IP地址
 default-storage-engine = innodb
 innodb_file_per_table = on
 max_connections = 4096
 collation-server = utf8_general_ci
 character-set-server = utf8

3. 启动数据库

systemctl enable mariadb && systemctl start mariadb

4. 创建root账户密码

执行mysql_secure_installation

5. 测试验证

 mysql -uroot -h<绑定的ip> -p000000

安装消息队列:控制节点

(当然也可以安装在其他的系统上)
官方文档:https://docs.openstack.org/install-guide/environment-messaging-rdo.html
OpenStack uses a message queue to coordinate operations and status information among services. The message queue service typically runs on the controller node. OpenStack supports several message queue services including RabbitMQQpid, and ZeroMQ. However, most distributions that package OpenStack support a particular message queue service. This guide implements(执行,实施) the RabbitMQ message queue service because most distributions support it. If you prefer to implement a different message queue service, consult the documentation associated with it.

1. 安装包:

yum install rabbitmq-server

2. 启动服务

 systemctl enable rabbitmq-server.service && systemctl start rabbitmq-server.service

3. 添加openstack用户(密码为openstack)

(注意这里是消息队列服务的用户名和密码)
 rabbitmqctl add_user openstack openstack  

4. 对openstack进行授权(rwx)

 rabbitmqctl set_permissions openstack ".*" ".*" ".*"

5. 检查项:检查默认监听的5672端口<br />

[root@controller ~]# lsof -i:5672
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
beam.smp 974 rabbitmq   55u  IPv6  22985      0t0  TCP *:amqp (LISTEN)

安装缓存服务:控制节点

官方文档:https://docs.openstack.org/install-guide/environment-memcached-rdo.html
目的是缓存我们服务之间的token,每个服务之间相互访问都会携带账户和密码,而账户和密码会生成token

因为这里我们不适用redis,是因为这里数据并不是很多,并且memcached使用简单

1.安装包:

yum install memcached python-memcached

2.编辑/etc/sysconfig/memcached配置文件,启用其他节点的访问。

vim /etc/sysconfig/memcached

 OPTIONS="-l 127.0.0.1,::1,controller"
 

3.启动缓存服务

systemctl enable memcached.service && systemctl start memcached.service
 

4. 检查项:检查默认监听的11211端口

ss -tanl | grep 11211

 

安装ETCD服务:控制节点

OpenStack services may use Etcd, a distributed reliable key-value store for distributed key locking, storing configuration, keeping track of service live-ness and other scenarios.
存贮配置和探针,特性能够同台更新配置文件,而不用重启服务。

1. 安装包:etcd

 yum install etcd

2. 编辑/etc/etcd/etcd.conf配置文件,启用其他节点的访问

[root@controller yum.repos.d]# cat /etc/etcd/etcd.conf | grep -Ev "^$|^#"
 # 成员配置
 ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
 ETCD_LISTEN_PEER_URLS="http://192.168.100.10:2380"
 ETCD_LISTEN_CLIENT_URLS="http://192.168.100.10:2379"
 ETCD_NAME="controller"
 # 机群配置 
 ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.10:2380"
 ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.10:2379"
 ETCD_INITIAL_CLUSTER="controller=http://192.168.100.10:2380"
 ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
 ETCD_INITIAL_CLUSTER_STATE="new"

3. 启动etcd服务

 systemctl enable etcd && systemctl start etcd

4. 检查项:默认的2379和2380端口

[root@controller ~]# ss -tanl  | grep 2379
LISTEN     0      128    192.168.100.10:2379                     *:*                  
[root@controller ~]# ss -tanl  | grep 2380
LISTEN     0      128    192.168.100.10:2380                     *:*         

注释

<注释1>

Linux touch命令用于修改文件或者目录的时间属性,包括存取时间和更改时间。若文件不存在,系统会建立一个新的文件。

<注释2>

在终端下输入lsof即可显示系统打开的文件,因为 lsof 需要访问核心内存和各种文件,所以必须以 root 用户的身份运行它才能够充分地发挥其功能。

<注释3>

ss命令可以用来获取socket统计信息,它可以显示和netstat类似的内容。https://blog.csdn.net/weixin_42816196/article/details/86580834

最后修改:2024 年 03 月 14 日
如果觉得我的文章对你有用,请随意赞赏