Table of Contents generated with DocToc
The installation path can be decided by yourself. Below we take /opt/hengshi as an example, the download path is ~/pkgs, and the preparation file is introduced in the section Installation - Preparation File.
Please have the client execute the above dependencies according to their own company’s IT processes. If you need to operate manually, you can refer to Manual Operation Reference for System Dependencies.
The deployment directory is exemplified as /opt/hengshi, and the machines are exemplified as three nodes Node-A, Node-B, Node-C.
for x in Node-A Node-B Node-C; do
ssh $x "grep hengshi /etc/passwd > /dev/null || sudo useradd -m hengshi"
ssh $x "sudo mkdir -p /opt/hengshi && sudo chown hengshi:hengshi /opt/hengshi" #Establish henghsi user, set installation directory and permissions
done
If the machines involved in the installation (the local machine and the machines configured in HS_ENGINE_SEGMENTS) are listening on ports other than the ssh standard 22, you need to configure the actual ports for each host in the deployment user’s ~/.ssh/config.
The local machine needs to configure the ports for localhost and the domain name returned by the hostname command.
Example: The local machine is configured with hostname as localhost, and HS_ENGINE_SEGMENTS=(Node-A Node-B Node-C), they all listen on port 122.
Therefore, the .ssh/config configuration needs to include the following settings, and be synchronized to each machine’s same path file (.ssh/config):
Host localhost
Port 122
Host Node-A
Port 122
Host Node-B
Port 122
Host Node-C
Port 122
mkdir hengshi-sense-[version]/../cluster-conf
cd hengshi-sense-[version]
cp ansible/hosts.sample ../cluster-conf/hosts
cp ansible/vars.yml.sample ../cluster-conf/vars.yml
# Nodes can be configured after the following
# ansible_port=xxx for non-standard port 22
# ansible_user=hengshi if not logged in with the current execution user
[metadb] #Internal meta database
Node-A
[engine] #Acceleration engine #One machine must be designated as master
Node-A master=true
Node-B
Node-C
[gateway] #Cluster gateway
Node-A
[zookeeper] #Internal zookeeper #Ensure that zkid is different for each machine
Node-A zkid=1
Node-B zkid=2
Node-C zkid=3
[hengshi] #HENGSHI services
Node-B
Node-C
---
temp_work_dir_root: "/tmp" #Temporary directory, generally doesn't need to be changed
install_path: "/opt/hengshi" #Installation target directory
gateway_port: 8080
hengshi_sense_port: 8081
metadb_port: 8082
zookeeper_client_port: 2181
engine_master_port: 8100
engine_segment_base_port: 8200
The following command can be added to the environment variable to get detailed execution information.
ANSIBLE_PLAYBOOK="ansible-playbook -v"
$ sudo su - hengshi
$ cd ~/pkgs/hengshi-sense-[version] #Switch to the extraction target directory
$ ./hs_install -m cluster -c ../cluster-conf #Execute cluster installation
If the installation program outputs the following information, with all node statuses [unreachable=0,failed=0], it indicates a successful installation:
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
The executing user needs to have sudo privileges on each machine for this step. After successful execution, you can disable sudo privileges (the program does not need sudo privileges for daily operation).
$ sudo su - hengshi
$ cd /opt/hengshi
$ bin/hengshi-sense-bin init-os all #Initialize OS
The final return information of the initialization program, with all node statuses [unreachable=0,failed=0], indicates successful OS initialization:
TASK [deploy : init-os kernel] ********************************************************************************************************************************************************************************************************************************
changed: [Node-A]
changed: [Node-B]
changed: [Node-C]
TASK [deploy : init-os deps] **********************************************************************************************************************************************************************************************************************************
changed: [Node-A]
changed: [Node-B]
changed: [Node-C]
PLAY RECAP ****************************************************************************************************************************************************************************************************************************************************
Node-A : ok=5 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Node-B : ok=5 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Node-C : ok=5 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
$ sudo su - hengshi
$ cd /opt/hengshi
$ bin/hengshi-sense-bin init all #Initialize HENGSHI system
The final return information of the initialization program, with all node statuses [unreachable=0,failed=0], indicates successful HENGSHI system initialization:
TASK [operations : metadb init] *******************************************************************************************************************************************************************************************************************************
skipping: [Node-A]
skipping: [Node-B]
skipping: [Node-C]
TASK [operations : engine init] *******************************************************************************************************************************************************************************************************************************
skipping: [Node-A]
skipping: [Node-B]
skipping: [Node-C]
PLAY RECAP ****************************************************************************************************************************************************************************************************************************************************
Node-A : ok=1 changed=0 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
Node-B : ok=1 changed=0 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
Node-C : ok=2 changed=1 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
After executing, confirm the operation and service status in sequence.
$ sudo su - hengshi
$ cd /opt/hengshi #Enter the installation target directory
$ bin/hengshi-sense-bin start all #Start HENGSHI services
PLAY RECAP ***********************************************************************
Node-A : ok=4 changed=3 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
Node-B : ok=3 changed=2 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
Node-C : ok=3 changed=2 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0