Start/Stop/Check Status

  • The user running the service must not be the root user.

In this example, the installation path is /opt/hengshi, and the product's running user is hengshi. The actual situation can be changed accordingly.

  • Before performing the following start/stop/check operations, you need to switch to the product's running user and directory.
$ sudo su - hengshi             # Switch to the product's running user
$ cd /opt/hengshi               # Enter the installation target directory
Start
bin/hengshi-sense-bin start all

[Standalone version] The appearance of the following four messages with "IS ACTIVE" indicates a successful start:

 IS ACTIVE!  [metadb] /opt/hengshi/lib/pgsql/bin/postgres -D /opt/hengshi/pg_data
 IS ACTIVE!  [engine] /opt/hengshi/engine-cluster/data/SegDataDir-1
 IS ACTIVE!  [hengshi] jar /opt/hengshi/lib/bootstrap-2.0.0-SNAPSHOT.jar
 IS ACTIVE!  [watchdog] /opt/hengshi/bin/hengshi-watchdog.sh

[Cluster version] When the following information appears, each node's status [unreachable=0, failed=0], it indicates a successful operation:

PLAY RECAP ****************************************************************
Node-A : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-B : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-C : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0 

[Cluster version] After a successful operation, you still need to perform the check operation below, check the service status

Stop
bin/hengshi-sense-bin stop all

[Standalone version] The appearance of the following four messages with "NOT ACTIVE" indicates a successful stop:

 NOT ACTIVE! : [metadb] /opt/hengshi/lib/pgsql/bin/postgres -D /opt/hengshi/pg_data
 NOT ACTIVE! : [engine] /opt/hengshi/engine-cluster/data/SegDataDir-1
 NOT ACTIVE! : [hengshi] jar /opt/hengshi/lib/bootstrap-2.0.0-SNAPSHOT.jar
 NOT ACTIVE! : [watchdog] /opt/hengshi/bin/hengshi-watchdog.sh

[Cluster version] When the following information appears, each node's status [unreachable=0, failed=0] indicates a successful operation:

PLAY RECAP ****************************************************************
Node-A : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-B : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
Node-C : ok=18   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0 

[Cluster version] After a successful operation, you still need to perform the check operation below, check the service status

Check Program Running Status
bin/hengshi-sense-bin status all

[Standalone version] Look at the last few lines, focusing on the "ACTIVE"/"NOT ACTIVE" information of the four modules. "IS ACTIVE" indicates that the corresponding module is running, and "NOT ACTIVE" indicates that the corresponding module has stopped.

 NOT ACTIVE! : [metadb] /opt/hengshi/lib/pgsql/bin/postgres -D /opt/hengshi/pg_data
 NOT ACTIVE! : [engine] /opt/hengshi/engine-cluster/data/SegDataDir-1
 NOT ACTIVE! : [hengshi] jar /opt/hengshi/lib/bootstrap-2.0.0-SNAPSHOT.jar
 NOT ACTIVE! : [watchdog] /opt/hengshi/bin/hengshi-watchdog.sh

[Cluster version] Focus on the "ACTIVE"/"NOT ACTIVE" information of the metadb, engine, zookeeper, gateway, hengshi modules. "IS ACTIVE" indicates that the corresponding module is running, "NOT ACTIVE" indicates that the corresponding module has stopped, and "skipping" indicates that this node does not have this module installed.

TASK [operations : metadb status msg] ******************************************************************************************
ok: [Node-A] => {
    "msg": [
        "[metadb]: NOT ACTIVE"
    ]
}
skipping: [Node-B]
skipping: [Node-C]

TASK [operations : engine status msg] ******************************************************************************************
ok: [Node-B] => {
    "msg": [
        "[engine]: NOT ACTIVE"
    ]
}

TASK [operations : zookeeper status msg] ***************************************************************************************
ok: [Node-A] => {
    "msg": [
        "[zookeeper]: NOT ACTIVE"
    ]
}
ok: [Node-B] => {
    "msg": [
        "[zookeeper]: NOT ACTIVE"
    ]
}
ok: [Node-C] => {
    "msg": [
        "[zookeeper]: NOT ACTIVE"
    ]
}

TASK [operations : gateway status msg] *****************************************************************************************
ok: [Node-A] => {
    "msg": [
        "[gateway]: NOT ACTIVE"
    ]
}
skipping: [Node-B]
skipping: [Node-C]

TASK [operations : hengshi sense status msg] **********************************************************************************
ok: [Node-A] => {
    "msg": [
        "[syslog]: NOT ACTIVE",
        "[hengshi]: NOT ACTIVE",
        "[watchdog]: NOT ACTIVE"
    ]
}
ok: [Node-B] => {
    "msg": [
        "[syslog]: NOT ACTIVE",
        "[hengshi]: NOT ACTIVE",
        "[watchdog]: NOT ACTIVE"
    ]
}
skipping: [Node-C]

Using the Service

  • The service will bind the IP addresses for both internal and external networks of this machine. The port is specified by the 'HS_HENGSHI_PORT' variable in the configuration file (default port 8080). Enter the corresponding address in the browser's address bar (format IP:PORT).
  • Administrator account/password: Set through the setup page upon first start.