Linux平台部署

在Linux平台上,提供shell安装脚本进行服务的安装和初始化,Linux安装脚本命令如下:

$./install.sh -h
Usage: ./install.sh [--inbound-ip ip] [--gateway-port port] [--outbound-ip ip] [--out-gateway-port port] [--cluster-mode] [--skip-start-service] [--skip-pull-image ] [--install-mode basic|standard|enterprise] [--enable-encrypt] [--help]
install hiper matrix service tool

Options:
    --base-services         install all the base services, used in cluster mode, when it is set, after install the base services, this install will be done
    --inbound-ip            the host ip address
    --gateway-port          the gateway port
    --outbound-ip           the ip address for outside access
    --out-gateway-port      the gateway port for outside access
    --cluster-mode          enable the cluster deployment
    --node-id               the node id when deployed as cluster
    --cluster-hosts         the other host addresses of the cluster, multiple addresses is combined with comma
    --is-master             if the host is the master role of the cluster
    --vip                   the virtual ip of the cluster
    --offline               install offline
    --docker-username       the username for login into the hvisions docker registry
    --docker-password       the password for login into the hvisions docker registry
    --skip-start-service    skip service start, only install service configure
    --enable-encrypt,-e     enable the password encrypt to avoid display the plaint password
    --skip-pull-image       skip pull image from docker registry
    --install-mode,-m       install mode, basic|standard|enterprise
    -h,--help               print usage

install脚本选项说明如下:

名称 说明 默认值
--base-services 安装基础服务,该选项在集群模式安装时使用,设置了该选项,安装完基础服务后,安装程序会结束,下次安装服务时再进行基础服务的初始化 false
--inbound-ip 服务部署机器内网地址 192.168.1.100
--gateway-port 网关服务本机访问端口,默认9000 9000
--outbound-ip 服务部署机器映射到外网的地址,如果存在外网映射访问的情况,设置改ip地址,默认和inbound-ip相同 inbound-ip设置的ip地址
--out-gateway-port 网关服务映射到外网访问的端口,默认与gateway-port配置的相同 gateway-port配置的端口
--cluster-mode 是否启用集群模式安装服务,需要启用集群安装,增加该选项 不启用集群模式
--node-id 集群模式节点id,默认为1,如果为master节点,请设置为1,不要改动 1
--cluster-hosts 集群其他主机地址信息,格式为{node id}:{ip地址},多个地址采用‘,’分割开,如1:192.168.1.101,2:192.168.1.102
--is-master 节点是否是主节点,一般第一个节点设置为主节点,主节点node-id设置为1 false
--vip 集群虚拟ip地址,集群模式时必须设置
--offline 离线进行安装
--docker-username 登陆到docker registry的用户名
--docker-password 登陆到docker registry的密码
--skip-start-service 仅安装服务相关配置,不启动服务,一般不用设置,默认就是安装完就启动服务 启动服务
--enable-encrypt,-e 启用加密选项,对保存的密码进行加密,避免明文保存密码 不启用加密
--skip-pull-image 跳过从docker仓库拉取最新镜像 默认拉取镜像
--install-mode,-m 安装模式,三个选项,basic:基础采集版本,standard: 标准版, enterprise:旗舰版 standard

1. 安装前置条件

1.1 系统硬件要求

以下是系统部署时,服务器需要达到的最低要求。

名称 CPU 内存 存储
基础版本 >= 4核 >= 8G >= 256G
标准版本 >= 8核 >= 12G >= 512G

1.2 系统软件要求

服务器要求安装通用发行版的Linux操作系统,如果Ubuntu,Centos等均可以满足要求,在Linux系统之上,需要安装docker。

docker安装参考官方文档: https://docs.docker.com/engine/install/

2. Linux单机在线部署HiperMatrix平台

假设部署服务器ip地址为192.168.1.100,根据实际环境更改该IP地址。

2.1 下载安装文件

Linux系统的安装文件位于http://58.247.122.126:20014/api/public/dl/UTFfZ16O/online 位置,浏览器中打开可以看到所有发布的版本,选择其中的一个版本进行文件的下载,可以按照如下的命令下载文件。

wget http://58.247.122.126:20014/api/public/dl/UTFfZ16O/online/hiper-matrix-linux-installer-release-v{matrix-release-version}.tar.gz -O hiper-matrix-linux-installer-release-v{matrix-release-version}.tar.gz

其中 matrix-release-version 就是matrix平台发布的版本号, 在执行以上命令时,请将matrix-release-version替换为需要安装的版本。

以2.0.2版本为例,执行一下命令下载安装文件并解压安装文件。

wget http://58.247.122.126:20014/api/public/dl/UTFfZ16O/online/hiper-matrix-linux-installer-release-v2.0.2.tar.gz -O hiper-matrix-linux-installer-release-v2.0.2.tar.gz
tar -zxf hiper-matrix-linux-installer-release-v2.0.2.tar.gz

解压完成后得到hiper-matrix-linux-installer-release-v2.0.2目录,安装脚本install.sh即位于改目录下。

2.2 安装服务

install.sh脚本文件会自动执行服务镜像的拉取,部署和数据库的初始化,保证服务器访问外网畅通,否则将会拉取不到docker服务镜像。

一个典型的安装命令如下:

$ cd hiper-matrix-linux-installer-release-v2.0.2
$ sudo ./install.sh --inbound-ip 192.168.1.100 \
    --gateway-port 9000 \
    --out-gateway-port 9000 \
    --docker-username hviot \
    --docker-password hVisionsIot2 \
    --install-mode standard

(1)这里假定部署服务器的IP地址为192.168.1.100, 根据实际情况进行调整。
(2)gateway端口默认采用9000,如果需要调整更改这个端口即可。
(3)登陆到docker registery的账号默认采用hviot/hVisionsIot2,该账号可登陆到hvisions docker registry,从hvisions的docker镜像仓库在线拉取所需要的服务镜像。
(4)安装模式选择为standard模式,即标准安装。

如果部署所在的服务器需要通过外网访问系统,可以配置映射的外网IP地址和端口,调整命令如下:

sudo ./install.sh --inbound-ip 192.168.1.100 \
    --outbound-ip 58.247.122.126 \
    --gateway-port 9000 \
    --out-gateway-port 10010 \
    --docker-username hviot \
    --docker-password hVisionsIot2 \
    --install-mode standard

58.247.122.126和10010根据实际映射出来的IP地址和端口进行调整。

安装脚本执行过程如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh --inbound-ip 192.168.1.100 \
>     --gateway-port 9000 \
>     --out-gateway-port 9000 \
>     --docker-username hviot \
>     --docker-password hVisionsIot2 \
>     --install-mode standard
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Created the install directory /usr/local/hvisions/iot
Install java 1.8 to /usr/local/hvisions/iot/tools/jdk1.8
Begin to start the services... 
Start rabbitmq:                 pulling image... done, running service... done
Start service influxdb:         pulling image... done, running service... done
Start service mysql:            pulling image... done, running service... done
Start redis:                    pulling image... done, running service... done
Wait common services startup for 30 seconds
Start to initialize the common services
Initialize the database... 
Init the InfluxDB is done.
Start to initialize RabbitMQ
Adding user "admin" ...
Setting permissions for user "admin" in vhost "/" ...
Setting tags for user "admin" to [administrator] ...
Create the admin user as administrator
exchange declared
Create the exchange of h-visions.syslog, type is topic and durable is true
Initialized the RabbitMQ service is done.
Init the MySQL base info is done.
Init the service info of node 1 is done.
Init the server 边缘节点服务器 info is done.
Init the middleware of node 1 is done.
Start the services
Wait for nacos service startup....
Create nacos namespace prod
Start auth:                     pulling image... done, running service... done
Wait for auth service startup....
Import the menu is done.
Start data-storage-service:     pulling image... done, running service... done
Wait for data storage service startup....
Start system-service:           pulling image... done, running service... done
Wait for system service initialization....
Start gateway-license:          pulling image... done, running service... done
Start edge-management:          pulling image... done, running service... done
Start data-query-service:       pulling image... done, running service... done
Start data-process:             pulling image... done, running service... done
Start hiper-matrix-web:         pulling image... done, running service... done
Start system-metric:            pulling image... done, running service... done
Start iot-alarm:                pulling image... done, running service... done
Start email:                    pulling image... done, running service... done
Start edge-connection:          pulling image... done, running service... done
Start hiper-vision-backend:     pulling image... done, running service... done
Start hiper-vision-frontend:    pulling image... done, running service... done

All the services have started, wait about 5-10 minutes to open http://192.168.1.100:9030 in the browser to login into the HiperMatrix platform, default username: admin, password: 111111

脚本执行完成后,大约等待5~15分钟(也取决于拉取服务镜像的网速)左右,各个服务可以启动完成。

2.3 升级服务

当Hiper Matrix已经在服务器上面安装过,有新版本可以更新,可以使用update.sh更新脚本进行版本的升级操作,升级脚本较为简单,
命令行帮助如下:

$./update.sh -h
Usage: ./update.sh [--offline update the service as offline mode]
hiper matrix service update tool

Options:
    --offline             update the service as offline mode
    -h,--help             print usage

升级目前只需要设置是否是离线升级,在连接不上外网时,可以设置--offline进行离线升级。

升级命令直接执行update脚本即可,如下:

cd hiper-matrix-linux-installer-release-v2.0.2
sudo ./update.sh

离线升级采用命令:

cd hiper-matrix-linux-installer-release-v2.0.2
sudo ./update.sh --offline

注意,设置离线升级,必须使用offline的安装包。

然后等待更新以及服务启动完成即可,等待时间也是5~15分钟。

2.4 访问系统

服务启动完成后,在浏览器中打开 http://{服务器IP地址}:9030 即可打开matrix平台的页面, 默认用户名为admin,密码为111111,以上示例打开的网页地址为http://192.168.1.100:9030

3.Linux部署HiperMatrix集群

3.1 集群功能说明以及手动部署

参考HiperMatrix高可用架构说明了解HiperMatrix集群功能实现以及手动部署方法。

3.2 Linux自动部署集群

自动部署的脚本和单机部署的install.sh脚本是一致,在部署时,需要调整相关的参数,需要在每个的节点上进行服务的部署。

集群部署增加了--cluster-mode, --node-id,--cluster-hosts,--is-master,--vip这几个选项的配置。

--cluster-mode: 表示启用集群模式。
--node-id: 节点id,主节点时,必须设置为1。
--cluster-hosts: 集群其他节点信息,{node-id}:{节点ip}的格式,中间用‘,’来分割,中间不要出现空格。
--is-master:表示为主节点。一般第一个节点设置为主节点,其他的节点不要设置。
--vip: 集群访问虚拟的ip地址,设置一个合法的虚拟ip地址。

假定三个服务节点信息如下(在实际部署时,ip地址信息根据实际部署环境进行对应调整)。

节点1: 192.168.1.101
节点2: 192.168.1.102
节点3: 192.168.1.103

假定vip地址为(根据实际部署环境更改为实际的vip地址):

vip: 192.168.1.110

每个节点都已经满足了单机部署中提到的前提条件,docker都已经安装完毕,安装文件已经下载到了所有的节点上面。

Linux部署集群分为两个步骤:

(1)在集群的所有节点上部署基础服务集群,如数据库,缓存,消息队列等基础服务;
(2)在集群的所有节点上部署业务服务集群,包含HiperMatrix业务功能的服务;

集群环境下,每个服务器部署的服务会有区别,各个节点上部署的服务如下:

节点1部署服务列表:

服务名称 服务描述 类型
mysql 数据库服务节点1 基础服务
redis 缓存服务节点1 基础服务
rabbitmq 消息队列服务节点1 基础服务
influxdb 时序数据库服务节点1 基础服务
zookeeper 分布式协调服务节点1 基础服务
edge-connection 边缘采集服务节点1 业务服务
edge-management 边缘管理服务节点1 业务服务
nacos 注册中心节点1 业务服务
auth 人员权限服务节点1 业务服务
gateway-license 网关服务节点1 业务服务
data-query-service 数据查询服务节点1 业务服务
data-storage-service 数据存储服务节点1 业务服务
data-process 数据引擎服务节点1 业务服务
hiper-matrix-web hiper maxtrix web服务节点1 业务服务
system-service 系统服务节点1 业务服务
iot-alarm 报警服务节点1 业务服务
system-metric 服务监控采集服务节点1 业务服务

