1.2. 配置数据平面节点网络
您必须配置 data plane 节点网络,以适应 Red Hat Ceph Storage 网络要求。
先决条件
- control plane 部署已完成,但尚未修改以使用 Ceph Storage。
- data plane 节点已置备有操作系统。
- data plane 节点可以通过 Ansible 可以使用的 SSH 密钥访问。
- data plane 节点具有可供用作 Ceph OSD 的磁盘。
- 至少三个可用的数据平面节点。Ceph Storage 集群必须至少有三个节点以确保冗余。
流程
创建一个
OpenStackDataPlaneNodeSet
CRD 文件来代表 data plane 节点。注意暂时不要在 Red Hat OpenShift 中创建 CR。
在
configure-os
服务前将ceph-hci-pre
服务添加到列表中,并在run-os
后删除所有其他服务列表。以下是编辑列表的示例:
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet spec: ... services: - download-cache - bootstrap - configure-network - validate-network - install-os - ceph-hci-pre - configure-os - ssh-known-hosts - run-os - reboot-os
注意请注意,您要从列表中删除的服务。您稍后会将它们重新添加到列表中。
-
(可选)
ceph-hci-pre
服务使用edpm_ceph_hci_pre edpm-ansible
角色在网络配置后准备 EDPM 节点来托管 Red Hat Ceph Storage 服务。默认情况下,此角色的edpm_ceph_hci_pre_enabled_services
参数仅包含 RBD、RGW 和 NFS 服务。如果其他服务(如 Dashboard)部署有 HCI 节点;它们必须添加到edpm_ceph_hci_pre_enabled_services
参数列表中。有关此角色的更多信息,请参阅 edpm_ceph_hci_pre 角色。 配置 Red Hat Ceph Storage
cluster_network
,以用于 OSD 之间的存储管理流量。修改 CR 以设置edpm-ansible
变量,以便edpm_network_config
角色配置一个存储管理网络,Ceph 用作cluster_network
。以下示例有 3 个节点。它假定存储管理网络范围为
172.20.0.0/24
,并且它位于VLAN23
上。为cluster_network
添加了粗体行:apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: name: openstack-edpm namespace: openstack spec: env: - name: ANSIBLE_FORCE_COLOR value: "True" networkAttachments: - ctlplane nodeTemplate: ansible: ansiblePort: 22 ansibleUser: cloud-admin ansibleVars: edpm_ceph_hci_pre_enabled_services: - ceph_mon - ceph_mgr - ceph_osd - ceph_rgw - ceph_nfs - ceph_rgw_frontend - ceph_nfs_frontend edpm_fips_mode: check edpm_iscsid_image: {{ registry_url }}/openstack-iscsid:{{ image_tag }} edpm_logrotate_crond_image: {{ registry_url }}/openstack-cron:{{ image_tag }} edpm_network_config_hide_sensitive_logs: false edpm_network_config_os_net_config_mappings: edpm-compute-0: nic1: 52:54:00:1e:af:6b nic2: 52:54:00:d9:cb:f4 edpm-compute-1: nic1: 52:54:00:f2:bc:af nic2: 52:54:00:f1:c7:dd edpm-compute-2: nic1: 52:54:00:dd:33:14 nic2: 52:54:00:50:fb:c3 edpm_network_config_template: | --- {% set mtu_list = [ctlplane_mtu] %} {% for network in nodeset_networks %} {{ mtu_list.append(lookup(vars, networks_lower[network] ~ _mtu)) }} {%- endfor %} {% set min_viable_mtu = mtu_list | max %} network_config: - type: ovs_bridge name: {{ neutron_physical_bridge_name }} mtu: {{ min_viable_mtu }} use_dhcp: false dns_servers: {{ ctlplane_dns_nameservers }} domain: {{ dns_search_domains }} addresses: - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} routes: {{ ctlplane_host_routes }} members: - type: interface name: nic2 mtu: {{ min_viable_mtu }} # force the MAC address of the bridge to this interface primary: true {% for network in nodeset_networks %} - type: vlan mtu: {{ lookup(vars, networks_lower[network] ~ _mtu) }} vlan_id: {{ lookup(vars, networks_lower[network] ~ _vlan_id) }} addresses: - ip_netmask: {{ lookup(vars, networks_lower[network] ~ _ip) }}/{{ lookup(vars, networks_lower[network] ~ _cidr) }} routes: {{ lookup(vars, networks_lower[network] ~ _host_routes) }} {% endfor %} edpm_neutron_metadata_agent_image: {{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }} edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false edpm_selinux_mode: enforcing edpm_sshd_allowed_ranges: - 192.168.122.0/24 - 192.168.111.0/24 edpm_sshd_configure_firewall: true enable_debug: false gather_facts: false image_tag: current-podified neutron_physical_bridge_name: br-ex neutron_public_interface_name: eth0 service_net_map: nova_api_network: internalapi nova_libvirt_network: internalapi storage_mgmt_cidr: "24" storage_mgmt_host_routes: [] storage_mgmt_mtu: 9000 storage_mgmt_vlan_id: 23 storage_mtu: 9000 timesync_ntp_servers: - hostname: pool.ntp.org ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret managementNetwork: ctlplane networks: - defaultRoute: true name: ctlplane subnetName: subnet1 - name: internalapi subnetName: subnet1 - name: storage subnetName: subnet1 - name: tenant subnetName: subnet1 nodes: edpm-compute-0: ansible: host: 192.168.122.100 hostName: compute-0 networks: - defaultRoute: true fixedIP: 192.168.122.100 name: ctlplane subnetName: subnet1 - name: internalapi subnetName: subnet1 - name: storage subnetName: subnet1 - name: storagemgmt subnetName: subnet1 - name: tenant subnetName: subnet1 edpm-compute-1: ansible: host: 192.168.122.101 hostName: compute-1 networks: - defaultRoute: true fixedIP: 192.168.122.101 name: ctlplane subnetName: subnet1 - name: internalapi subnetName: subnet1 - name: storage subnetName: subnet1 - name: storagemgmt subnetName: subnet1 - name: tenant subnetName: subnet1 edpm-compute-2: ansible: host: 192.168.122.102 hostName: compute-2 networks: - defaultRoute: true fixedIP: 192.168.122.102 name: ctlplane subnetName: subnet1 - name: internalapi subnetName: subnet1 - name: storage subnetName: subnet1 - name: storagemgmt subnetName: subnet1 - name: tenant subnetName: subnet1 preProvisioned: true services: - bootstrap - configure-network - validate-network - install-os - ceph-hci-pre - configure-os - ssh-known-hosts - run-os - reboot-os
注意不需要将存储管理网络添加到 networkAttachments 键。
应用 CR:
$ oc apply -f <dataplane_cr_file>
将
<dataplane_cr_file
> 替换为您的文件的名称。注意Ansible 在创建
OpenStackDataPlaneDeployment
CRD 之前,不会配置或验证网络。
-
创建
OpenStackDataPlaneDeployment
CRD,如在 OpenShift 上部署 Red Hat OpenStack Services on OpenShift 指南中的创建 data plane 所述,它定义了OpenStackDataPlaneNodeSet
CRD 文件,以便 Ansible 配置 data plane 节点上的服务。 要确认网络配置,请完成以下步骤:
- SSH 到数据平面节点。
-
使用
ip a
命令显示配置网络。 - 确认存储网络位于配置网络列表中。
1.2.1. Red Hat Ceph Storage MTU 设置
此流程中的示例将 storage 和 storage_mgmt 网络的 MTU 从 1500 改为 9000。MTU 9000 称为巨型帧。尽管不强制提高 MTU,但使用巨型帧来提高存储性能。如果使用巨型帧,则必须将数据路径中的所有网络交换机端口配置为支持巨型帧。还必须为使用 OpenShift 上运行的存储网络的服务进行 MTU 更改。
要更改连接到 data plane 节点的 OpenShift 服务的 MTU,请更新基本接口和 VLAN 接口的节点网络配置策略(NNCP)。如果主 NAD 接口已具有所需的 MTU,则不需要更新网络附加定义(NAD)。如果底层接口的 MTU 设为 9000,但没有为其顶部的 VLAN 接口指定它,那么它将默认为底层接口中的值。
如果 MTU 值不一致,则问题可能会导致 Red Hat Ceph Storage 集群无法访问仲裁,或者不支持使用 CephX 协议进行身份验证。如果 MTU 已更改,并且您观察到这些类型的问题,请验证使用巨型帧的网络的所有主机都可以与 ping 命令进行通信,例如:
$ ping -M do -s 8972 172.20.0.100