全部产品
  • 首页 > 
  • SUSE服务器部署手册

SUSE服务器部署手册

一、私有化部署机器配置需求

所属系统 服务端 客户端
角色 主节点 客户端工作节点
配置规格 建议配置:4核、8GB内存及以上;
主频:2.5GHz及以上;
硬盘:60GB及以上
建议配置: 2核、8GB 内存及以上;
主频:2.5G及以上;
硬盘:256GB及以上
内核 SUSE 12 SP2、SP3 Windows7及以上版本或者Windows server2012 R2及以上版本;
推荐使用:Windows7、Windows 10或者Windows server2012 R2及以上版本
数量 1 若干
环境准备 (1)Python>=2.7
(2)需要root权限,开放ssh 22端口
(3)开放端口:80、443、3306、6379、7001、7002、1935
(1)安装.net 4.5
(2)安装office 2013
(3)安装VC++ 2015
(4)安装python 3.5.4
备注 服务端服务部署及镜像仓库 使用台式电脑或笔记本电脑,机器人运行的时候电脑需要被独占使用

镜像资源

共分为三部分:
1.docker 离线安装包(SUSE于13.2版本以后自带docker资源,只需要zypper in docker就可以拉取docker运行。)
2.rpa镜像文件3.docker-compose文件

" class="reference-link">image.png

环境准备

  1. 获取镜像文件
  2. scp -r root@IP地址:/root/docker /root/docker1
  3. scp -r root@IP地址:/root/docker_img/docker_img_3.3.14_all_in_one /root
  4. # 此步骤属于获取docker安装包
  5. SUSE13.2版本以后自带docker资源,只需要zypper in docker就可以拉取docker运行。
  6. wget https://download.docker.com/linux/static/stable/x86_64/docker-17.03.2-ce.tgz

二、开始部署

解压文件

  1. # 解压docker文件
  2. tar xzvf docker-17.03.2-ce.tgz
  3. # 将docker-compose这个文件放到解压后的docker文件中
  4. sudo cp docker/* /usr/bin/

启动docker

  1. sudo dockerd

如果遇到报错


启动docker daemon sudo dockerd
这一步遇到报错如下:

  1. INFO[0000] libcontainerd: new containerd process, pid: 19581
  2. WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
  3. ERRO[0001] 'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
  4. ERRO[0001] 'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
  5. ERRO[0001] devmapper: Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a dynamic binary to use devicemapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options
  6. INFO[0001] Graph migration to content-addressability took 0.00 seconds
  7. WARN[0001] Your kernel does not support swap memory limit
  8. WARN[0001] Your kernel does not support kernel memory limit
  9. INFO[0001] Loading containers: start.
  10. WARN[0001] Running modprobe bridge br_netfilter failed with message: , error: exec: "modprobe": executable file not found in $PATH
  11. WARN[0001] Running modprobe nf_nat failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
  12. WARN[0001] Running modprobe xt_conntrack failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
  13. INFO[0001] Firewalld running: false
  14. Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: Iptables not found
  15. 1

错误提示找不到Iptables
解决方案:
修改~/.bashrc将/usr/sbin加入环境变量

  1. vim ~/.bashrc
  2. export PATH="/usr/sbin/:$PATH"

再次启动docker daemon sudo dockerd成功

  1. # INFO[0000] libcontainerd: new containerd process, pid: 21413
  2. WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
  3. INFO[0001] Graph migration to content-addressability took 0.00 seconds
  4. WARN[0001] Your kernel does not support swap memory limit
  5. WARN[0001] Your kernel does not support kernel memory limit
  6. INFO[0001] Loading containers: start.
  7. INFO[0001] Firewalld running: false
  8. INFO[0001] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
  9. INFO[0001] Loading containers: done.
  10. INFO[0001] Daemon has completed initialization
  11. INFO[0001] Docker daemon commit=f5ec1e2 graphdriver=overlay2 version=17.03.2-ce
  12. INFO[0001] API listen on /var/run/docker.sock
  13. 执行到此步骤属于正常,需重新开启窗口执行命令。

运行sudo docker run hello-world进行测试

  1. ERRO[0044] Handler for POST /v1.27/containers/create returned error: No such image: hello-world:latest
  2. Unable to find image 'hello-world:latest' locally
  3. latest: Pulling from library/hello-world
  4. 1b930d010525: Pull complete
  5. Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
  6. Status: Downloaded newer image for hello-world:latest
  7. Hello from Docker!
  8. This message shows that your installation appears to be working correctly.
  9. To generate this message, Docker took the following steps:
  10. 1. The Docker client contacted the Docker daemon.
  11. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  12. (amd64)
  13. 3. The Docker daemon created a new container from that image which runs the
  14. executable that produces the output you are currently reading.
  15. 4. The Docker daemon streamed that output to the Docker client, which sent it
  16. to your terminal.
  17. To try something more ambitious, you can run an Ubuntu container with:
  18. $ docker run -it ubuntu bash
  19. Share images, automate workflows, and more with a free Docker ID:
  20. https://hub.docker.com/
  21. For more examples and ideas, visit:
  22. https://docs.docker.com/get-started/

另:在其他机器上升级docker版本之后执行sudo dockerd出现如下报错:

  1. INFO[0000] libcontainerd: new containerd process, pid: 11582
  2. WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
  3. ERRO[0001] devmapper: Udev sync is not supported. This will lead to data loss and unexpected behavior. Install a dynamic binary to use devicemapper or select a different storage driver. For more information, see https://docs.docker.com/engine/reference/commandline/dockerd/#storage-driver-options
  4. ERRO[0001] [graphdriver] prior storage driver devicemapper failed: driver not supported
  5. Error starting daemon: error initializing graphdriver: driver not supported

解决方法:

  1. sudo mv /var/lib/docker /var/lib/docker.old

再次启动docker daemon sudo dockerd
服务可以正常启动。 原因是:/var/lib/docker 目录有旧版本的遗留文件,版本升级后需要删除。
这时根据需要将刚刚复制备份的文件删除即可。rm -rf /var/lib/docker.old
结束END


创建文件夹

  1. sudo mkdir -p /private/rpadata/data/mysql
  2. sudo mkdir -p /private/rpadata/data/redis
  3. sudo mkdir -p /private/rpadata/log/redis
  4. sudo mkdir -p /private/rpadata/file/file/fs
  5. sudo mkdir -p /private/rpadata/file/file/upload
  6. sudo mkdir -p /private/rpadata/web/file/upload
  7. sudo mkdir -p /private/rpadata/robot/file/upload
  8. sudo chown -R root /private/rpadata/
  9. sudo chgrp -R root /private/rpadata/
  1. # 加载镜像
  2. sudo docker load -i cs-docker.tar
  3. # 查看本地镜像
  4. docker images

image.png

  1. # 复制到根目录并提权
  2. sudo cp -f ~/docker/docker-compose /usr/bin/
  3. sudo chmod +x /usr/bin/docker-compose
  4. # 运行镜像
  5. sudo docker-compose -f docker-compose.yml up -d
  6. # 查看镜像
  7. docker ps
  8. # 验证镜像, 需要将IP修改成自己的IP。
  9. curl -H "Host:rpa.aliyun.net" http://47.103.9.228/login

image.png

查看日志

  1. sudo docker-compose -f docker-compose.yml logs -f

将自启动命令加入配置文件,开机自启动

  1. vim /etc/init.d/boot.local
  2. 加入下方两条命令
  3. sudo dockerd
  4. sudo docker-compose -f /root/docker_img_3.3.14_all_in_one/docker-compose.yml up -d
  5. 后退出编辑页面,增加执行权限
  6. sudo chmod +x boot.local

问题排查

1.查看docker 进程 docker ps -a
列表中第一列是docker的进程id

  1. docker logs -f # docker进程id 查看具体的

2.重启服务

  1. sudo docker-compose -f docker-compose.yml restart

3.重新部署

  1. sudo docker-compose -f docker-compose.yml stop
  2. sudo docker-compose -f docker-compose.yml rm

4.清除所有数据 需要先把/private/rpadata 目录删除
然后从第5步开始重新操作

5.进入到具体容器内部:

  1. docker exec -it 具体进程ID /bin/bash

三、客户端配置修改

1)在C:\Windows\System32\drivers\etc\hosts里面绑定IP和访问域名(访问域名在镜像的docker-compose.yml配置文件里设置,默认是rpa.aliyun.net,配置时可以修改)
2) 修改阿里云RPA安装目录下的app.json文件,将里面的域名修改成上面的访问域名
【注意】:如果是采用http访问的,请将默认的https换成http,wss换成ws;如果是采用https访问的,请保留https和wss(目前仅支持http通信)
3)用上面的访问域名登录控制台,浏览器打开:http://rpa.aliyun.net/login
登录账号:Administrator
默认密码:请联系阿里云RPA同学获取 在【系统设置】里可以修改登录密码
4)在控制台的【授权许可管理】—>【授权许可信息】里面更新授权许可证书(授权license由阿里云RPA团队提供),可以查看license里包含的详细许可信息
5)在【用户与权限管理】里面添加用户,并配置权限组
6)在【授权许可管理】—>【授权许可列表】生成相应的授权许可
7)打开安装好的客户端,点击图标激活studio、有人值守机器人、无人值守机器人或服务型机器人等
如还有其他问题,请及时联系琰珉(shiping.bsp@alibaba-inc.com或钉钉号:bsping)

四、数据备份与恢复

1、数据备份

服务端的所有数据都保存在/private/rpadata/目录下,备份整个/private/rpadata/目录即可。

  1. [root@linux ~]# cd /private
  2. [root@linux ~]# tar -czvf ~/rpadata.tar.gz ./rpadata/

2、数据恢复

将备份的文件解压到/private/目录下

  1. [root@linux ~]# mkdir /private && cd /private
  2. [root@linux ~]# tar -xzvf ~/rpadata.tar.gz

随后按服务端部署手册部署,操作过程中忽略第4项(部署阿里云RPA)中的第2步(创建依赖的目录)。

五、镜像更新

1、参考步骤四数据备份,备份好服务端的数据

2、停止当前的镜像服务

  1. [root@linux ~]# cd ~/server
  2. [root@linux ~]# sudo docker-compose -f docker-compose.yml stop

3、导入新的镜像

  1. cd ~/server
  2. sudo docker load -i cs-docker.tar

4、修改docker-compose.yml文件

修改docker-compose.yml文件中的镜像版本号,版本号与导入的新的镜像版本号一致

5、启动docker镜像

  1. sudo docker-compose -f docker-compose.yml up -d