AGENT-SSH
On this page
Allows connecting to other hosts via SSH to run shell commands.
Specifying a list of agent-id
’s, this command allows users to SSH into remote MemSQL Ops agent hosts to run commands.
memsql-ops agent-ssh --multi --agent-ids $(memsql-ops agent-list -q) -- 'ls -lathr'
This command will connect via SSH into each of the hosts that have an agent deployed (including the local host), and list the files in the home directory.
If MemSQL Ops does not have stored credentials for the local host, it will attempt to use one of the defined SSH access credentials of its follower agent hosts.
Usage
usage: memsql-ops agent-ssh [--settings-file SETTINGS_FILE][--agent-ids AGENT_IDS [AGENT_IDS ...]][--memsql-role {leaf,aggregator,master} [{leaf,aggregator,master} ...]][--no-prompt] [-u USER] [-P PORT] [-i PRIVATE_KEY][-p [PASSWORD]] [--multi][--num-parallel NUM_PARALLEL][command]Open SSH connections to agents.positional arguments:command An optional command to run. If specified, run thecommand instead of a shell and exit on completion.optional arguments:--settings-file SETTINGS_FILEA path to a MemSQL Ops settings.conf file. If not set,we will use the file in the same directory as theMemSQL Ops binary.--agent-ids AGENT_IDS [AGENT_IDS ...]Filter the nodes by the specified agent IDs.--memsql-role {leaf,aggregator,master} [{leaf,aggregator,master} ...]Filter the nodes by the specified SingleStore roles.--no-prompt Skip interactive prompts if a single agent isselected.-u USER, --user USER Use this user for all SSH connections.-P PORT, --port PORT Use this port for all SSH connections.-i PRIVATE_KEY, --private-key-file PRIVATE_KEYUse this SSH key for all SSH connections.-p [PASSWORD], --password [PASSWORD]Use this password for all SSH connections. Leave blankto read the MEMSQL_PASSWORD environment variable, orhave a password prompt if MEMSQL_PASSWORD is not set.--multi Run commands on multiple nodes in parallel.--num-parallel NUM_PARALLELThe number of machines to run commands on in parallelif --multi is specified. We will run commands on allmachines, but we will only run commands on this manymachines at the same time.
Last modified: March 8, 2024