节点2部署服务列表:

服务名称 服务描述 类型
mysql 数据库服务节点2 基础服务
redis 缓存服务节点2 基础服务
rabbitmq 消息队列服务节点2 基础服务
influxdb 时序数据库服务节点2 基础服务
zookeeper 分布式协调服务节点2 基础服务
edge-connection 边缘采集服务节点2 业务服务
edge-management 边缘管理服务节点2 业务服务
nacos 注册中心节点2 业务服务
auth 人员权限服务节点2 业务服务
gateway-license 网关服务节点2 业务服务
data-query-service 数据查询服务节点2 业务服务
data-storage-service 数据存储服务节点2 业务服务
data-process 数据引擎服务节点2 业务服务
hiper-matrix-web hiper maxtrix web服务节点2 业务服务
system-service 系统服务节点2 业务服务
iot-alarm 报警服务节点2 业务服务
system-metric 服务监控采集服务节点2 业务服务

节点3部署服务列表:

服务名称 服务描述 类型
redis 缓存服务节点2 基础服务
rabbitmq 消息队列服务节点2 基础服务
zookeeper 分布式协调服务节点2 基础服务
edge-connection 边缘采集服务节点2 业务服务
nacos 注册中心节点2 业务服务
system-metric 服务监控采集服务节点3 业务服务

下面逐步描述两个步骤下的安装命令。

3.2.1 部署集群基础服务

在节点1上执行基础服务安装命令:

$ sudo ./install.sh \
    --base-services \
    --cluster-mode \
    --node-id 1 \
    --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
    --is-master \
    --vip 192.168.1.110 \
    --inbound-ip 192.168.1.100 \
    --docker-username hviot \
    --docker-password hVisionsIot2

节点1会作为基础服务的主节点,该节点部署时会增加--is-master的选项,其余节点在部署时不带该选项。

注意:里面的各个ip地址根据实际环境的不同进行调整。

在集群部署中,会提示输入绑定vip地址的网卡,这里请选择需要绑定的物理网卡的地址,比如ens192这种,示意如下:

本机网卡列表:
  0) br-23bc660313ce
  1) docker0
  2) ens192
  3) lo
  4) veth5d28eb6
  5) virbr0
  6) virbr0-nic
请输入VIP使用的网卡序号[0 - 6]: 2
选择网卡 ens192 绑定VIP地址

节点1基础服务命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh \
>     --base-services \
>     --cluster-mode \
>     --node-id 1 \
>     --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
>     --is-master \
>     --vip 192.168.1.110 \
>     --inbound-ip 192.168.1.100 \
>     --docker-username hviot \
>     --docker-password hVisionsIot2
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

本机网卡列表:
  0) br-23bc660313ce
  1) docker0
  2) ens192
  3) lo
  4) veth09720eb
  5) veth2a25309
  6) veth77a73fb
  7) vethef42118
  8) virbr0
  9) virbr0-nic
请输入VIP使用的网卡序号[0 - 9]: 2
选择网卡 ens192 绑定VIP地址
Created the install directory /usr/local/hvisions/iot
Install java 1.8 to /usr/local/hvisions/iot/tools/jdk1.8
Begin to start the services... 
Start rabbitmq-1:               pulling image... done, running service... done
Start service influxdb:         pulling image... done, running service... done
Start influx-proxy:             pulling image... done, running service... done
Start service mysql-1:          pulling image... done, running service... done
mysql-1 has started, begin to init
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
+-------------------------------------------------------------------+
| Grants for slave@%                                                |
+-------------------------------------------------------------------+
| GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO `slave`@`%` |
+-------------------------------------------------------------------+
mysql: [Warning] Using a password on the command line interface can be insecure.
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000003 |      864 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
Init mysql-1 done
Start redis-1:                  pulling image... done, running service... done
Start redis-sentinal-1...       pulling image... done, running service... done
已加载插件:langpacks, ulninfo
docker-ce-stable                                                                                                                                                                                               | 3.5 kB  00:00:00     
ol7_UEKR6                                                                                                                                                                                                      | 3.0 kB  00:00:00     
ol7_latest                                                                                                                                                                                                     | 3.6 kB  00:00:00     
软件包 keepalived-1.3.5-19.el7.x86_64 已安装并且是最新版本
无须任何处理
Start keepalived... done
Start zookeeper-1...            pulling image... done, running service... done
Init the InfluxDB is done.

