Table of Contents generated with DocToc

Initial Installation

In this example, the installation path is /opt/hengshi, the download path is ~/pkgs, and the preparation files are introduced in the Installation - Preparation Files section.

Preparation

  1. Configure user and installation directory (requires sudo/root privileges)
    Do not install with root, it is recommended to create a user to install/run this product (hengshi user is used as an example below).
$ grep hengshi /etc/passwd > /dev/null || sudo useradd -m hengshi         # Create hengshi user
$ sudo mkdir -p /opt/hengshi && sudo chown hengshi:hengshi /opt/hengshi  # Set installation directory and permissions
  • SSH on a non-standard port

For all machines involved in the installation (both this machine and machines configured in the HS_ENGINE_SEGMENTS variable), if they use non-standard SSH ports (other than 22), configure the actual port for each host in the deploying user's ~/.ssh/config.

The localhost and the domain name returned by the hostname command need to be configured for the port on this machine.

For example: If the machine's hostname is configured as localhost and HS_ENGINE_SEGMENTS=(Node-A), and they both listen on port 122,

Then, the .ssh/config configuration needs to include:

Host localhost
  Port 122
Host Node-A
  Port 122

Installation

$ sudo su - hengshi             # Switch to the product runtime user
$ cd ~/pkgs/hengshi-sense-[version]           # Switch to the target extraction directory
$ ./hs_install -p /opt/hengshi    # Perform installation

The installation program reports the following message indicating a successful installation:

SUCCESSED! installed to xxxxx

Configure the hengshi system

Note: If you are completely using the default configuration, please skip this configuration step.

Configuration file, for specific configuration please refer to Configuration File

/opt/hengshi/conf/hengshi-sense-env.sh

Initialize OS

This step requires the executing user to have sudo privileges, after a successful execution, you can disable sudo privileges (sudo privileges are not needed for normal program operation)

$ sudo su - hengshi             # Switch to the product runtime user
$ cd /opt/hengshi                 # Enter the installation target directory
$ bin/hengshi-sense-bin init-os all  # Initialize OS

Initialize hengshi

$ sudo su - hengshi             # Switch to the product runtime user
$ cd /opt/hengshi                 # Enter the installation target directory
$ bin/hengshi-sense-bin init all   # Initialize the Hengshi system

Start

$ sudo su - hengshi             # Switch to the product runtime user
$ cd /opt/hengshi                 # Enter the installation target directory
$ bin/hengshi-sense-bin start all    # Start Hengshi service

The following prompt indicates a successful operation:

hengshi  415040      1  0 Sep01 ?        00:00:24 /opt/hengshi/lib/pgsql/bin/postgres -D /opt/hengshi/pg_data
 IN ACTIVE!  [metadb] /opt/hengshi/lib/pgsql/bin/postgres -D /opt/hengshi/pg_data
hengshi  415616      1  0 Sep01 ?        00:00:00 /opt/hengshi/lib/gpdb-5.3.0.7-centos7-cluster/gpdb/bin/postgres -D /opt/hengshi/engine-cluster/data/SegDataDir-1 -p 15432 --gp_dbid=1 --gp_num_contents_in_cluster=2 --silent-mode=true -i -M master --gp_contentid=-1 -x 0 -E
 IN ACTIVE!  [engine] /opt/hengshi/engine-cluster/data/SegDataDir-1
hengshi  415640      1  0 Sep01 ?        00:14:51 java -Djava.io.tmpdir=/opt/hengshi/temp_data -Dserver.port=8080 -jar /opt/hengshi/lib/bootstrap-2.0.0-SNAPSHOT.jar
 IN ACTIVE!  [hengshi] jar /opt/hengshi/lib/bootstrap-2.0.0-SNAPSHOT.jar
hengshi  415641      1  0 Sep01 ?        00:01:13 bash /opt/hengshi/bin/hengshi-watchdog.sh
 IN ACTIVE!  [watchdog] /opt/hengshi/bin/hengshi-watchdog.sh