Helm Deployment
This article explains how to deploy HENGSHI SENSE on Kubernetes using Helm, as well as how to perform version upgrades and data backups after deployment.
Pre-deployment Preparation
Helm Version | Download File |
---|---|
v3.x | helm-v3.13.3-linux-amd64.tar.gz |
Note
Download the Helm binary package to the deployment machine and copy it to the /usr/bin
directory.
Run helm version
and the following output indicates successful installation:
version.BuildInfo Version:"v3.13.3"
Add Helm Repository
shellhelm repo add hengshi-charts https://hs-chart-repo.s3.cn-north-1.amazonaws.com.cn/charts/
Update Helm Repository
shellhelm repo update helm search repo hengshi-charts # -l List all versions
Import Offline Images
shellwget https://download.hengshi.com/releases/hengshi-sense-xxx.tar.gz docker load -i hengshi-sense-xxx.tar.gz
Note
For k8s/Helm environments, images need to be pushed to the image repository used by the cluster, such as registry, Harbor, Alibaba Cloud Image Repository, or Tencent Cloud Image Repository.
Cluster Deployment
- Custom Configuration File
Tip
By default, the minimum instance count for hengshi is set to 0, meaning it will not start automatically and requires engine initialization. Please pay attention to the NOTES prompt after executing the command.
Example configuration: example-config.yaml
hsImage:
hengshi:
address: "registry.hengshi.org/hengshi-sense:6.0-xxxxx"
gpdb:
address: "registry.hengshi.org/gpdb:6.25.4.0"
hsContainer:
gpdb:
segment_replicas: 3
gpdb_segments:
- segment-0
- segment-1
- segment-2
# To modify the storage volume size, you can enable the following parameters
hsVolume:
storage_class_name: "longhorn" # Replace with the StorageClass you are using
# Public cloud disks may have minimum size restrictions, e.g., Alibaba Cloud's minimum is 20G
# gpdb:
# master_size: "50Gi"
# segment_size: "50Gi"
# metadb:
# hengshi_db_size: "50Gi"
# minio:
# hengshi_minio_size: "50Gi"
# redis:
# hengshi_redis_size: "10Gi"
- Install Charts
# Retrieve the latest chart version - use the -l parameter to view all versions
helm search repo hengshi-charts
NAME CHART VERSION APP VERSION DESCRIPTION
hengshi-charts/hengshi-sense 1.2.2 4.2 HENGSHI SENSE
helm -n [namespace] install -f example-config.yaml hengshi-sense-6.0 hengshi-charts/hengshi-sense --version [chart_version] # chart_version refers to the available versions listed by helm search repo hengshi-charts
# Output
NOTES:
Initialize the engine by following these commands:
kubectl -n test exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n test exec -it master-0 -- /entrypoint.sh -m startsystem
Run hengshi by following these commands.
kubectl -n test scale deployment hengshi-sense --replicas=1
Get the application URL by running these commands:
export NODE_PORT=$(kubectl get svc hengshi --namespace test -o jsonpath="{.spec.ports[0].nodePort}")
export NODE_IP=$(kubectl get nodes --namespace test -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
- Modify ConfigMap (If you need to customize configurations such as account passwords, execute this step; otherwise, skip)
# ConfigMap names that can be modified: hengshi-sense greenplum metadb
kubectl edit configmap [configmap_name] -n [namespace]
- Initialize Engine (This step can be skipped as the built-in hengshi engine has been replaced and does not require initialization)
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m startsystem
Standalone Deployment
- Custom Configuration File
Tip
By default, the minimum instance count for Hengshi is set to 0, meaning it will not start immediately and requires waiting for the engine initialization. Please pay attention to the NOTES prompt after executing the command.
Example configuration: example-config.yaml
hsImage:
hengshi:
address: "registry.hengshi.org/hengshi-sense:6.0-xxxxxx"
gpdb:
address: "registry.hengshi.org/gpdb:6.25.4.0"
# If you need to modify the storage volume size, you can enable the following parameters
hsVolume:
storage_class_name: "longhorn" # Replace with the StorageClass you are using
# Public cloud disks may have minimum size restrictions, e.g., Alibaba Cloud requires a minimum of 20G
# gpdb:
# master_size: "50Gi"
# segment_size: "50Gi"
# metadb:
# hengshi_db_size: "50Gi"
# minio:
# hengshi_minio_size: "50Gi"
# redis:
# hengshi_redis_size: "10Gi"
- Install Charts
# Retrieve the latest chart version - use the -l parameter to view all versions
helm search repo hengshi-charts
NAME CHART VERSION APP VERSION DESCRIPTION
hengshi-charts/hengshi-sense 1.2.2 4.2 HENGSHI SENSE
# Use a custom configuration to install a specified version of the "HengshiSense" application
helm -n [namespace] install -f example-config.yaml hengshi-sense-6.0 hengshi-charts/hengshi-sense --version [chart_version] # chart_version refers to the available versions listed by helm search repo hengshi-charts
# Output
NOTES:
Initialize the engine by following these commands:
kubectl -n test exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n test exec -it master-0 -- /entrypoint.sh -m startsystem
Run hengshi by following these commands.
kubectl -n test scale deployment hengshi-sense --replicas=1
Get the application URL by running these commands:
export NODE_PORT=$(kubectl get svc hengshi --namespace test -o jsonpath="{.spec.ports[0].nodePort}")
export NODE_IP=$(kubectl get nodes --namespace test -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
- Modify ConfigMap (If you need to customize configurations such as account passwords, execute this step; otherwise, skip it)
# ConfigMap names that can be modified: hengshi-sense greenplum metadb
kubectl edit configmap [configmap_name] -n [namespace]
- Initialize Engine
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m startsystem
Wait a few minutes for the Hengshi Sense service to start. You can then access it via NODE_IP:PORT on any k8s node. If you need to configure Nginx forwarding, you can check the NodePort exposed by the current Service8080 port for forwarding.
kubectl -n [namespace] get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hengshi-sense NodePort 10.0.0.146 <none> 8080:31204/TCP,54320:30524/TCP,15432:31062/TCP,5005:32465/TCP 286d
Replace or Disable HENGSHI Components
Refer to the following example configuration to disable or enable components.
# Set any of the following components to false, and they will not start after installation
metadb_enabled: true
gpdb_enabled: true
doris_enabled: false
redis_enabled: true
minio_enabled: true
flink_enabled: false
# Example: Replace the built-in Greenplum engine of HENGSHI with AnalyticDB MySQL
# 1. Set the gpdb_enabled parameter to false in the custom configuration file
# 2. Refer to Installation and Startup > System Configuration > Advanced Engine Configuration for example configurations and add them to "configmap"
HS_ENGINE_TYPE: "mysql"
IS_ENGINE_EMBEDDED: false
SYSTEM_ENGINE_URL: "jdbc:mysql://192.168.211.4:3306/testdb?user=root&password=Test123@"
INTERNAL_ENGINE_DATASET_PATH: "enginedb"
INTERNAL_ENGINE_TMP_PATH: "enginetmp"
INTERNAL_ENGINE_OUTPUT_PATH: "enginecommon"
# Remove the following default engine variables
HS_ENGINE_TYPE: greenplum
HS_ENGINE_HOST: "master-0.gp-hs"
HS_ENGINE_PORT: "15432"
HS_ENGINE_DB: hengshi
HS_ENGINE_USR: hengshi
HS_ENGINE_PWD: hengshi202020
# Example: Replace the built-in metadb of HENGSHI with RDS PostgreSQL
# 1. Set the metadb_enabled parameter to false in the custom configuration file
# 2. Refer to Installation and Startup > System Configuration > Replace HENGSHI metadb for example configurations, and create the corresponding account and permissions in the cloud database
HS_PG_HOST=xxx
HS_PG_PORT=5432
HS_PG_DB="hengshi"
HS_PG_USR=hengshi
HS_PG_PWD="hengshi"
INTERNAL_STORAGE_DB_NAME="hengshi_sense_internal_storage"
HS_SYSLOG_HOST=xxxx
HS_SYSLOG_PORT=5432
HS_SYSLOG_DB=syslog
HS_SYSLOG_USR=syslog
HS_SYSLOG_PWD=syslog
Complete Example of Custom Configuration File
Refer to the complete example below.
# Module enable/disable
metadb_enabled: true
metadb_slave_enabled: false
gpdb_enabled: true
doris_enabled: false
redis_enabled: true
minio_enabled: true
flink_enabled: false
# Configmap
hsConfigmap:
hengshi: hengshi-sense
gpdb: greenplum
metadb: metadb
doris: doris-config
hs_engine_type: "greenplum"
hs_pg_if_external: false
hs_pg_host: "metadb-0.hengshi-hs"
hs_pg_port: "54320"
hs_pg_db: "hengshi"
hs_pg_usr: "hengshi"
hs_pg_pwd: "hengshi202020"
hs_engine_if_external: false
hs_engine_host: "master-0.gp-hs"
hs_engine_port: "15432"
hs_engine_db: "hengshi"
hs_engine_usr: "hengshi"
hs_engine_pwd: "hengshi202020"
hs_engine_query_pwd: "query202020"
hs_engine_etl_pwd: "etl202020"
hs_syslog_host: "metadb-0.hengshi-hs"
hs_syslog_db: "syslog"
hs_syslog_usr: "syslog"
hs_syslog_pwd: "syslog202020"
hs_minio_if_external: false
hs_minio_host: "http://minio-0.hengshi-hs"
hs_minio_usr: "hengshi"
hs_minio_pwd: "hengshi202020"
hs_minio_port: "9000"
hs_minio_region_code: "none"
hs_minio_bucket: "none"
hs_redis_if_external: false
hs_redis_host: "redis-0.hengshi-hs"
hs_redis_db: "0"
hs_redis_port: "6379"
hs_redis_pwd: "foobared"
# Service
hsService:
service_type:
nodeport: NodePort
clusterip: ClusterIP
none: None
hengshi:
name: "hengshi"
sense_port: 8080
apm_port: 5005
gpdb:
name: "greenplum"
greenplum_port: 15432
metadb:
name: "metadb"
metadb_port: 54320
metadbslave:
name: "metadbslave"
metadb_slave_port: 54321
minio:
name: "minio"
minio_port: 9001
redis:
name: "redis"
redis_port: 6379
flink:
name: "flink"
flink_rest_port: 8082
flink_job_rpc_port: 6123
doris:
name: "doris"
# Container
hsContainer:
hengshi:
name: "hengshi-sense"
replicas: 0
start_probe_per: 10
start_probe_success: 1
start_probe_failure: 45
read_probe_per: 10
read_probe_success: 1
read_probe_failure: 3
live_probe_per: 10
live_probe_success: 1
live_probe_failure: 6
apmserver:
name: "apmserver"
start_probe_per: 5
start_probe_success: 1
start_probe_failure: 12
read_probe_per: 5
read_probe_success: 1
read_probe_failure: 6
live_probe_per: 5
live_probe_success: 1
live_probe_failure: 6
gpdb:
master_name: "master"
segment_name: "segment"
master_replicas: 1
segment_replicas: 1
dns_policy: "ClusterFirst"
gpdb_master: master-0
gpdb_segments:
- segment-0
metadb:
name: "metadb"
replicas: 1
metadbslave:
name: "metadbslave"
replicas: 1
minio:
name: "minio"
replicas: 1
redis:
name: "redis"
replicas: 1
flink:
name: "flink"
replicas: 1
doris:
doris_be_replicas: 3
doris_fe_replicas: 3
doris_fe_hosts:
- doris-fe-0
- doris-fe-1
- doris-fe-2
doris_be_hosts:
- doris-be-0
- doris-be-1
- doris-be-2
# Volume
hsVolume:
# Public cloud disks may have minimum size restrictions, e.g., Alibaba Cloud minimum is 20G
storage_class_name: "longhorn"
access_mode:
once: ReadWriteOnce
many: ReadWriteMany
hengshi:
enable_pvc: false
enable_mounts: true
enable_volume: true
access_mode:
once: ReadWriteOnce
many: ReadWriteMany
exp_api_size: "5G"
hengshi_geo_size: "5G"
gpdb:
enable_mounts: true
enable_volume: true
master_size: "50Gi"
segment_size: "50Gi"
metadb:
enable_mounts: true
enable_volume: true
enable_empty_volume: false
hengshi_db_size: "50Gi"
metadbslave:
enable_mounts: true
enable_volume: true
hengshi_db_slave_size: "50Gi"
minio:
enable_mounts: true
enable_volume: true
hengshi_minio_size: "50Gi"
redis:
enable_mounts: true
enable_volume: true
hengshi_redis_size: "10Gi"
flink:
enable_mounts: true
enable_volume: true
hengshi_flink_size: "10Gi"
# Resources
hsResources:
hengshi:
requests:
memory: "4Gi"
cpu: "2"
limits:
memory: "16Gi"
cpu: "4"
apmserver:
requests:
memory: "256Mi"
cpu: "0.2"
limits:
memory: "2Gi"
cpu: "1"
gpdb:
requests:
memory: "2Gi"
cpu: "2"
limits:
memory: "2Gi"
cpu: "2"
metadb:
requests:
memory: "1Gi"
cpu: "1"
limits:
memory: "1Gi"
cpu: "1"
minio:
requests:
memory: "1Gi"
cpu: "1"
limits:
memory: "1Gi"
cpu: "1"
redis:
requests:
memory: "1Gi"
cpu: "1"
limits:
memory: "1Gi"
cpu: "1"
# IMAGE
hsImage:
enable_secret: false
secret_name: secret-name
policy: "IfNotPresent"
hengshi:
address: "registry.hengshi.org/hengshi-sense:develop"
gpdb:
address: "registry.hengshi.org/gpdb:6.25.4.0"
# SCHEDULE
hsSchedule:
enable_node_selector: false
hengshi:
node_selector_kv: "diskType: ssd"
gpdb:
node_selector_kv: "diskType: ssd"
metadb:
node_selector_kv: "diskType: ssd"
metadbslave:
node_selector_kv: "diskType: ssd"
minio:
node_selector_kv: "diskType: ssd"
redis:
node_selector_kv: "diskType: ssd"
flink:
node_selector_kv: "diskType: ssd"
doris:
node_selector_kv: "diskType: ssd"
# Ingress
ingress:
enabled: false
className: "nginx"
annotations:
ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-body-size: "500M"
hosts:
- host: helm-cluster.hengshi.org
paths:
- path: /
pathType: Prefix
tls: []
# - secretName: ttt-hengshi-org-tls
# hosts:
# - ttt.hengshi.org
# affinity e.g:
#hs_affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: "hengshi"
# operator: In
# values:
# - "true"
# topologyKey: "kubernetes.io/hostname"
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: bigdata
# operator: NotIn
# values:
# - "true"