实验前提

  1. 该实验基于VMwareworkstation 17.0。
  2. 使用发行版本为centos7,最小化安装。
  3. 环境中使用两台虚拟机,双网卡配置。
  4. 密码规划:本实验所有密码皆使用redhat
  5. 本实验基于模板机搭建,如果有基础的朋友,可以选择自己创建
  6. 实验使用远程连接软件MobaXterm

实验规划

主机名

IP-外网

IP-内网

角色

配置

control

192.168.96.20

192.168.113.20

控制节点

8G+4核

compute

192.168.96.21

192.168.113.21

计算节点

8G+4核


创建模板机

模板机配置

手动搭建openstack基础环境(T版,极其详细,千万别错过)_基础


时区选择上海

磁盘分区采用自动分区

安装选用最小化安装



关闭防火墙

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Bash


关闭selinux

[root@localhost ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disbaled #将此行修改为disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

手动搭建openstack基础环境(T版,极其详细,千万别错过)_T版_02text




清除machine-id

[root@localhost ~]# cat /etc/machine-id
078975d83c0b49858379dff185649b58
[root@localhost ~]# echo "" > /etc/machine-id
[root@localhost ~]# cat /etc/machine-id

Bash




清除网卡配置文件

[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vi ifcfg-ens32
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
NAME="ens32"
DEVICE="ens32"
ONBOOT="yes"

Bash


关机并克隆

[root@localhost network-scripts]# init 0

建议在关机后拍个快照,以免以后误触

关机后,将模板机克隆成control和compute机器

手动搭建openstack基础环境(T版,极其详细,千万别错过)_centos_03


注意要创建完整克隆而不是链接克隆



系统环境配置

给虚拟机添加第二张网卡后开机,并且将网络适配器2设置为仅主机模式

修改用户名

控制节点
[root@localhost ~]# hostnamectl set-hostname control
[root@localhost ~]# bash
bash
[root@control ~]#

计算节点
[root@localhost ~]# hostnamectl set-hostname compute
[root@localhost ~]# bash
[root@compute ~]#

Bash




修改ip

控制节点

[root@control network-scripts]# vi ifcfg-ens32
TYPE="Ethernet"
BOOTPROTO=NONE
DEFROUTE="yes"
NAME="ens32"
DEVICE="ens32"
ONBOOT="yes"
IPADDR=192.168.96.20
NETMASK=255.255.255.0
DNS1=192.168.96.2
DNS2=114.114.114.114
GATEWAY=192.168.96.2

Bash


进入/etc/sysconfig/network-scripts后

如果遇到没有新添加网卡的配置文件的情况,直接将原本网卡复制并修改为新网卡名即可,可以手动修改参数

[root@control network-scripts]# cp ifcfg-ens32 ifcfg-ens33
[root@control network-scripts]# vi ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO=static
DEFROUTE="yes"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.113.20
NETMASK=255.255.255.0
DNS=192.168.113.2

[root@control ~]# systemctl restart network

text


此处网关可以不配。

如果你是在远程连接上修改的ip,在重启network服务后,远程连接需要重新连接



关闭NetworkManager服务
[root@control ~]# systemctl stop NetworkManager
[root@control ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

Bash


验证网络是否通畅
[root@control network-scripts]# ping -c 3 bilibili.com
PING bilibili.com (8.134.50.24) 56(84) bytes of data.
64 bytes from 8.134.50.24 (8.134.50.24): icmp_seq=1 ttl=128 time=27.4 ms
64 bytes from 8.134.50.24 (8.134.50.24): icmp_seq=2 ttl=128 time=29.1 ms
64 bytes from 8.134.50.24 (8.134.50.24): icmp_seq=3 ttl=128 time=29.5 ms

--- bilibili.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2028ms
rtt min/avg/max/mdev = 27.428/28.702/29.500/0.931 ms




本机ping虚拟机

正在192.168.113.20 具有 32字节的数据:
来自192.168.113.20 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.20 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.20 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.20 的回复: 字节=32时间<1ms TTL=64

192.168.113.20 的 Ping 统计信息:
数据包: 已发送 = 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短=,最长 =,平均 = 0ms

Bash




计算节点

[root@compute network-scripts]# vi ifcfg-ens32

TYPE="Ethernet"
BOOTPROTO=NONE
DEFROUTE="yes"
NAME="ens32"
DEVICE="ens32"
ONBOOT="yes"
IPADDR=192.168.96.21
NETMASK=255.255.255.0
DNS1=192.168.96.2
DNS2=114.114.114.114
GATEWAY=192.168.96.2

Bash




[root@compute network-scripts]# cp ifcfg-ens32 ifcfg-ens33
[root@compute network-scripts]# vi ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO=static
DEFROUTE="yes"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.113.21
NETMASK=255.255.255.0
DNS=192.168.113.2
[root@compute network-scripts]# systemctl restart network

Bash




关闭NetworkManager服务
[root@compute ~]# systemctl stop NetworkManager
[root@compute ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

text


验证网络是否通畅
[root@compute ~]# ping -c 3 bilibili.com
PING bilibili.com (139.159.241.37) 56(84) bytes of data.
64 bytes from ecs-139-159-241-37.compute.hwclouds-dns.com (139.159.241.37): icmp_seq=1 ttl=128 time=24.7 ms
64 bytes from ecs-139-159-241-37.compute.hwclouds-dns.com (139.159.241.37): icmp_seq=2 ttl=128 time=24.4 ms
64 bytes from ecs-139-159-241-37.compute.hwclouds-dns.com (139.159.241.37): icmp_seq=3 ttl=128 time=24.1 ms

--- bilibili.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2012ms
rtt min/avg/max/mdev = 24.166/24.455/24.788/0.313 ms




本机ping虚拟机

正在192.168.113.21 具有 32字节的数据:
来自192.168.113.21 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.21 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.21 的回复: 字节=32时间<1ms TTL=64
来自192.168.113.21 的回复: 字节=32时间<1ms TTL=64

192.168.113.21 的 Ping 统计信息:
数据包: 已发送 = 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短=,最长 =,平均 = 0ms

Bash




配置主机名解析

控制节点

[root@control ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.113.20 control
192.168.113.21 compute

测试
[root@control ~]# ping -c 3 compute
PING compute (192.168.113.21) 56(84) bytes of data.
64 bytes from compute (192.168.113.21): icmp_seq=1 ttl=64 time=0.818 ms
64 bytes from compute (192.168.113.21): icmp_seq=2 ttl=64 time=2.28 ms
64 bytes from compute (192.168.113.21): icmp_seq=3 ttl=64 time=0.603 ms

--- compute ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2022ms
rtt min/avg/max/mdev = 0.603/1.235/2.284/0.746 ms

text


计算节点

[root@control ~]# scp /etc/hosts root@compute:/etc/hosts
The authenticity of host 'compute (192.168.113.21)' can't be established.
ECDSA key fingerprint is SHA256:q22s7C3f6AgQ4W7SzbkdWCHWaIMtHAHkv7uD3Bwx4rE.
ECDSA key fingerprint is MD5:5a:77:4f:4c:16:4e:75:ae:fe:a4:58:2e:74:12:69:ab.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'compute,192.168.113.21' (ECDSA) to the list of known hosts.
root@compute's password:
hosts 100% 206 35.4KB/s 00:00

你也可以去计算节点配,这里我使用scp命令直接将控制节点的hosts文件复制传输并覆盖了计算节点的hosts文件。
测试
[root@compute ~]# ping -c 3 control
PING control (192.168.113.20) 56(84) bytes of data.
64 bytes from control (192.168.113.20): icmp_seq=1 ttl=64 time=0.547 ms
64 bytes from control (192.168.113.20): icmp_seq=2 ttl=64 time=0.394 ms
64 bytes from control (192.168.113.20): icmp_seq=3 ttl=64 time=5.53 ms

--- control ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2010ms
rtt min/avg/max/mdev = 0.394/2.157/5.531/2.386 ms

Bash

当两台主机的网络都通了,接下来如何做?

关机,拍快照

为什么要拍快照?

当你后续操作有问题,但你自己不会修改怎么办?重新配一台虚拟机,显然不可能,所以直接快照回返,从网络互通开始,更加省时省力。



配置yum仓库

由于centos7的源已经过期了,那么怎么办?

使用阿里云的源

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站 (aliyun.com)

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

text


全部节点都需要执行

[root@control ~]# yum clean all ; yum makecache
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/10): base/7/x86_64/primary_db | 6.1 MB 00:00:00
(3/10): base/7/x86_64/filelists_db | 7.2 MB 00:00:01
(4/10): extras/7/x86_64/primary_db | 253 kB 00:00:00
(5/10): extras/7/x86_64/filelists_db | 305 kB 00:00:00
(6/10): extras/7/x86_64/other_db | 154 kB 00:00:00
(7/10): base/7/x86_64/other_db | 2.6 MB 00:00:00
(8/10): updates/7/x86_64/filelists_db | 15 MB 00:00:02
(9/10): updates/7/x86_64/other_db | 1.6 MB 00:00:00
(10/10): updates/7/x86_64/primary_db | 27 MB 00:00:03
Metadata Cache Created

Bash




安装基础软件包(全部节点执行)

yum install -y vim net-tools bash-completion chrony.x86_64 centos-release-openstack-train httpd

Bash




配置chronyd服务

控制节点

[root@control ~]# vim /etc/chrony.conf
server ntp.aliyun.com iburst
[root@control ~]# systemctl restart chronyd
[root@control ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88 2 6 17 1 -59us[ -489us] +/- 25ms

Bash


计算节点

[root@compute ~]# vim /etc/chrony.conf
server control iburst
[root@compute ~]# systemctl restart chronyd
[root@compute ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* control 3 6 7 1 +66us[ +793us] +/- 33ms

Bash




配置openstack仓库【全部节点】

将安装centos-release-openstack-train 产生的所有.repo文件删除,重新按照以下内容配置

[queens]
name=queens
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/cloud/x86_64/openstack-queens/
enabled=1
gpgcheck=0
[rocky]
name=rocky
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/cloud/x86_64/openstack-rocky/
enabled=1
gpgcheck=0
[stein]
name=stein
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/cloud/x86_64/openstack-stein/
enabled=1
gpgcheck=0
[train]
name=train
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/cloud/x86_64/openstack-train/
enabled=1
gpgcheck=0

YAML


安装

[root@control yum.repos.d]# yum install python-openstackclient -y

text


安装OpenStack-selinux软件包【全部节点】

[root@compute yum.repos.d]# yum install -y openstack-selinux

Bash






安装MariaDB数据库

只需在控制节点上执行

[root@control yum.repos.d]# yum install mariadb-server python2-PyMySQL

text


mariadb-server:数据库服务端

python2-PyMySQL:数据库管理接口



新建配置文件,名字任意,但必须以.conf 结尾

[mysqld]
bind-address = 192.168.96.20 #MySQL 服务器监听的 IP 地址
default-storage-engine = innodb #默认的存储引擎。在这里,它被设置为 InnoDB
innodb_file_per_table = on #启用了 InnoDB 存储引擎的 file-per-table 特性,允许每个表有自己的 .ibd 文件。这有助于更好地管理表的空间使用,并且在删除表时可以更快地释放空间
max_connections = 4096 #MySQL 服务器可以同时处理的最大客户端连接数
collation-server = utf8_general_ci #服务器级别的默认校对规则,这里使用的是 utf8 字符集的 general 校对规则,并且不区分大小写(ci 表示 case-insensitive)
character-set-server = utf8 #服务器级别的默认字符集

Ini


配置服务开机自启

[root@control ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

Bash




初始化数据库

[root@control ~]# 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 是否设置数据库的 root 密码 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 是否删除匿名用户 Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n 是否禁用 root 的远程登录
 ... skipping.

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 是否现在刷新表权限 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!

Markdown






安装消息队列【仅控制节点】



[root@control ~]# yum install rabbitmq-server -y

text




启动服务,并开机自启

[root@control ~]# systemctl enable --now rabbitmq-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.

Bash




添加一个用户“example01” 密码是redhat

[root@control ~]# rabbitmqctl add_user example01 redhat
Creating user "example01"

text


为rabbitmq用户授予对消息队列中所有资源的权限

[root@control ~]# rabbitmqctl set_permissions example01 ".*" ".*" ".*"
Setting permissions for user "example01" in vhost "/"




".*":第一个".*"表示该用户对所有虚拟主机(vhost)拥有权限。如果只想授予特定虚拟主机的权限,可以替换为具体的虚拟主机名称,如 myvhost。

".*":第二个".*"表示该用户对所有配置(如交换机和队列绑定)拥有权限。配置权限允许用户创建、删除和查询交换机和队列。

".*":第三个".*"表示该用户对所有消息操作(如发送和接收消息)拥有权限。消息权限允许用户在队列上执行读写操作

Bash




RabbitMQ 是一个开源的消息代理软件,用于实现消息队列,使用 AMQP(高级消息队列协议)来进行消息的交换和传输,RabbitMQ 默认情况下使用两个端口号:25672和15672。默认仅开启 25672 端口,该端口通常用于内部节点通信,而不是作为客户端连接的端口。而 15672 端口是 RabbitMQ 的 Web 管理界面的默认端口。通过浏览器访问http://<RabbitMQ服务器IP地址>:15672,可以打开RabbitMQ 的管理控制台。管理员可以使用这个界面来监视、管理和配置 RabbitMQ 实例,包括管理队列、交换机、绑定、用户、权限等。

开启15672端口

查看rabbit功能

[root@control ~]# rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@control
 |/
[ ] amqp_client 3.6.16
[ ] cowboy 1.0.4
[ ] cowlib 1.0.2
[ ] rabbitmq_amqp1_0 3.6.16
[ ] rabbitmq_auth_backend_ldap 3.6.16
[ ] rabbitmq_auth_mechanism_ssl 3.6.16
[ ] rabbitmq_consistent_hash_exchange 3.6.16
[ ] rabbitmq_event_exchange 3.6.16
[ ] rabbitmq_federation 3.6.16
[ ] rabbitmq_federation_management 3.6.16
[ ] rabbitmq_jms_topic_exchange 3.6.16
[ ] rabbitmq_management 3.6.16
[ ] rabbitmq_management_agent 3.6.16
[ ] rabbitmq_management_visualiser 3.6.16
[ ] rabbitmq_mqtt 3.6.16
[ ] rabbitmq_random_exchange 3.6.16
[ ] rabbitmq_recent_history_exchange 3.6.16
[ ] rabbitmq_sharding 3.6.16
[ ] rabbitmq_shovel 3.6.16
[ ] rabbitmq_shovel_management 3.6.16
[ ] rabbitmq_stomp 3.6.16
[ ] rabbitmq_top 3.6.16
[ ] rabbitmq_tracing 3.6.16
[ ] rabbitmq_trust_store 3.6.16
[ ] rabbitmq_web_dispatch 3.6.16
[ ] rabbitmq_web_mqtt 3.6.16
[ ] rabbitmq_web_mqtt_examples 3.6.16
[ ] rabbitmq_web_stomp 3.6.16
[ ] rabbitmq_web_stomp_examples 3.6.16
[ ] sockjs 0.3.4

Bash




开启webUI界面

[root@control ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
 amqp_client
 cowlib
 cowboy
 rabbitmq_web_dispatch
 rabbitmq_management_agent
 rabbitmq_management

Applying plugin configuration to rabbit@control... started 6 plugins.
[root@control ~]# rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@control
 |/
[e*] amqp_client 3.6.16
[e*] cowboy 1.0.4
[e*] cowlib 1.0.2
[ ] rabbitmq_amqp1_0 3.6.16
[ ] rabbitmq_auth_backend_ldap 3.6.16
[ ] rabbitmq_auth_mechanism_ssl 3.6.16
[ ] rabbitmq_consistent_hash_exchange 3.6.16
[ ] rabbitmq_event_exchange 3.6.16
[ ] rabbitmq_federation 3.6.16
[ ] rabbitmq_federation_management 3.6.16
[ ] rabbitmq_jms_topic_exchange 3.6.16
[E*] rabbitmq_management 3.6.16
[e*] rabbitmq_management_agent 3.6.16
[ ] rabbitmq_management_visualiser 3.6.16
[ ] rabbitmq_mqtt 3.6.16
[ ] rabbitmq_random_exchange 3.6.16
[ ] rabbitmq_recent_history_exchange 3.6.16
[ ] rabbitmq_sharding 3.6.16
[ ] rabbitmq_shovel 3.6.16
[ ] rabbitmq_shovel_management 3.6.16
[ ] rabbitmq_stomp 3.6.16
[ ] rabbitmq_top 3.6.16
[ ] rabbitmq_tracing 3.6.16
[ ] rabbitmq_trust_store 3.6.16
[e*] rabbitmq_web_dispatch 3.6.16
[ ] rabbitmq_web_mqtt 3.6.16
[ ] rabbitmq_web_mqtt_examples 3.6.16
[ ] rabbitmq_web_stomp 3.6.16
[ ] rabbitmq_web_stomp_examples 3.6.16
[ ] sockjs 0.3.4
Bash

浏览器输入http://192.168.96.20:15672

手动搭建openstack基础环境(T版,极其详细,千万别错过)_基础_04


手动搭建openstack基础环境(T版,极其详细,千万别错过)_基础_05




配置Memcached 缓存服务

Memcached可以大大提高云计算平台的数据转发效率,重要的基础服务之一

安装软件包

[root@control ~]# yum install memcached python-memcached -y

Bash


memcached:管理服务

python-memcached :服务接口管理



[root@control ~]# vim /etc/sysconfig/memcached
[root@control ~]# cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1, control "

Bash


添加控制节点主机名

启动服务并查看端口是否开启

[root@control ~]# systemctl enable --now memcached.service
Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service to /usr/lib/systemd/system/memcached.service.
[root@control ~]# ss -tunlp | grep 11211
tcp LISTEN 0 128 192.168.113.20:11211 *:* users:(("memcached",pid=5348,fd=28))
tcp LISTEN 0 128 127.0.0.1:11211 *:* users:(("memcached",pid=5348,fd=26))
tcp LISTEN 0 128 [::1]:11211 [::]:* users:(("memcached",pid=5348,fd=27))

Bash




安装ETCD分布式存储系统【仅控制节点】

用于组件的注册和服务发现

[root@control ~]# yum install etcd -y

Bash




修改配置文件

vim /etc/etcd/etcd.conf

将以下内容去除注释,并且修改ip和name

ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.100.167:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.100.167:2379"
ETCD_NAME="controller"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.100.167:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.100.167:2379"
ETCD_INITIAL_CLUSTER="cnotallow=http://192.168.100.167:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"

Bash


启动服务

[root@control ~]# systemctl enable --now etcd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /usr/lib/systemd/system/etcd.service.

Bash