Adding multiple hosts
Use a YAML file to add multiple hosts to the storage cluster at the same time.
NOTE: Be sure to create the hosts.yaml file within a host
container, or create the file on the local host and then use the
cephadm shell to mount the file within the container. The cephadm
shell automatically places mounted files in /mnt. If you create the
file directly on the local host and then apply the hosts.yaml file
instead of mounting it, you might see a File does not exist error.
Prerequisites
A storage cluster that has been installed and bootstrapped.
Root-level access to all nodes in the storage cluster.
Procedure
Copy over the public
sshkey to each of the hosts that you want to add.Use a text editor to create a
hosts.yamlfile.Add the host descriptions to the
hosts.yamlfile, as shown in the following example. Include the labels to identify placements for the daemons that you want to deploy on each host. Separate each host description with three dashes (---).Example
service_type: host addr: hostname: host02 labels: - mon - osd - mgr --- service_type: host addr: hostname: host03 labels: - mon - osd - mgr --- service_type: host addr: hostname: host04 labels: - mon - osdIf you created the
hosts.yamlfile within the host container, invoke theceph orch applycommand:Example
[root@host01 ~]# ceph orch apply -i hosts.yaml Added host 'host02' with addr '10.10.128.69' Added host 'host03' with addr '10.10.128.70' Added host 'host04' with addr '10.10.128.71'If you created the
hosts.yamlfile directly on the local host, use thecephadmshell to mount the file:Example
[root@host01 ~]# cephadm shell --mount hosts.yaml -- ceph orch apply -i /mnt/hosts.yamlView the list of hosts and their labels:
Example
[root@host01 ~]# ceph orch host ls HOST ADDR LABELS STATUS host02 host02 mon osd mgr host03 host03 mon osd mgr host04 host04 mon osdNOTE: If a host is online and operating normally, its status is blank. An offline host shows a status of OFFLINE, and a host in maintenance mode shows a status of MAINTENANCE.