Skip to content

Commit

Permalink
fix typo, add comments and to-dos
Browse files Browse the repository at this point in the history
  • Loading branch information
twalluxio committed Jul 31, 2023
1 parent 4622e7c commit 9083d01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/src/alluxio.org/cli/processes/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,21 @@ func (p *WorkersProcess) Start(cmd *env.StartProcessCommand) error {
}

// 3. for each worker, create a client
// TODO: now start worker one by one, need to do them in parallel
for _, worker := range workersList {
clientConfig := &ssh.ClientConfig{
// TODO: how to get user name? Like ${USER} in alluxio-common.sh
User: "root",
// TODO: if configure nothing, can use none as the authentication method, suggest use public key
Auth: []ssh.AuthMethod{
ssh.PublicKeys(parsedPrivateKey),
},
Timeout: 5 * time.Second,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
// TODO: get ssh port if needed (some machines might have changed default port)
dialAddr := fmt.Sprintf("%s:%d", worker, 22)
// TODO: error to resolve: handshake error, authentication failed
sshClient, err := ssh.Dial("tcp", dialAddr, clientConfig)
if err != nil {
log.Logger.Fatalf("Dial failed to %s, error: %s", dialAddr, err)
Expand All @@ -144,7 +149,7 @@ func (p *WorkersProcess) Start(cmd *env.StartProcessCommand) error {
session.Stderr = os.Stderr

// 5. run session
command := "${ALLUXIO_HOME}/bin/cli.sh process start workers"
command := "${ALLUXIO_HOME}/bin/cli.sh process start worker"
err = session.Run(command)
if err != nil {
log.Logger.Fatalf("Run command %s failed at %s", command, dialAddr)
Expand Down

0 comments on commit 9083d01

Please sign in to comment.