【发布时间】:2021-07-20 03:03:03
【问题描述】:
嘿伙计们,我找不到任何答案。所以我已经处理了elasticluster + Ansible 和 OpenStack,但我遇到了一些问题,其中一些问题我已经能够解决其中一些问题和其他一些问题不。我想分享一下我是如何解决库存问题的,因为它没有记录在任何地方。
我有这个配置文件,差不多来自官方documentation。在这一点上,一切都很好并且可以正常工作。但是,如果我们不想使用默认剧本怎么办。这很好,因为在文档中解释了如何通过添加 playbook_path=newPath 来更改该文件,但它开始抱怨变量、脚本,然后您必须将几乎所有内容从 EC 复制到您的自定义剧本。
另一个问题是库存文件。如果您检查我在这里拥有的这些配置,它有两个带有slurm_worker 的节点,那么在我的剧本中我可以使用它来执行我的任务,但是如果我想为其中一个节点运行一些角色怎么样?比如说connection_node ?.
# The cloud section defines all properties needed to connect to a specific cloud provider.
# You can define as many cloud sections you want, assuming you have access to different cloud providers and want to deploy different clusters in different clouds. The mapping between cluster and cloud provider is done in a cluster section
[cloud/openstack]
provider=openstack
build_timeout=600
identity_api_version=3
availability_zone=XXXXX
# This section contains information on how to access the instances started on the cloud, including the user and the SSH keys to use.
# Some of the values depend on the image you specified in the cluster section. Values defined here also can affect the setup section and the way the system is setup.
[login/userconfig]
image_user=username
image_sudo=True
image_user_sudo=xxxxxx
user_key_name=XXXXXX
user_key_private={path of the private key file}
user_key_public={path of the public key file}
# This section contain information on how to setup a cluster. After the cluster is started, elasticluster will run a setup provider in order to configure it.
# A setup section is mostly independent of any other, and can be easily re-used across multiple clouds and base OS images – that’s the whole point of ElastiCluster!
[setup/slurm]
provider=ansible
playbook_path=elasticluster/share/playbooks/slurm_cluster.yml
client_groups=slurm_client
master_groups=slurm_master
frontend_groups=slurm_worker
connection_groups=slurm_worker
## Updating elasticluster variables
global_var_ansible_python_interpreter=/usr/bin/python3
global_var_multiuser_cluster=yes
# Version of SLURM to install. Only used on RHEL/CentOS 7
global_var_slurm_version=20.02
# A cluster section defines a “template” for a cluster. This section has references to each one of the other sections and define the image to use, the default number of compute nodes and the security group.
[cluster/projectname]
cloud=openstack
flavor=m3.xsmall
login=userconfig
setup=slurm
image_id=xxxxxxxxxxxxxxxxxxxxxxx
network_ids=xxxxxxxxxxxxxxxxxxxxxxx
security_group=default
# Nodes
master_nodes=1
client_nodes=1
worker_nodes=2
connection_nodes=2
ssh_to=master
【问题讨论】: