Skip to main content

HAP Microservices

Download Images

In a Kubernetes cluster, the following operations should be executed on each microservice node server.

crictl pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-community:6.5.4
crictl pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0
crictl pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-command:node1018-python36

Deploy Manager

By default, only operate on the first Kubernetes master server.

  1. Download the manager

    wget https://pdpublic.mingdao.com/private-deployment/6.5.4/mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
  2. Create a directory and extract the manager to the newly created directory

    mkdir /usr/local/MDPrivateDeployment/
    tar -zxvf mingdaoyun_private_deployment_captain_linux_amd64.tar.gz -C /usr/local/MDPrivateDeployment/
  3. Write the systemd unit file for the manager dependent on HAP services

    cat > /etc/systemd/system/hap-manager.service <<'EOF'
    [Unit]
    Description=HAP Manager
    After=network-online.target
    Wants=network-online.target

    [Service]
    Type=oneshot
    WorkingDirectory=/usr/local/MDPrivateDeployment
    ExecStart=/usr/bin/bash ./service.sh start
    RemainAfterExit=yes

    [Install]
    WantedBy=multi-user.target
    EOF
  4. Start the manager service

    systemctl daemon-reload
    systemctl start hap-manager
    systemctl enable hap-manager

Deploy Microservices

By default, only operate on the first Kubernetes master server.

  1. Generate the initial configuration file

    cd /usr/local/MDPrivateDeployment/
    bash ./service.sh install https://hap.domain.com
    echo -n 'StageStart' > installer.stage
  2. Configure the ConfigMap information in the config.yaml file

    • By default, config.yaml is located in the /data/mingdao/script/kubernetes path

    Execute vim config.yaml to edit the file, updating the variable values below to reflect actual deployment environment information.

    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: env-list
    namespace: default
    data:
    ENV_APP_VERSION: "6.5.4"
    ENV_MYSQL_HOST: "192.168.10.2"
    ENV_MYSQL_PORT: "3306"
    ENV_MYSQL_USERNAME: "root"
    ENV_MYSQL_PASSWORD: "123456"
    ENV_MONGODB_URI: "mongodb://mingdao:123456@192.168.10.4:27017,192.168.10.5:27017,192.168.10.6:27017"
    ENV_MONGODB_OPTIONS: "?maxIdleTimeMS=600000&maxLifeTimeMS=1800000"
    ENV_REDIS_HOST: "192.168.10.13"
    ENV_REDIS_PORT: "6379"
    ENV_REDIS_PASSWORD: "123456"
    ENV_KAFKA_ENDPOINTS: "192.168.10.7:9092,192.168.10.8:9092,192.168.10.9:9092"
    ENV_ELASTICSEARCH_ENDPOINTS: "http://192.168.10.10:9200,http://192.168.10.11:9200,http://192.168.10.12:9200"
    ENV_ELASTICSEARCH_PASSWORD: "elastic:123456"
    ENV_FILE_ENDPOINTS: "192.168.10.16:9001,192.168.10.17:9002,192.168.10.18:9003,192.168.10.19:9004"
    ENV_FILE_ACCESSKEY: "storage"
    ENV_FILE_SECRETKEY: "123456"
    ENV_MINGDAO_INTRANET_ENDPOINT: "www:8880"
    ENV_ADDRESS_MAIN: "https://hap.domain.com"
    ENV_ADDRESS_ALLOWLIST: ""
    ENV_CAPTAIN_ENDPOINT: "http://192.168.10.20:38880"
    ENV_HEALTHCHECK: "off"
    ENV_API_TOKEN: "4PrArcXYquO1sHlV9evsDqFKUUJ1kWVAg7v6oGcTKRNG9fUY"
    ENV_TIME_ZONE: "Asia/Shanghai"
    • Replace the default example storage component connection address, username, and password with those of your actual deployment environment.
    • Set the ENV_ADDRESS_MAIN variable to the actual access address of the HAP system.
    • Set the ENV_CAPTAIN_ENDPOINT variable to the server IP of the deployed manager.
  3. Start the HAP microservices

    cd /data/mingdao/script/kubernetes/
    bash start.sh
  4. Once nginx completes the proxy for the access address, the HAP system can be accessed via the configured address.