hpcpilot配置文件详解:setting.ini和hostname.csv配置技巧
hpcpilot配置文件详解:setting.ini和hostname.csv配置技巧
【免费下载链接】hpcpilotA collection of HPC delivery tools, including basic system configuration, node inspection, performance testing, third-party service installation, etc.项目地址: https://gitcode.com/openeuler/hpcpilot
前往项目官网免费下载:https://ar.openeuler.org/ar/
hpcpilot是openEuler社区推出的HPC交付工具集合,提供基础系统配置、节点检查、性能测试和第三方服务安装等核心功能。本文将详细介绍hpcpilot中两个关键配置文件——setting.ini和hostname.csv的配置技巧,帮助用户快速掌握系统部署的核心要点。
一、全局配置核心:setting.ini文件解析
setting.ini位于项目的hpc_script目录下,是hpcpilot的核心配置文件,包含全局参数、基础配置、服务设置等关键信息。文件采用INI格式,通过 sections(如[common_global_conf])和 key=value 键值对组织配置项。
1.1 基础配置区域([basic_conf])
该区域定义系统基础网络和存储参数,是部署的核心配置:
- basic_om_master_ip:hpcpilot自动化工具执行节点IP地址(必填)
- basic_shared_directory:共享存储客户端挂载目录(默认:/share)
- basic_share_storage_ip:存储服务端IP地址(与执行节点可同一)
- basic_network_type:网络类型标识(1=IB/2=RoCE/3=TCP,默认3)
配置示例:
[basic_conf] basic_om_master_ip = 9.88.49.47 basic_shared_directory = /share basic_share_storage_ip = 9.88.49.47 basic_network_type = 31.2 系统服务配置([service_conf])
集中管理NTP和LDAP等关键服务参数:
- ntp_server_ip:时间同步服务器地址(如9.88.49.42)
- ldap_login_password:LDAP管理员密码(默认huawei@123)
- master_ldap_server_ip:LDAP主节点IP(HA模式必填)
⚠️ 注意:LDAP的HA部署需额外配置slave_ldap_server_ip和virtual_ldap_server_ip参数
1.3 配置文件校验机制
系统脚本会自动校验setting.ini的完整性,例如:
- auto_init_script.sh会检查文件是否存在:
if [ ! -f "${base_directory}/setting.ini" ]; then log_error "file does not exist." - pre_install.sh会验证共享目录一致性:
inconsistent with setting.ini [${share_hpc_dir}], please check
二、节点管理关键:hostname.csv配置指南
hostname.csv采用CSV格式存储节点网络信息,位于hpc_script目录,是批量部署的基础配置。文件首行为表头,包含6个字段:
| 字段名 | 说明 | 是否必填 |
|---|---|---|
| host_ip | 节点管理IP | 是 |
| host_name | 主机名 | 是 |
| host_group | 节点分组(如ldap_client) | 是 |
| host_expansion | 扩展标记 | 否 |
| host_compute_ip | 计算网IP | 否 |
| host_storage_ip | 存储网IP | 否 |
2.1 典型配置示例
host_ip,host_name,host_group,host_expansion,host_compute_ip,host_storage_ip 9.88.49.40,arm40,ldap_client,0,23.1.1.1,23.1.1.2 9.88.49.42,arm42,ntp_server,0,23.1.1.3,23.1.1.4 9.88.49.45,arm45,ntp_client,02.2 分组配置技巧
- ntp_server:仅需配置1台,作为时间源
- ldap_client:所有需要接入LDAP服务的节点
- ccsccp:管理节点标识(如示例中的9.88.49.47)
- 未使用的字段可留空(如ntp_client节点的计算/存储IP)
三、配置实战技巧与注意事项
3.1 setting.ini关键注意事项
- 语法规范:键值对之间必须有空格(如
key = value而非key=value) - 密码安全:common_sys_root_password建议修改为强密码
- 网络配置:basic_vlan_vid默认701,需与实际网络规划一致
- Ansible并发:basic_ansible_forks建议根据节点数量调整(默认5)
3.2 配置文件联动关系
- setting.ini的basic_share_storage_ip应与hostname.csv中的存储节点IP对应
- LDAP服务IP需在两个文件中保持一致
- 自动化脚本会同时读取两个文件:
common.sh中定义ini_file=${base_directory}/setting.ini,节点信息则来自hostname.csv
3.3 快速验证配置
修改配置后可通过基础脚本验证:
cd /data/web/disk1/git_repo/openeuler/hpcpilot bash hpc_script/basic_script/auto_check_script.sh四、常见问题解决
Q1:setting.ini修改后不生效?
A:确保修改后保存,并重新执行相关脚本。部分配置需重启服务,可运行bash hpc_script/service_script/install_ntp_server.sh验证NTP配置。
Q2:hostname.csv导入节点失败?
A:检查IP格式是否正确,避免重复IP,确保host_group使用预定义分组名(如ntp_server、ldap_client)。
Q3:共享存储挂载错误?
A:核对setting.ini中basic_shared_directory与basic_share_storage_directory路径是否匹配,可通过bash hpc_script/post_operation_script/cac_check_temp_nfs.sh检查NFS状态。
通过合理配置这两个核心文件,可显著提升hpcpilot工具的部署效率。建议配置前备份原始文件,以便在出现问题时快速恢复。完整配置示例可参考项目hpc_script目录下的默认文件。
【免费下载链接】hpcpilotA collection of HPC delivery tools, including basic system configuration, node inspection, performance testing, third-party service installation, etc.项目地址: https://gitcode.com/openeuler/hpcpilot
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
