平台安装说明


安装环境要求

平台支持linux(redhat、centos 6.5以上,建议版本采用7)


服务器配置要求

配置 CPU 内存 硬盘
推荐配置 8 Core * 2.0HZ以上 32G以上 3T
最小配置 4 Core * 2.0Hz 以上 16G 以上 2T
demo配置 2 Core * 2.0Hz 以上 8G 以上 100G

[!NOTE] 注:支持使用虚拟机,但存储必须使用san存储


Linux基础软件要求

软件 版本
操作系统 redhat 6.5以上,或对应centos
git 操作系统相应版本,用于自动化脚本和文档的版本管理
python 2.7 ,用于底层数据访问和维护


安装步骤

上传安装程序

# 创建临时目录,并上传介质到该目录
$ cd /opt
$ mkdir soft

[!NOTE] 开始的命令,使用root用户


解压介质

$ unzip matrix_install_Vx.xx.zip

$ cd matrix_install_Vx.xx


获得加密用户密码,用于修改配置文件使用

$ ./mxtool encrypt 1234qwer

KbbMZiQj/TL8ByAaxhFiRg==

See the /opt/soft/mxtool.log file for debug information.

[!NOTE] 执行的时候,确认mxtool有执行权限。


修改安装配置文件

$ cd /opt/soft
$ vi cluster.ini

[!NOTE] 可使用windows系统下载文件编辑后,再上传覆盖,须保证文件是unix编码格式

编辑全局配置内容

# Mxtool configuration version. (Global only)
# 配置文件协议版本
version = 1.0.1

# Cluster name. (Global only)
# 设定集群名称
# Default: matrix
cluster_name = matrix

# Oprating system.
# 设定服务器端操作系统
# Optional values: windows, linux
# Default: linux
os = linux

# Architecture.
# 设定安装包后缀 x86 为:matrix-linux-amd64.zip ,arm  为:matrix-linux-arm64.zip 
# Optional values: amd64, 386...
# Default:
arch = amd64

# Remote ssh login port.
# 设定远程安装ssh登录端口
# Default: 22
port = 22

# Remote login user name.
# 设定远程安装ssh登录用户名称,建议用root
username = root

# Remote login user encrypted password.
# 设定远程安装ssh登录用户密码
# ./mxtool encrypt <your password>
# Default: VXOrp3iEqNBlSTp8LR3nSg== (root)
password = VXOrp3iEqNBlSTp8LR3nSg==

# Matrix user name, will be created when installing.
# 需要设定运行程序用户
# Default: matrix
matrix_user = matrix

# Matrix user encrypted password, will be created when installing.
# 需要设定运行程序用户密码
# ./mxtool crypt <your password>
# Default: WsG4MyvuAhiUUPNyLP8KVg==  (matrix)
matrix_password = WsG4MyvuAhiUUPNyLP8KVg==

# Execute the command to run with sudo
sudo = false

# Matrix installation directory
# 设定默认安装目录
# Default: /opt
install_dir = /opt

# Local install mode
# Default: false
local_install = false

# Cassandra keyspace replication dc configuration for NetworkTopologyStrategy. (Global only)
# 这个地方是设置DC和副本数。(只全局配置)
# Ex: dc1:3, dc2:1, dc3:1
# Default: dc1:3
cassandra_keyspace_replication = dc1:1

# Cassandra data directory
# 设定默认数据存放目录
# Default: /opt/matrix/cassandra/data
cassandra_data_dir = /opt/matrix/cassandra/data

# Cassandra data center name.
# 设定Cassandra默认DC
# Default: dc1
cassandra_dc = dc1

# Cassandra data center rack name.
# 设定Cassandra默认rack
# Default: rack1
cassandra_rack = rack1

# Cassandra java gc.
# 设定Cassandra默认GC模式
# Optional values: ShenandoahGC, G1GC
# Default: ShenandoahGC
cassandra_java_gc = ShenandoahGC

# Cassandra java heap size.
# 设定Cassandra Java虚拟机内存大小
# Example: 8G
# Default:
cassandra_java_heap_size =

编辑私有配置内容

# host configuration example

# 主机配置默认会读取全局配置,本机可按照具体配置单独修改覆盖全局配置(除只全局配置以外)。
[wecise01]
os = linux
arch = amd64
# 本机IP地址
ip = 10.0.0.10
port = 22
username = root
password = VXOrp3iEqNBlSTp8LR3nSg==
matrix_user = matrix
matrix_password = WsG4MyvuAhiUUPNyLP8KVg==
install_dir = /opt
cassandra_data_dir = /opt/matrix/cassandra/data
cassandra_dc = dc1
cassandra_rack = rack1
# 默认主节点,如果不配置,第一台会默认为主节点
master = true
# Optional values: cassandra, etcd, nats, odbserver, parser, sched, web, toe, zabbix
# 可选安装模块,
modules = cassandra, etcd, nats, odbserver, parser, sched, web, toe, zabbix
# For module zabbix
zabbix_hostname = Zabbix server

[wecise02]
ip = 10.0.0.11
modules = parser,toe
# Other configurations use global configuration

