RPA æå¡ç«¯è¿ç§» (ä»k8så°docker)
æ¬ææ¥èªäºãé¿éäºå®æ¹éåç«ï¼é¿éå·´å·´å¼æºéåç«-OPSXéåç«-é¿éäºå¼åè ç¤¾åº ã
åæé¾æ¥ï¼RPA æå¡ç«¯è¿ç§» (ä»k8så°docker)-é¿éäºå¼åè 社åº
ä¸ã以dockeræ¹å¼é¨ç½²RPAæå¡ç«¯
1. æ·è´èµæºæ件
éè¿scp æè
å
¶ä»æ¹å¼ædocker
ç®å½åserver
ç®å½ä¼ è¾å°é¨ç½²æå¡å¨ä¸ç/rootæ ¹ç®å½ä¸ã
ï¼dockeråserverç®å½ï¼è¯·èç³»é¿éäºRPAåå¦è·åï¼
scp -r docker [email protected]_ip:/root
scp -r server [email protected]_ip:/root
dockerèµæºæ件ï¼
âââ docker
â âââ docker-ce # docker离线å®è£
å
åå
¶ä¾èµ
â â âââ audit-2.8.4-4.el7.x86_64.rpm
â â âââ audit-libs-2.8.4-4.el7.x86_64.rpm
â â âââ audit-libs-python-2.8.4-4.el7.x86_64.rpm
â â âââ checkpolicy-2.5-8.el7.x86_64.rpm
â â âââ container-selinux-2.74-1.el7.noarch.rpm
â â âââ docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
â â âââ libcgroup-0.41-20.el7.x86_64.rpm
â â âââ libselinux-2.5-14.1.el7.x86_64.rpm
â â âââ libselinux-python-2.5-14.1.el7.x86_64.rpm
â â âââ libselinux-utils-2.5-14.1.el7.x86_64.rpm
â â âââ libsemanage-2.5-14.el7.x86_64.rpm
â â âââ libsemanage-python-2.5-14.el7.x86_64.rpm
â â âââ libsepol-2.5-10.el7.x86_64.rpm
â â âââ libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm
â â âââ pigz-2.3.4-1.el7.x86_64.rpm
â â âââ policycoreutils-2.5-29.el7.x86_64.rpm
â â âââ policycoreutils-python-2.5-29.el7.x86_64.rpm
â â âââ python-IPy-0.75-6.el7.noarch.rpm
â â âââ selinux-policy-3.13.1-229.el7_6.6.noarch.rpm
â â âââ selinux-policy-targeted-3.13.1-229.el7_6.6.noarch.rpm
â â âââ setools-libs-3.3.8-4.el7.x86_64.rpm
â âââ docker-compose
âââ server
âââ cs-docker.tar # RPAæå¡ç«¯éåæ件
âââ docker-compose.yml # dockerå¯å¨èæ¬
é»è®¤dockeræ¯é对centos 7.4çæ¬ï¼å¦æå®è£
çcentos æ¯å
¶ä»çæ¬å¦7.3ï¼å¨å®è£
è¿ç¨ä¸ç¼ºå°ç¸åºçä¾èµå
ï¼éè¦èç½ä¸è½½å¯¹åºçæ¬çdocker-ceéé¢ç离线å®è£
å
ã
2. å®è£ åå¯å¨docker
è¿å ¥docker-ceç®å½ï¼æ§è¡
yum localinstall *.rpm # å¦ææ示éæ©éY
å®è£ å®æåæ§è¡
systemctl start docker
3. é¨ç½²é¿éäºRPA
ï¼1ï¼å°ç¼ææ件docker-composeæ·è´å°ç¨æ·binç®å½ï¼å¹¶ææ
sudo cp -f ~/docker/docker-compose /usr/bin/
sudo chmod +x /usr/bin/docker-compose
(2) è¿å ¥å°serverç®å½ æ§è¡
cd ~/server
sudo docker load -i cs-docker.tar
(3) æ¥çå¯¼å ¥çdockeréå
[[email protected] ~]# docker images
REPOSITORY **TAG** **IMAGE** ID CREATED SIZE`
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-mysql V3.3.11 b3cd3de42e96 2 weeks ago 372MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-assets V3.3.11 34fae7fe864b 2 weeks ago 113MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-robot V3.3.11 5b3d3e4faac2 2 weeks ago 667MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-web V3.3.11 07176746202e 2 weeks ago 672MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-file V3.3.11 45d5e6cf95b0 2 weeks ago 664MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-entry-nginx V3.3.11 ac52a2af52f1 3 weeks ago 157MB
registry.cn-hangzhou.aliyuncs.com/codestore/rpa-redis V3.3.11 3ecb7a463946 3 weeks ago 107MB
ï¼4ï¼ä¿®æ¹docker-compose.ymlæ件ã
å
ç»éç»ék8sç master
èç¹ï¼æ¥ç mysql
å redis
é
ç½®æ件 values.yaml
ï¼æ¾å°æ°æ®åºçå¯ç ï¼ ç¶åå°åå° docker-compose.yml
æ件ç对åºä½ç½®
# Default values for rpa-mysql.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: work_ip:3443/library/rpa-mysql
tag: V3.3.8
pullPolicy: IfNotPresent
service:
name: rpa-mysql
type: NodePort
externalPort: 3306
internalPort: 3306
env:
TZ: "Asia/Shanghai"
MYSQL_ROOT_PASSWORD: "å¯ç "
MYSQL_PASSWORD: "å¯ç "
persistence:
enabled: enable
nfsServer: work_ip
nfsPath: "/rpadata/data/mysql"
accessMode: ReadWriteOnce
size: 8Gi
# Default values for rpa-redis.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: work_ip:3443/library/rpa-redis
tag: V3.3.8
pullPolicy: IfNotPresent
service:
name: rpa-redis
type: ClusterIP
externalPort: 6379
internalPort: 6379
env:
TZ: "Asia/Shanghai"
REDIS_PASSWORD: "å¯ç "
persistence:
enabled: enable
pv:
- name: redis
nfsServer: work_ip
nfsPath: "/rpadata/data/redis"
accessMode: ReadWriteMany
size: 10Gi
- name: redis-log
nfsServer: work_ip
nfsPath: "/rpadata/log/redis"
accessMode: ReadWriteMany
size: 10Gi
version: '3.2'
services:
# rpa-mysql
rpa-mysql:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-mysql:Vx.x.x"
volumes:
- "/rpadata/data/mysql:/var/lib/mysql"
ports:
- "3306:3306"
environment:
- TZ=Asia/Shanghai
- MYSQL_PASSWORD=å¯ç
- MYSQL_ROOT_PASSWORD=å¯ç
# rpa-redis
rpa-redis:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-redis:Vx.x.x"
volumes:
- "/rpadata/data/redis:/data"
- "/rpadata/log/redis:/var/log/redis"
environment:
- TZ=Asia/Shanghai
- REDIS_PASSWORD=å¯ç
# rpa-assets
rpa-assets:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-assets:Vx.x.x"
ports:
- "7000:7000"
environment:
- TZ=Asia/Shanghai
# rpa-file
rpa-file:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-file:Vx.x.x"
volumes:
- "/rpadata/file/file:/data/file"
environment:
- TZ=Asia/Shanghai
- MYSQL_PASSWORD=å¯ç
- REDIS_PASSWORD=å¯ç
depends_on:
- rpa-mysql
- rpa-redis
# rpa-web
rpa-web:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-web:Vx.x.x"
ports:
- "7001:7001"
volumes:
- "/rpadata/web/file:/data/file"
environment:
- TZ=Asia/Shanghai
- MYSQL_PASSWORD=å¯ç
- REDIS_PASSWORD=å¯ç
depends_on:
- rpa-file
# rpa-robot
rpa-robot:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-robot:Vx.x.x"
ports:
- "7002:7002"
volumes:
- "/rpadata/robot/file:/data/file"
environment:
- TZ=Asia/Shanghai
- MYSQL_PASSWORD=å¯ç
- REDIS_PASSWORD=å¯ç
depends_on:
- rpa-web
# rpa-entry-nginx
rpa-entry-nginx:
image: "xxxx.xxxx.aliyuncs.com/xxxx/xxx-nginx:Vx.x.x"
ports:
- "80:80"
- "443:443"
environment:
- SERVER_RESOLVER_IP=127.0.0.11
- SERVER_HOST=rpa.aliyun.net
- CLUSTER_HOST=
depends_on:
- rpa-file
ï¼5ï¼å¯å¨dockeréå
sudo docker-compose -f docker-compose.yml up -d
äº.æ·è´k8sæ¹å¼é¨ç½²çRPAæå¡ç«¯æ°æ®
1ãæå RPAæå¡ç«¯çæææ°æ®
RPAæå¡ç«¯çæææ°æ®é½ä¿åå¨ work
èç¹ç /rpadata/
ç®å½ä¸ï¼å¤ä»½æ´ä¸ª/rpadata/
ç®å½å³å¯ã
[[email protected] ~]# tar -czvf ~/rpadata.tar.gz /rpadata/ # å¤ä»½æ°æ®å°homeç®å½ä¸
2ãå°æå 好çRPAæå¡ç«¯æ°æ®æ·è´å°æ°çæå¡å¨ä¸
scp ~/rpadata.tar.gz [email protected]_ip:/root # å°æ°æ®æ·è´å°æ°çæå¡å¨rootç®å½ä¸
3ãå°å¤ä»½çæ件解åå°/rpadata/
ç®å½ä¸
[[email protected] ~]# cd /
[[email protected] ~]# tar -xzvf ~/rpadata.tar.gz
ä¸ãå¯å¨é¿éäºRPAæå¡
ï¼1ï¼å¯å¨dockeréå
sudo docker-compose -f docker-compose.yml up -d
ï¼2ï¼è®¾ç½®docker-composeå¼æºå¯å¨
vim /etc/rc.d/rc.****local**** # ç¼è¾å¯å¨èæ¬ï¼å¨æ«å°¾æ·»å ä¸è¡ï¼å å
¥ä¸é¢çèæ¬
systemctl start docker
/usr/bin/docker-compose -f /root/server/docker-compose.yml up -d # 注æä¿®æ¹æèªå·±çdocker-compose.ymlæ件ä½ç½®
sudo chmod +x /etc/rc.d/rc.**local**
åãæ¥çç»æ
å¨æå¡å¨ä¸æ§è¡ï¼éè¦æIPæ¹æèªå·±çæå¡å¨IP
[[email protected] ~]# curl -H "Host:rpa.aliyun.net" http://106.15.137.252/login # 注ææ**ip**æ¢æèªå·±æå¡å¨ç**IP**
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script type="text/javascript" async="" src="/react-dom.js"></script>
<script type="text/javascript" async="" src="/polyfill.min.js"></script>
<link rel="stylesheet" type="text/css" href="/index.css?v=201812051008">
<link rel="shortcut icon" href="/images/ico/favicon.ico">
<title>é¿éäºRPAæ§å¶å°</title>
<!--[****if**** lt IE 9]>
<script>location.href = "//www.taobao.com/markets/tbhome/ali-page-updater"; </script>
<![endif]-->
</head>
<**body**>
<**div** **id**="ice_container"></**div**>
<script type="text/javascript" src="/rsa/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/webuploader/webuploader.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/rsa/RSA.js"></script>
<script type="text/javascript" charset="utf-8" src="/rsa/BigInt.js"></script>
<script type="text/javascript" charset="utf-8" src="/rsa/Barrett.js"></script>
<script type="text/javascript" charset="utf-8" src="/index.js?v=201812051008" id="ice-script"></script>
</**body**>
</html>
æ¥çæ¥å¿
sudo docker-compose -f docker-compose.yml logs -f