STF启动命令

分步启动命令

stf_start.sh

killall -9 node
killall -9 rethinkdb
killall -9 nginx

nginx -c /home/nginx/nginx.conf &
sleep 3
rethinkdb &
sleep 3
stf app --secret lion \
    --port 3100 \
    --auth-url http://192.168.3.85/auth/mock/ \
    --websocket-url ws://192.168.3.85/ &
sleep 3
stf auth-mock --secret lion \
    --port 3200 \
    --app-url http://192.168.3.85/ &
sleep 3
stf migrate
stf processor stf-processer \
    --connect-app-dealer tcp://192.168.3.85:7160 \
    --connect-dev-dealer tcp://192.168.3.85:7260 &
stf reaper dev \
    --connect-push tcp://192.168.3.85:7270 \
    --connect-sub tcp://192.168.3.85:7150 \
    --heartbeat-timeout 30000 &
stf storage-plugin-apk --port 3300 \
    --storage-url http://192.168.3.85/ &
stf storage-plugin-image --port 3400 \
    --storage-url http://192.168.3.85/ &
stf storage-temp --port 3500 \
    --save-dir /data &
stf triproxy app \
    --bind-pub "tcp://*:7150" \
    --bind-dealer "tcp://*:7160" \
    --bind-pull "tcp://*:7170" &
stf triproxy dev \
    --bind-pub "tcp://*:7250" \
    --bind-dealer "tcp://*:7260" \
    --bind-pull "tcp://*:7270" &
stf websocket --secret lion \
    --port 3600 \
    --storage-url http://192.168.3.85/ \
    --connect-sub tcp://192.168.3.85:7150 \
    --connect-push tcp://192.168.3.85:7170 &
stf api --secret lion \
  --port 3700 \
  --connect-sub tcp://192.168.3.85:7150 \
  --connect-push tcp://192.168.3.85:7170 &

设备节点

stf provider \
    --name "provider/floor4" \
    --connect-sub tcp://192.168.3.85:7250 \
    --connect-push tcp://192.168.3.85:7270 \
    --storage-url http://192.168.3.85/ \
    --public-ip 10.10.23.60 \
    --min-port=15000 \
    --max-port=25000 \
    --heartbeat-interval 10000 \
    --screen-ws-url-pattern "ws://192.168.3.85/d/floor4/<%= serial %>/<%= publicPort %>/"  
 
adb start-server

Docker启动STF命令

服务端

#启动nginx
docker run -d \
  --name nginx \
  --net host \
  -v /home/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
  nginx:latest \
  nginx

#启动proxy 
docker run -d\
  --name proxy \
  -p 28015 \
  -e RETHINKDB_PORT_28015_TCP=tcp://192.168.3.85:28015 \
  openstf/ambassador:latest

#启动rethinkdb 
docker run -d \
  --name rethinkdb \
  -v /srv/rethinkdb:/data \
  --net host \
  rethinkdb:latest \
  rethinkdb --bind all \
  --cache-size 8192

#启动stf-app
docker run -d \
  --name stf-app3100 \
  --link proxy:rethinkdb \
  -e "SECRET=YOUR_SESSION_SECRET_HERE" \
  -p 3100:3000 \
  openstf/stf:latest \
  stf app --port 3000 \
    --auth-url http://192.168.3.85/auth/mock/ \
    --websocket-url ws://192.168.3.85/

#启动stf-auth
docker run -d \
  --name stf-auth3200 \
  -e "SECRET=YOUR_SESSION_SECRET_HERE" \
  -p 3200:3000 \
  openstf/stf:latest \
  stf auth-mock --port 3000 \
    --app-url http://192.168.3.85/

#启动stf-migrate
docker run -d \
  --name stf-migrate \
  --link proxy:rethinkdb \
  openstf/stf:latest \
  stf migrate    

#启动stf-processer
docker run -d \
  --name stf-processer \
  --link proxy:rethinkdb \
  openstf/stf:latest \
  stf processor stf-processer \
    --connect-app-dealer tcp://192.168.3.85:7160 \
    --connect-dev-dealer tcp://192.168.3.85:7260

#启动stf-reaper
docker run -d \
  --name stf-reaper \
  --link proxy:rethinkdb \
  openstf/stf:latest \
  stf reaper dev \
    --connect-push tcp://192.168.3.85:7270 \
    --connect-sub tcp://192.168.3.85:7150 \
    --heartbeat-timeout 30000    

#启动stf-storage-plugin-apk
docker run -d \
  --name storage-apk \
  -p 3300:3000 \
  openstf/stf:latest \
  stf storage-plugin-apk --port 3000 \
    --storage-url http://192.168.3.85/

#启动stf-storage-plugin-image
docker run -d \
  --name storage-image \
  -p 3400:3000 \
  openstf/stf:latest \
  stf storage-plugin-image --port 3000 \
    --storage-url http://192.168.3.85/

#启动stf-storage-temp
docker run -d \
  --name storage-temp \
  -v /mnt/storage:/data \
  -p 3500:3000 \
  openstf/stf:latest \
  stf storage-temp --port 3000 \
    --save-dir /data    

#启动stf-triproxy-app
docker run -d \
  --name t-app \
  --net host \
  openstf/stf:latest \
  stf triproxy app \
    --bind-pub "tcp://*:7150" \
    --bind-dealer "tcp://*:7160" \
    --bind-pull "tcp://*:7170"

#启动stf-triproxy-dev
docker run -d \
  --name t-dev \
  --net host \
  openstf/stf:latest \
  stf triproxy dev \
    --bind-pub "tcp://*:7250" \
    --bind-dealer "tcp://*:7260" \
    --bind-pull "tcp://*:7270"    

#启动websocket
docker run -d \
  --name websocket \
  --link proxy:rethinkdb \
  -e "SECRET=YOUR_SESSION_SECRET_HERE" \
  -p 3600:3000 \
  openstf/stf:latest \
  stf websocket --port 3000 \
    --storage-url http://192.168.3.85/ \
    --connect-sub tcp://192.168.3.85:7150 \
    --connect-push tcp://192.168.3.85:7170

#启动stf-api
docker run -d \
  --name stf-api \
  --link proxy:rethinkdb \
  -e "SECRET=YOUR_SESSION_SECRET_HERE" \
  -p 3700:3000 \
  openstf/stf:latest \
  stf api --port 3000 \
  --connect-sub tcp://192.168.3.85:7150 \
  --connect-push tcp://192.168.3.85:7170      

设备端

#启动adbd
docker run -d \
  --name adbd \
  --privileged \
  -v /dev/bus/usb:/dev/bus/usb \
  --net host \
  sorccu/adb:latest

#启动provider
docker run -d \
  --name provider \
  --net host \
  openstf/stf:latest \
  stf provider \
    --name "provider/floor4" \
    --connect-sub tcp://192.168.3.85:7250 \
    --connect-push tcp://192.168.3.85:7270 \
    --storage-url http://192.168.3.85/ \
    --public-ip 10.10.23.60 \
    --min-port=15000 \
    --max-port=25000 \
    --heartbeat-interval 10000 \
    --screen-ws-url-pattern "ws://192.168.3.85/d/floor4/<%= serial %>/<%= publicPort %>/"  

firefox浏览器会导致api访问404
可以不启动docker的adb,直接使用外部adb
注意:官方文档中使用https和wss。

你可能感兴趣的:(STF启动命令)