Using a non-standard SSH port
Issue
Neutree connects to nodes via SSH to manage static node clusters. The default SSH port is 22. If your nodes use a different port, adding nodes may fail.
Solution
Neutree uses Ray as the underlying cluster management tool. Because Ray does not support configuring the SSH port directly, use an SSH configuration file to configure a non-standard SSH port for each node.
Steps
-
Create an SSH configuration file and add node configurations.
mkdir -p ./ssh-configcat > ./ssh-config/config << 'EOF'Host <host_alias>HostName <host_ip>Port <ssh_port>User <user>Host <host_alias>HostName <host_ip>Port <ssh_port>User <user>EOFchmod 600 ./ssh-config/configParameter description:
Parameter Description <host_alias>Node alias, used to identify the node in the SSH configuration and when adding the node to the cluster after configuration is complete. <host_ip>IP address of the node. <ssh_port>SSH port used by the node. <user>SSH username. Must be root or another user with root privileges. Example
mkdir -p ./ssh-configcat > ./ssh-config/config << 'EOF'Host gpu-node-1HostName 192.168.1.100Port 2222User rootEOFchmod 600 ./ssh-config/configThe example above creates
./ssh-config/configwith the following configuration: node aliasgpu-node-1, IP192.168.1.100, port2222, usernameroot. -
Mount the SSH configuration file to Neutree’s
neutree-corecontainer.Choose the appropriate method based on your deployment mode.
-
Update the
docker-compose.yamlfile to mount the SSH configuration file to theneutree-corecontainer.services:neutree-core:# ... other configurationsvolumes:- ./ssh-config:/root/.ssh:ro -
Restart the service.
docker-compose up -d
Note
When upgrading the Neutree control plane using
docker-compose.yamlin the future, your custom volume mounts may be overwritten. After each upgrade, be sure to remount the SSH configuration file to theneutree-corecontainer.-
Create a ConfigMap containing the SSH configuration.
kubectl create configmap ssh-config --from-file=config=./ssh-config -n neutreeOr create the ConfigMap using a YAML file:
apiVersion: v1kind: ConfigMapmetadata:name: ssh-confignamespace: neutreedata:config: |Host gpu-node-1HostName 192.168.1.100Port 2222User root -
Update the
neutree-coreDeployment to mount the SSH configuration file.apiVersion: apps/v1kind: Deploymentmetadata:name: neutree-corenamespace: neutreespec:template:spec:containers:- name: neutree-core# ... other configurationsvolumeMounts:- name: ssh-configmountPath: /root/.sshreadOnly: truevolumes:- name: ssh-configconfigMap:name: ssh-configdefaultMode: 0600 -
Apply the configuration:
kubectl apply -f neutree-core-deployment.yaml -n neutree
-
-
Test the SSH connection to each node to verify that the SSH configuration file and node configuration are correct.
-
Add nodes to the cluster in Neutree. Use the node alias (such as
gpu-node-1in the example above) instead of the IP address.
Related link
For Ray-related limitations, see Ray Discuss: Specify SSH port to cluster YAMLs.