[wecise03]
ip = 10.0.0.12
modules = parser,toe
# Other configurations use global configuration


启动安装程序

执行启动命令

$ ./mxtool cluster install
Cluster options:
+--------------------------------+--------+
| Option                         | Value  |
+--------------------------------+--------+
| version                        | 1.0.1  |
| cluster_name                   | matrix |
| cassandra_keyspace_replication | dc1:1  |
| local_install                  | false  |
+--------------------------------+--------+
Hosts options:
+--------------------------+-----------------------------------------------------------------+
| Option                   | Value                                                           |
+--------------------------+-----------------------------------------------------------------+
| hostname                 | matrix01                                                        |
| os                       | linux                                                           |
| arch                     | amd64                                                           |
| ip                       | 10.0.0.10                                                       |
| port                     | 22                                                              |
| username                 | root                                                            |
| password                 | root                                                            |
| sudo                     | false                                                           |
| matrix_user              | matrix                                                          |
| matrix_password          | matrix                                                          |
| install_dir              | /opt                                                            |
| cassandra_data_dir       | /opt/matrix/cassandra/data                                      |
| cassandra_dc             | dc1                                                             |
| cassandra_rack           | rack1                                                           |
| cassandra_java_gc        | ShenandoahGC                                                    |
| cassandra_java_heap_size |                                                                 |
| master                   | true                                                            |
| modules                  | cassandra, etcd, nats, odbserver, parser, web, sched, toe, init |
+--------------------------+-----------------------------------------------------------------+
+--------------------------+-----------------------------------------------------------------+
| Option                   | Value                                                           |
+--------------------------+-----------------------------------------------------------------+
| hostname                 | matrix02                                                        |
| os                       | linux                                                           |
| arch                     | amd64                                                           |
| ip                       | 10.0.0.11                                                       |
| port                     | 22                                                              |
| username                 | root                                                            |
| password                 | root                                                            |
| sudo                     | false                                                           |
| matrix_user              | matrix                                                          |
| matrix_password          | matrix                                                          |
| install_dir              | /opt                                                            |
| cassandra_data_dir       | /opt/matrix/cassandra/data                                      |
| cassandra_dc             | dc1                                                             |
| cassandra_rack           | rack1                                                           |
| cassandra_java_gc        | ShenandoahGC                                                    |
| cassandra_java_heap_size |                                                                 |
| modules                  | parser, toe                                                     |
+--------------------------+-----------------------------------------------------------------+
+--------------------------+-----------------------------------------------------------------+
| Option                   | Value                                                           |
+--------------------------+-----------------------------------------------------------------+
| hostname                 | matrix03                                                        |
| os                       | linux                                                           |
| arch                     | amd64                                                           |
| ip                       | 10.0.0.12                                                       |
| port                     | 22                                                              |
| username                 | root                                                            |
| password                 | root                                                            |
| sudo                     | false                                                           |
| matrix_user              | matrix                                                          |
| matrix_password          | matrix                                                          |
| install_dir              | /opt                                                            |
| cassandra_data_dir       | /opt/matrix/cassandra/data                                      |
| cassandra_dc             | dc1                                                             |
| cassandra_rack           | rack1                                                           |
| cassandra_java_gc        | ShenandoahGC                                                    |
| cassandra_java_heap_size |                                                                 |
| modules                  | parser, toe                                                     |
+--------------------------+-----------------------------------------------------------------+
? Confirm? Yes

确认配置正确后,输入Y,开始安装

Remote install matrix to host 'matrix01'
Unzip files /opt/mxtool/matrix-linux-amd64.zip to host 'matrix01' /opt...ok
Set env...ok
Install module 'cassandra'...ok
Install module 'etcd'...ok
Install module 'nats'...ok
Install module 'odbserver'...ok
Install module 'parser'...ok
Install module 'web'...ok
Install module 'sched'...ok
Install module 'toe'...ok
Install module 'init'...ok
Set hosts...ok
Installed Matrix to host 'matrix01' successfully.
Remote install matrix to host 'matrix02'
Unzip files /opt/mxtool/matrix-linux-amd64.zip to host 'matrix02' /opt...ok
Set env...ok
Install module 'parser'...ok
Install module 'toe'...ok
Set hosts...ok
Installed Matrix to host 'matrix02' successfully.
Remote install matrix to host 'matrix03'
Unzip files /opt/mxtool/matrix-linux-amd64.zip to host 'matrix03' /opt...ok
Set env...ok
Install module 'parser'...ok
Install module 'toe'...ok
Set hosts...ok
Installed Matrix to host 'matrix03' successfully.
See the /opt/mxtool/mxtool.log file for debug information.

[!NOTE] 如果配置多个节点,会显示多个节点的安装过程。 cluster.ini中local_install参数值为true时为本地安装模式。本地安装需要每台机器上传拷贝同样的配置和安装程序。即每台机器重复以上步骤。


启动基础组件

启动基础组件

# 使用集群命令启动

$ ./mxtool cluster start cassandra
See the /opt/soft/mxtool.log file for debug information.

$ ./mxtool cluster start etcd
See the /opt/soft/mxtool.log file for debug information.

