1
0
mirror of https://github.com/newnius/YAO-docs.git synced 2024-07-06 05:15:18 +00:00
This commit is contained in:
Newnius 2019-12-04 20:29:53 +08:00
parent 1553d75352
commit 035dd0df5f
6 changed files with 48 additions and 19 deletions

View File

@ -1,15 +1,19 @@
#!/bin/bash
docker run \
-d \
--gpus all \
--name yao-agent \
--pid=host \
-p 8000:8000 \
-e ClientID=1 \
-e ClientHost=yao-agent \
-e KafkaBrokers=kafka-node1:9092,kafka-node2:9092,kafka-node3:9092 \
--add-host=kafka-node1:192.168.0.1 \
--add-host=kafka-node2:192.168.0.2 \
--add-host=kafka-node3:192.168.0.3 \
--network yao-net \
--network-alias $(hostname) \
--hostname $(hostname) \
-d \
--restart always \
--detach=true \
--env ClientID=$(hostname) \
--env ClientHost=$(hostname) \
--env KafkaBrokers=kafka-node1:9092,kafka-node2:9092,kafka-node3:9092 \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
quickdeploy/yao-agent
#--pid=host \

10
sbin/run_agent_helper.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
docker run \
--name yao-agent-helper \
-d \
--restart always \
--detach=true \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
docker:latest sleep 86400000

11
sbin/start_agent_master.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
docker service create \
--name yao-agent-master \
--network yao-net \
--constraint node.role==manager \
--mode global \
--detach=true \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
quickdeploy/yao-agent-master:dev

View File

@ -8,6 +8,13 @@ docker service create \
--replicas 1 \
--detach=true \
--publish 80:80 \
--env SITE_SCHEDULER_ADDR=http://yao-scheduler:8080 \
--env SITE_BASE_URL=http://210.28.132.13 \
--env MYSQL_HOST=mysql \
--env MYSQL_PORT=3306 \
--env MYSQL_DATABASE=yao \
--env MYSQL_USER=root \
--env MYSQL_PASSWORD=123456 \
--env REDIS_HOST=redis \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,source=/data/yao-portal/config/,target=/config/ \
quickdeploy/yao-portal
quickdeploy/yao-portal:dev

View File

@ -8,5 +8,4 @@ docker service create \
--replicas 1 \
--detach=true \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,source=/data/yao-scheduler/,target=/root/yao/ \
quickdeploy/yao-scheduler:dev sleep infinity

View File

@ -27,7 +27,7 @@ docker swarm join --token A-LONG-TOKEN-STRING-HERE 192.168.0.1:2377
## Create an overlay network named `yao`
```bash
docker network create --driver overlay yao-net
docker network create --driver overlay --attachable --opt encrypted yao-net
```
@ -61,9 +61,11 @@ bin/kafka-topics.sh \
```
## Start the agents
## Start the agents in each YAO-Worker
```bash
sbin/start_agent.sh
sbin/run_agent_helper.sh
sbin/run_agent.sh
```
@ -88,10 +90,6 @@ sbin/start_redis.sh
sbin/start_portal.sh
```
## Configure
update `BASE_URL` in `/data/yao-portal/config/config.inc.php` & `/data/yao-portal/config/config.js`
## Install
Visit `http://YOUR_IP/install.php`