TigerGraph provides below commands for cluster operation, which reasmble the Linux commands. They must be run under tigergraph OS user.
Note these commands are experimental, and don't bear any guarantee or support.

  • ghostname
  • gssh
  • grun
  • grun_p
  • gfetch


ghostname

Show the hostname of current node. The hostname can be the node name (m?), or the component instance name.

(m1)$ ghostname
m1
GSE_1_1
GPE_1_1
RESTPP_1_1
RESTPP-LOADER_1_1
KAFKA-LOADER_1_1



gssh [hostname]

Show ssh config/hosts, or ssh to another host.
E.g., list all hosts and ssh configuration

(m1) $ gssh 
Usage: gssh m1|gpe_1_1|gse_1_1|...
Usage: ----------------Available hosts--------------
Host *
IdentityFile /home/tigergraph/.ssh/tigergraph_rsa
Port 22

Host m2 GSE_2_1 GPE_2_1 RESTPP_2_1 RESTPP-LOADER_2_1 KAFKA-LOADER_2_1
    HostName 172.30.1.154
Host m1 GSE_1_1 GPE_1_1 RESTPP_1_1 RESTPP-LOADER_1_1 KAFKA-LOADER_1_1
    HostName 172.30.1.142
Host m3 GSE_3_1 GPE_3_1 RESTPP_3_1 RESTPP-LOADER_3_1 KAFKA-LOADER_3_1
    HostName 172.30.1.128

ssh to m2

(m1) $ gssh m2
(m2) $



grun <all|gpe|gse|gpp|kafka|rest|zk> "<command [;command ...]>"

Run a Linux command on all (or some) nodes, one node at a time.

(m1) $ grun all "date"

### Connecting to local  server 172.30.1.142 ...
Wed Nov 14 22:45:19 UTC 2018

### Connecting to remote server 172.30.1.154 ...
Wed Nov 14 22:45:19 UTC 2018

### Connecting to remote server 172.30.1.128 ...
Wed Nov 14 22:45:19 UTC 2018



grun_p <all|gpe|gse|gpp|kafka|rest|zk> "<command [;command ...]>"

Run a Linux command on all (or some) nodes, in parallel. Since the command runs in parallel and the output may interleave, you can use grep to filter what is interesting.
E.g,. to check if all 3 nodes have the same clock

(m1) $ grun_p all "date" |grep 2018
Wed Nov 14 22:45:55 UTC 2018
Wed Nov 14 22:45:55 UTC 2018
Wed Nov 14 22:45:55 UTC 2018


gscp <all|gpe|gse|gpp|kafka|rest|zk> <src_path> <target_path>

Copy a local file (or a directory) to all the nodes, including the local node. If the source and target paths are the same, it will skip the local copy.

(m1) $ touch /tmp/abc
(m1) $ gscp all /tmp/abc /tmp

### Connecting to local  server 172.30.1.142 ...
cp: '/tmp/abc' and '/tmp/abc' are the same file

### Connecting to remote server 172.30.1.154 ...

### Connecting to remote server 172.30.1.128 ...

(m1) $ grun all "ls /tmp/abc" |grep abc
/tmp/abc
/tmp/abc
/tmp/abc



gfetch <all|gpe|gse|gpp|kafka|rest|zk> <src_path> <target_path>

Fetch files (or directories) from all nodes to local. E.g., at /tmp/xyz, fetch remote files /tmp/abc to current directory.

(m1):/tmp/xyz$ gfetch all /tmp/abc .

### Connecting to local  server 172.30.1.142 ...

### Connecting to remote server 172.30.1.154 ...

### Connecting to remote server 172.30.1.128 ...

(m1):/tmp/xyz$ ls -latr
total 8
drwxrwxrwt 15 root       root       4096 Nov 14 22:54 ..
-rw-rw-r--  1 tigergraph tigergraph    0 Nov 14 22:54 abc_m1
-rw-rw-r--  1 tigergraph tigergraph    0 Nov 14 22:54 abc_m2
-rw-rw-r--  1 tigergraph tigergraph    0 Nov 14 22:54 abc_m3