入门#

本节将演示使用默认配置参数在一台或者多台 Linux 主机上部署 openYuanrong ,建议用于学习和开发,生产部署请参考用户指南

部署 openYuanrong#

首先参考安装指南在所有部署主机上安装 openYuanrong 命令行工具 yr,我们将使用它部署 openYuanrong。

任选一台主机,使用如下命令部署主节点

yr start --master

部署成功会打印如下主节点信息。

Cluster master info:
    local_ip:x.x.x.x,master_ip:x.x.x.x,etcd_ip:x.x.x.x,etcd_port:15903,global_scheduler_port:11188,ds_master_port:12729,cluster_deployer_port:22775,etcd_peer_port:17621,bus-proxy:30140,bus:32480,ds-worker:33210,

此时,openYuanrong 服务已经可以使用。需要多节点集群部署时,参考如下命令,在其余主机上使用命令行工具 yr 部署从节点

# 使用前一步骤打印的主节点信息替换引号中的内容。
$ yr start --master_info "local_ip:x.x.x.x,master_ip:x.x.x.x,etcd_ip:x.x.x.x,etcd_port:15903,global_scheduler_port:11188,ds_master_port:12729,cluster_deployer_port:22775,etcd_peer_port:17621,bus-proxy:30140,bus:32480,ds-worker:33210,"

在节点任一主机上执行 yr status 命令可查看集群状态。正常情况下,current running agents 的数量和实际部署的节点数量一致。

# x.x.x.x:15903替换为部署步骤打印的etcd_ip和etcd_port
$ yr status --etcd_endpoint x.x.x.x:15903
YuanRong cluster addresses:
              functionsystem: x.x.x.x:12729
                  datasystem: x.x.x.x:33210

YuanRong cluster status:
  current running agents: 2

可运行简单示例进一步验证部署结果。

删除 openYuanrong 集群#

使用命令行工具 yr 在所有部署节点上执行如下命令:

yr stop

Note

yr stop 命令会触发 openYuanrong 进程优雅退出,最长等待 5 秒,之后 openYuanrong 进程会被强制清除。