Project

General

Profile

Actions

Bug #48158

closed

cephadm bootstrap fails with custom ssh port

Added by Thilo-Alexander Ginkel over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
cephadm
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Attempting to bootstrap a Ceph cluster using cephadm fails if the host is using a non-standard SSH port instead of port 22 despite providing a ssh_config file that declares the custom port (e.g., 2222).

ssh_config:

SendEnv LANG LC_* GIT_*

Host *
  Port                  2222

cephadm output:

# curl --silent --remote-name --location https://github.com/ceph/ceph/raw/octopus/src/cephadm/cephadm

# chmod +x cephadm

# mkdir -p /etc/ceph

# ./cephadm bootstrap --mon-ip 10.147.8.12 --ssh-config ssh_config 
Verifying podman|docker is present...
Verifying lvm2 is present...
Verifying time synchronization is in place...
Unit systemd-timesyncd.service is enabled and running
Repeating the final host check...
podman|docker (/usr/bin/docker) is present
systemctl is present
lvcreate is present
Unit systemd-timesyncd.service is enabled and running
Host looks OK
Cluster fsid: e1b69b0c-22dd-11eb-a320-e3173a7d80ce
Verifying IP 10.147.8.12 port 3300 ...
Verifying IP 10.147.8.12 port 6789 ...
Mon IP 10.147.8.12 is in CIDR network 10.147.8.0/24
Pulling container image docker.io/ceph/ceph:v15...
Extracting ceph user uid/gid from container image...
Creating initial keys...
Creating initial monmap...
Creating mon...
Waiting for mon to start...
Waiting for mon...
mon is available
Assimilating anything we can from ceph.conf...
Generating new minimal ceph.conf...
Restarting the monitor...
Setting mon public_network...
Creating mgr...
Verifying port 9283 ...
Wrote keyring to /etc/ceph/ceph.client.admin.keyring
Wrote config to /etc/ceph/ceph.conf
Waiting for mgr to start...
Waiting for mgr...
mgr not available, waiting (1/10)...
mgr not available, waiting (2/10)...
mgr not available, waiting (3/10)...
mgr not available, waiting (4/10)...
mgr is available
Enabling cephadm module...
Waiting for the mgr to restart...
Waiting for Mgr epoch 5...
Mgr epoch 5 is available
Setting orchestrator backend to cephadm...
Using provided ssh config...
Generating ssh key...
Wrote public SSH key to to /etc/ceph/ceph.pub
Adding key to root@localhost's authorized_keys...
Adding host nuc2...
Non-zero exit code 22 from /usr/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/ceph -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=nuc2 -v /var/log/ceph/e1b69b0c-22dd-11eb-a320-e3173a7d80ce:/var/log/ceph:z -v /tmp/ceph-tmpces5opqh:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmpnzh59b2m:/etc/ceph/ceph.conf:z docker.io/ceph/ceph:v15 orch host add nuc2
/usr/bin/ceph:stderr Error EINVAL: Failed to connect to nuc2 (nuc2).
/usr/bin/ceph:stderr Check that the host is reachable and accepts connections using the cephadm SSH key
/usr/bin/ceph:stderr 
/usr/bin/ceph:stderr you may want to run:
/usr/bin/ceph:stderr > ceph cephadm get-ssh-config > ssh_config
/usr/bin/ceph:stderr > ceph config-key get mgr/cephadm/ssh_identity_key > key
/usr/bin/ceph:stderr > ssh -F ssh_config -i key root@nuc2
ERROR: Failed to add host <nuc2>: Failed command: /usr/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/ceph -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=nuc2 -v /var/log/ceph/e1b69b0c-22dd-11eb-a320-e3173a7d80ce:/var/log/ceph:z -v /tmp/ceph-tmpces5opqh:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmpnzh59b2m:/etc/ceph/ceph.conf:z docker.io/ceph/ceph:v15 orch host add nuc2

The same sequence (without the custom ssh_config file) works when the host's sshd is listening on port 22.

Actions

Also available in: Atom PDF