$ ./mxtool cluster start nats
See the /opt/soft/mxtool.log file for debug information.

$ ./mxtool cluster start odbserver
See the /opt/soft/mxtool.log file for debug information.


# 或者登录每个安装了cassandra模块的主机使用matrix用户分别执行启动基础组件服务
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start cassandra
$ ./matrix.sh start etcd
$ ./matrix.sh start nats

# 或者登录每个安装了odbserver模块的主机使用matrix用户分别执行启动odbserver
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start odbserver

[!NOTE] 建议按如上顺序依次启动各组件。并且一定要使用matrix用户,用root用户会导致安全拦截无法正常启动。 cluster.ini中local_install参数值为true时为本地安装模式。本地安装启动某一模块时,需要分别登录安装了此模块的机器按照顺序启动模块。

查看基础组件启动情况

$ ./mxtool cluster status
matrix01 (10.0.0.10)
  cassandra  running  12572  matrix
  etcd       running  23717  matrix
  nats       running  45748  matrix
  odbserver  stopped  55721  matrix
  parser     stopped  -      -
  web        stopped  -      -
  sched      stopped  -      -
  toe        stopped  -      -
matrix02 (10.0.0.11)
  cassandra  running  41572  matrix
  etcd       running  41717  matrix
  nats       running  45322  matrix
  odbserver  empty    -      -
  parser     stopped  -      -
  web        empty    -      -
  sched      empty    -      -
  toe        stopped  -      -
matrix03 (10.0.0.12)
  cassandra  running  33372  matrix
  etcd       running  33275  matrix
  nats       running  33748  matrix
  odbserver  empty    -      -
  parser     stopped  -      -
  web        empty  -      -
  sched      empty  -      -
  toe        stopped  -      -

See the /opt/mxtool/mxtool.log file for debug information.


# 或者登录各个主机使用matrix用户查看当前主机状态
$ cd /opt/matrix/sbin
$ ./matrix.sh status
cassandra  running  12572  matrix
etcd       running  23717  matrix
nats       running  45748  matrix
odbserver  stopped  55721  matrix
parser     stopped  -      -
web        stopped  -      -
sched      stopped  -      -
toe        stopped  -      -

[!NOTE] 如果多个节点,会看到多个节点组件的启动状态。


平台进行初始化

$ ./mxtool cluster init -k matrix
? Confirm to init 'matrix'? Yes
Total: [============================] 100% 13/13 3m54s [done]
    config: [============================] 100% 1/1       0s    [done]
       odb: [============================] 100% 1/1       39s   [done]
     table: [============================] 100% 28/28     29s   [done]
     class: [============================] 100% 33/33     21s   [done]
   company: [============================] 100% 1/1       0s    [done]
       dfs: [============================] 100% 7058/7058 2m22s [done]
     graph: [============================] 100% 1/1       0s    [done]
      ldap: [============================] 100% 1/1       0s    [done]
        ui: [============================] 100% 6/6       0s    [done]
  patterns: [============================] 100% 86/86     0s    [done]
   license: [============================] 100% 12/12     0s    [done]
       mql: [============================] 100% 1/1       0s    [done]
    extend: [============================] 100% 3/3       0s    [done]
See the /opt/matrix/var/logs/init.log file for debug information.
See the /opt/mxtool/mxtool.log file for debug information.

[!NOTE] matrix是必须初始化的租户,其他租户必须要在matrix初始化后初始化。

其他租户初始化示例

$ ./mxtool cluster init -k test


启动其它服务

[!NOTE] 启动服务如果是local模式,则必须要使用matrix用户执行。 cluster.ini中local_install参数值为true时为本地安装模式。本地安装启动某一模块时,需要分别登录安装了此模块的机器按照顺序启动模块。

启动parser服务

# 使用集群命令启动

$ ./mxtool cluster start parser
See the /opt/soft/mxtool.log file for debug information.

# 单独机器启动脚本命令
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start parser

启动sched调度服务

# 使用集群命令启动
# ./mxtool cluster start sched
See the /opt/soft/mxtool.log file for debug information.

# 单独机器启动脚本命令
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start sched

启动toe服务

# 使用集群命令启动

$ ./mxtool cluster start toe
See the /opt/soft/mxtool.log file for debug information.

# 单独机器启动脚本命令
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start toe

启动web服务

# 使用集群命令启动

# ./mxtool cluster start web
See the /opt/soft/mxtool.log file for debug information.

# 单独机器启动脚本命令
$ su - matrix
$ cd /opt/matrix/sbin
$ ./matrix.sh start web


登录web页面

默认租户登录

wecise是默认租户名称,打开浏览器,在url地址栏输入http://ip:8080/wecise (默认:username:admin password:admin)

[!NOTE] 考虑到兼容性及效果,建议使用Chrome内核浏览器,如:Google浏览器、Micosoft全新版Edge浏览器、百度浏览器、360安全浏览器、搜狗浏览器、猎豹浏览器等

默认租户登录

其它租户登录

访问其它租户请使用该租户名称登录,http://ip:8080/eventbus

指定租户登录

results matching ""

    No results matching ""