在节点2上执行基础服务安装命令:

$ sudo ./install.sh \
    --base-services \
    --cluster-mode \
    --node-id 2 \
    --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
    --vip 192.168.1.110 \
    --inbound-ip 192.168.1.101 \
    --docker-username hviot \
    --docker-password hVisionsIot2

节点2为非主节点,不需要设置--is-master的选项,同时调整node-id为2,inbound-ip为节点2的ip地址。

注意:里面的各个ip地址根据实际环境的不同进行调整。

同样的在选择VIP绑定网卡时,选择需要绑定的物理网卡。

节点2基础服务安装命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh \
>     --base-services \
>     --cluster-mode \
>     --node-id 2 \
>     --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
>     --vip 192.168.1.110 \
>     --inbound-ip 192.168.1.101 \
>     --docker-username hviot \
>     --docker-password hVisionsIot2
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

本机网卡列表:
  0) br-c9a3a9af6c12
  1) docker0
  2) ens192
  3) lo
  4) veth2acb071
  5) veth99b74a6
  6) vethcfa2c4f
  7) vethd0903cb
  8) virbr0
  9) virbr0-nic
请输入VIP使用的网卡序号[0 - 9]: 2
选择网卡 ens192 绑定VIP地址
Created the install directory /usr/local/hvisions/iot
Install java 1.8 to /usr/local/hvisions/iot/tools/jdk1.8
Begin to start the services... 
Start rabbitmq-2:               pulling image... done, running service... done
Start service influxdb:         pulling image... done, running service... done
Start influx-proxy:             pulling image... done, running service... done
Start service mysql-2:          pulling image... done, running service... done
mysql-2 has started, begin to init
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Init mysql-2 done
Start redis-2:                  pulling image... done, running service... done
Start redis-sentinal-2...       pulling image... done, running service... done
已加载插件:langpacks, ulninfo
ol7_UEKR6                                                                                                                                                                                                      | 3.0 kB  00:00:00     
ol7_latest                                                                                                                                                                                                     | 3.6 kB  00:00:00     
软件包 keepalived-1.3.5-19.el7.x86_64 已安装并且是最新版本
无须任何处理
Start keepalived... done
Start zookeeper-2...            pulling image... done, running service... done
Init the InfluxDB is done.

在节点3上执行基础服务安装命令:

$ sudo ./install.sh \
    --base-services \
    --cluster-mode \
    --node-id 3 \
    --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
    --vip 192.168.1.110 \
    --inbound-ip 192.168.1.102 \
    --docker-username hviot \
    --docker-password hVisionsIot2

同样的,节点3为非主节点,不需要设置--is-master的选项,同时调整node-id为3,inbound-ip为节点3的ip地址。

注意:里面的各个ip地址根据实际环境的不同进行调整。

同样的在选择VIP绑定网卡时,选择需要绑定的物理网卡。

节点3基础服务安装命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh \
>     --base-services \
>     --cluster-mode \
>     --node-id 3 \
>     --cluster-hosts 1:192.168.1.101,2:192.168.1.102,3:192.168.1.103 \
>     --vip 192.168.1.110 \
>     --inbound-ip 192.168.1.102 \
>     --docker-username hviot \
>     --docker-password hVisionsIot2
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

本机网卡列表:
  0) br-4cd8f0b9affc
  1) docker0
  2) ens192
  3) lo
  4) veth7b1db2e
  5) virbr0
  6) virbr0-nic
请输入VIP使用的网卡序号[0 - 6]: 2
选择网卡 ens192 绑定VIP地址
Created the install directory /usr/local/hvisions/iot
Install java 1.8 to /usr/local/hvisions/iot/tools/jdk1.8
Begin to start the services... 
Start rabbitmq-3:               pulling image... done, running service... done
Start redis-3:                  pulling image... done, running service... done
Start redis-sentinal-3...       pulling image... done, running service... done
Start zookeeper-3...            pulling image... done, running service... done
3.2.2 部署集群业务服务

部署业务服务的时候,不需要进行基础服务的部署,需要去掉--base-services的选项。

在节点1上执行安装命令:

$ ./install.sh --cluster-mode --install-mode standard

集群的配置信息在安装基础服务时已经安装,所以不需要太多命令参数。

节点1业务服务安装命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh --cluster-mode --install-mode standard
Start to initialize the common services
Initialize the database... 
Init the InfluxDB is done.
Start to initialize RabbitMQ
Adding user "admin" ...
Setting permissions for user "admin" in vhost "/" ...
Setting tags for user "admin" to [administrator] ...
Create the admin user as administrator
exchange declared
Create the exchange of h-visions.syslog, type is topic and durable is true
Initialized the RabbitMQ service is done.
Init the MySQL base info is done.
Init the service info of node 1 is done.
Init the middleware of node 1 is done.
Init the server 边缘节点服务器-1 info is done.
Init the middleware of node 2 is done.
Init the server 边缘节点服务器-2 info is done.
Init the middleware of node 3 is done.
Init the server 边缘节点服务器-3 info is done.
Start the services
Wait for nacos service startup....
Create nacos namespace prod
Start auth:                     pulling image... done, running service... done
Wait for auth service startup....
Import the menu is done.
Start data-storage-service:     pulling image... done, running service... done
Wait for data storage service startup....
Start system-service:           pulling image... done, running service... done
Wait for system service initialization....
Start gateway-license:          pulling image... done, running service... done
Start edge-management:          pulling image... done, running service... done
Start data-query-service:       pulling image... done, running service... done
Start data-process:             pulling image... done, running service... done
Start hiper-matrix-web:         pulling image... done, running service... done
Start system-metric:            pulling image... done, running service... done
Start iot-alarm:                pulling image... done, running service... done
Start email:                    pulling image... done, running service... done
Start edge-connection:          pulling image... done, running service... done
Start hiper-vision-backend:     pulling image... done, running service... done
Start hiper-vision-frontend:    pulling image... done, running service... done

All the services have started, wait about 5-10 minutes to open http://192.168.1.100:9030 in the browser to login into the HiperMatrix platform, default username: admin, password: 111111

在节点2上执行安装命令:

$ ./install.sh --cluster-mode --install-mode standard

节点2上执行命令与节点1相同,同样的集群的配置信息在安装基础服务时已经安装,所以不需要太多命令参数。

节点2业务服务安装命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]# ./install.sh --cluster-mode --install-mode standard
Start to initialize the common services
Initialize the database... 
Init the InfluxDB is done.
Init the service info of node 2 is done.
Start the services
Start auth:                     pulling image... done, running service... done
Wait for auth service startup....
Import the menu is done.
Start data-storage-service:     pulling image... done, running service... done
Wait for data storage service startup....
Start system-service:           pulling image... done, running service... done
Wait for system service initialization....
Start gateway-license:          pulling image... done, running service... done
Start edge-management:          pulling image... done, running service... done
Start data-query-service:       pulling image... done, running service... done
Start data-process:             pulling image... done, running service... done
Start hiper-matrix-web:         pulling image... done, running service... done
Start system-metric:            pulling image... done, running service... done
Start iot-alarm:                pulling image... done, running service... done
Start email:                    pulling image... done, running service... done
Start edge-connection:          pulling image... done, running service... done
Start hiper-vision-backend:     pulling image... done, running service... done
Start hiper-vision-frontend:    pulling image... done, running service... done

All the services have started, wait about 5-10 minutes to open http://192.168.1.101:9030 in the browser to login into the HiperMatrix platform, default username: admin, password: 111111

在节点3上执行安装命令:

$ ./install.sh --cluster-mode --install-mode standard

节点3上执行命令与上述节点均相同,但是节点3部署的服务会很少,只包含边缘采集服务和系统监控指标采集等少数服务。

节点3业务服务安装命令执行输出如下:

[root@localhost hiper-matrix-linux-installer-release-v2.0.2]#  ./install.sh --cluster-mode --install-mode standard
Start to initialize the common services
Initialize the database... 
Init the service info of node 3 is done.
Start the services
Start system-metric:            pulling image... done, running service... done
Start edge-connection:          pulling image... done, running service... done

All the services have started, wait about 5-10 minutes to open http://192.168.1.102:9030 in the browser to login into the HiperMatrix platform, default username: admin, password: 111111

每个节点上的安装执行过程和单机部署类型,待所有节点的服务启动完成后,节点上的服务会自动组成集群。

4.Linux单机离线部署HiperMatrix平台

假设部署服务器ip地址为192.168.17.132,根据实际环境更改该IP地址。

4.1 在网络环境下载离线部署文件

Linux系统的安装文件位于http://58.247.122.126:20014/files/iot/packages/release/ 位置,浏览器中打开可以看到所有发布的版本,选择其中的一个版本进行文件的下载,可以按照如下的命令下载文件。
docker和基础镜像安装文件位于http://58.247.122.126:20014/files/iot/packages/ 位置。

离线部署包需要先在通网环境复制下面链接到浏览器上下载下来,并且不要修改下载名称,下载后再上传到离线环境。

下载docker安装包

http://58.247.122.126:20014/api/public/dl/AVj2OrYQ/docker/docker-offline-installer-ubuntu-22.04-amd64.tar.gz

下载基础镜像和matrix平台

http://58.247.122.126:20014/api/public/dl/AVj2OrYQ/base-images/hiper-matrix-base-images-linux-{base-images-version}.tar.gz
http://58.247.122.126:20014/api/public/dl/UTFfZ16O/hiper-matrix-linux-installer-release-v{matrix-release-version}.tar.gz

其中 matrix-release-version 就是matrix平台发布的版本号,base-images-version是基础镜像版本号。
在执行以上命令时,请将matrix-release-version和base-images-version替换为需要安装的版本。

以基础镜像2.0.0、平台2.0.2版本为例,执行下载命令。

http://58.247.122.126:20014/api/public/dl/AVj2OrYQ/base-images/hiper-matrix-base-images-linux-2.0.0.tar.gz
http://58.247.122.126:20014/api/public/dl/UTFfZ16O/offline/hiper-matrix-linux-offline-installer-release-v2.0.2.tar.gz

4.2 离线安装服务

下载之后会有三个安装包,将其上传到服务器当中。

  • docker-offline-installer-ubuntu-22.04-amd64.tar.gz docker的安装包
  • hiper-matrix-base-images-linux-2.0.0.tar.gz 中间件镜像包
  • hiper-matrix-linux-offline-installer-release-v2.0.2.tar.gz 主体服务部署包

顺序执行安装脚本

  • 安装docker
tar -zxf docker-offline-installer-ubuntu-22.04-amd64.tar.gz
cd docker-offline-installer-ubuntu-22.04-amd64
sudo ./install.sh

  • 安装基础镜像
cd ../
tar -zxf hiper-matrix-base-images-linux-2.0.0.tar.gz
cd hiper-matrix-base-images-linux-2.0.0/
sudo ./install.sh

  • 安装hiper-matrix
cd ../
tar -zxf hiper-matrix-linux-offline-installer-release-v2.0.2.tar.gz
cd hiper-matrix-linux-offline-installer-release-v2.0.2
sudo ./install.sh --offline


在安装hiper-matrix时会询问内网主机IP地址,输入内网地址后回车。

请输入内网主机IP地址[192.168.1.100]: 192.168.17.132


请等待脚本执行,当出现下面字样,证明离线部署安装完成。

All the services have started, wait about 5-10 minutes to open http://192.168.17.132:9030 in the browser to login into the HiperMatrix platform, default username: admin, password: 111111

2023-09-20
0