27.3.4.2.7. 示例:OpenShift Logging 和 Metrics 聚合模式
在清单文件中,在
[OSEv3:vars]
部分中设置以下变量,并根据您的配置需要调整它们:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1 2 3 5 6 7
- 建议您在专用于"infrastructure"应用程序的节点上运行集成的 OpenShift Container Registry、日志记录和指标,它们是管理员为 OpenShift Container Platform 集群提供服务的应用程序。
- 4 10
- 指定用于日志记录和指标的 StorageClass。这个名称由目标 GlusterFS 集群的名称生成(如
glusterfs-<name>-block
)。在本例中,默认为registry
。 - 8
- OpenShift Logging 要求指定 PVC 大小。提供的值只是一个示例,而不是推荐。
- 9
- 如果使用 Persistent Elasticsearch Storage,请将存储类型设置为
pvc
。
注意如需了解有关它们和其他变量的详细信息,请参阅 GlusterFS 角色 README。
在
[OSEv3: Child]
部分添加glusterfs_registry
来启用[glusterfs_registry]
组:[OSEv3:children] masters nodes glusterfs_registry
[OSEv3:children] masters nodes glusterfs_registry
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 添加
[glusterfs_registry]
部分,其中包含托管 GlusterFS 存储的每个存储节点的条目。对于每个节点,将glusterfs_devices
设置为作为 GlusterFS 集群一部分完全管理的原始块设备列表。必须至少列出一个设备。每个设备都必须是空的,没有分区或 LVM PV。以以下形式指定变量:<hostname_or_ip> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'
<hostname_or_ip> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
[glusterfs_registry] node11.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]' node12.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]' node13.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
[glusterfs_registry] node11.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]' node12.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]' node13.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
[glusterfs_registry]
下列出的主机添加到[nodes]
组中:[nodes] ... node11.example.com openshift_node_group_name="node-config-infra" node12.example.com openshift_node_group_name="node-config-infra" node13.example.com openshift_node_group_name="node-config-infra"
[nodes] ... node11.example.com openshift_node_group_name="node-config-infra" node12.example.com openshift_node_group_name="node-config-infra" node13.example.com openshift_node_group_name="node-config-infra"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意前面的步骤仅提供一些必须添加到清单文件中的选项。使用完整清单文件来部署红帽 Gluster 存储。
切换到 playbook 目录并运行安装 playbook。将清单文件的相对路径作为选项提供。
对于新的 OpenShift Container Platform 安装:
cd /usr/share/ansible/openshift-ansible ansible-playbook -i <path_to_inventory_file> playbooks/prerequisites.yml ansible-playbook -i <path_to_inventory_file> playbooks/deploy_cluster.yml
$ cd /usr/share/ansible/openshift-ansible $ ansible-playbook -i <path_to_inventory_file> playbooks/prerequisites.yml $ ansible-playbook -i <path_to_inventory_file> playbooks/deploy_cluster.yml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于现有 OpenShift Container Platform 集群安装:
cd /usr/share/ansible/openshift-ansible ansible-playbook -i <path_to_inventory_file> playbooks/openshift-glusterfs/config.yml
$ cd /usr/share/ansible/openshift-ansible $ ansible-playbook -i <path_to_inventory_file> playbooks/openshift-glusterfs/config.yml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow