Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(*): support exec subcommand #158

Merged
merged 1 commit into from
Nov 18, 2022
Merged

Conversation

aspirer
Copy link
Collaborator

@aspirer aspirer commented Nov 17, 2022

issue #153
usage:
curveadm exec 0e5d809f16b4 ps
curveadm exec 0e5d809f16b4 curve_ops_tool status
curveadm exec 0e5d809f16b4 -- ps -ef

Signed-off-by: Wangpan [email protected]

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec -h
Usage:  curveadm exec ID [OPTIONS]

Exec a cmd in service container

Options:
  -h, --help   Print usage

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 
Connection to 127.0.0.1 closed.
netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 -h
Usage:  curveadm exec ID [OPTIONS]

Exec a cmd in service container

Options:
  -h, --help   Print usage

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 ps
    PID TTY          TIME CMD
   1652 pts/3    00:00:00 ps
Connection to 127.0.0.1 closed.

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 "ps -ef"
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 Nov17 ?        00:00:01 /sbin/docker-init -- /entrypoint.sh --role mds --args=

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 -- ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 Nov17 ?        00:00:01 /sbin/docker-init -- /entrypoint.sh --role mds --args=

netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 curve_ops_tool status | head -n3
Cluster status:
Send RPC to chunkserver fail, error content: [E112]Not connected to 127.0.0.1:8200 yet, server_id=6 [R1][E112]Not connected to 127.0.0.1:8200 yet, server_id=6 [R2][E112]Not connected to 127.0.0.1:8200 yet, server_id=6 [R3][E112]Not connected to 127.0.0.1:8200 yet, server_id=6
Send RPC to chunkserver fail, error content: [E112]Not connected to 127.0.0.1:8202 yet, server_id=8 [R1][E112]Not connected to 127.0.0.1:8202 yet, server_id=8 [R2][E112]Not connected to 127.0.0.1:8202 yet, server_id=8 [R3][E112]Not connected to 127.0.0.1:8202 yet, server_id=8
Connection to 127.0.0.1 closed.
netease@hih-l-9493:~/curveadm$ ./bin/curveadm exec 0e5d809f16b4 -- curve_ops_tool status | head -n3
Cluster status:


@Cyber-SiKu
Copy link
Collaborator

Is curveadm exec [--id xxxx] cmd better? The id can be omitted and it will be executed on the main mds by default.

/*
* Project: CurveAdm
* Created Date: 2021-10-15
* Author: Jingli Chen (Wine93)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name

* Author: Jingli Chen (Wine93)
*/

// __SIGN_BY_WINE93__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -0,0 +1,92 @@
/*
* Copyright (c) 2021 NetEase Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

@Wine93
Copy link
Collaborator

Wine93 commented Nov 18, 2022

How about omit the explicit cmd argument, like:

curveadm exec 0e5d809f16b4 ps -ef

it's more like docker's exec command:

docker exec 4ac34856f43f ps -ef

issue opencurve#153
usage:
    curveadm exec 0e5d809f16b4 ps
    curveadm exec 0e5d809f16b4 curve_ops_tool status
    curveadm exec 0e5d809f16b4 -- ps -ef

Signed-off-by: Wangpan <[email protected]>
@aspirer
Copy link
Collaborator Author

aspirer commented Nov 18, 2022

How about omit the explicit cmd argument, like:

curveadm exec 0e5d809f16b4 ps -ef

it's more like docker's exec command:

docker exec 4ac34856f43f ps -ef
usage:
curveadm exec 0e5d809f16b4 ps
curveadm exec 0e5d809f16b4 curve_ops_tool status
curveadm exec 0e5d809f16b4 -- ps -ef

@Cyber-SiKu Cyber-SiKu merged commit e53acec into opencurve:master Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants