diff --git a/docker-deploy/README.md b/docker-deploy/README.md index 932914dfd..cbcc26533 100644 --- a/docker-deploy/README.md +++ b/docker-deploy/README.md @@ -45,7 +45,7 @@ Before deploying the FATE system, multiple parties should be defined in the conf In the following sample of `docker-deploy/parties.conf` , two parities are specified by id as `10000` and `9999`. Their cluster are going to be deployed on hosts with IP addresses of *192.168.7.1* and *192.168.7.2* ```bash -user=root +user=fate dir=/data/projects/fate partylist=(10000 9999) partyiplist=(192.168.7.1 192.168.7.2) @@ -53,9 +53,32 @@ servingiplist=(192.168.7.1 192.168.7.2) exchangeip= ``` +On the host running FATE, the user is non root and needs`/data/projects/fate` folder permission and docker permission. No other action is required if the user is root. + +```bash +# Create a fate user whose group is docker +[user@localhost]$ sudo useradd -s /bin/bash -g docker -d /home/fate fate +# Set user password +[user@localhost]$ sudo passwd fate +# Create docker-compose deployment directory +[user@localhost]$ sudo mkdir -p /data/projects/fate +# Modify the corresponding users and groups of docker-compose deployment directory +[user@localhost]$ sudo chown -R fate:docker /data/projects/fate +# Select users +[user@localhost]$ sudo su fate +# Check whether you have docker permission +[fate@localhost]$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +# View docker-compose deployment directory +[fate@localhost]$ ls -l /data/projects/ +total 0 +drwxr-xr-x. 2 fate docker 6 May 27 00:51 fate +``` + By default, the exchange node won't be deployed. The exchange service runs on port 9371. If a exchange (co-locates on the host of party or standalone) node is needed, update the value of `exchangeip` to the IP address of the desired host. After completing the above configuration file, use the following commands to generate configuration of target hosts. + ```bash $ cd docker-deploy $ bash generate_config.sh diff --git a/docker-deploy/README_zh.md b/docker-deploy/README_zh.md index e39aac325..b21e47c46 100644 --- a/docker-deploy/README_zh.md +++ b/docker-deploy/README_zh.md @@ -92,7 +92,7 @@ RegistryURI=192.168.10.1/federatedai 下面是修改好的文件,`party 10000`的集群将部署在*192.168.7.1*上,而`party 9999`的集群将部署在*192.168.7.2*上。 ``` -user=root # 运行FATE容器的用户 +user=fate # 运行FATE容器的用户 dir=/data/projects/fate # docker-compose部署目录 partylist=(10000 9999) # 组织id partyiplist=(192.168.7.1 192.168.7.2) # id对应训练集群ip @@ -104,6 +104,28 @@ exchangeip= # 通信组件标识 在运行部署脚本之前,需要确保部署机器可以ssh免密登录到两个运行节点主机上。user代表免密的用户。 +在运行FATE的主机上,user是非root用户的,需要有`/data/projects/fate`文件夹权限和docker权限。如果是root用户则不需要任何其他操作。 + +```bash +# 创建一个组为docker的fate用户 +[user@localhost]$ sudo useradd -s /bin/bash -g docker -d /home/fate fate +# 设置用户密码 +[user@localhost]$ sudo passwd fate +# 创建docker-compose部署目录 +[user@localhost]$ sudo mkdir -p /data/projects/fate +# 修改docker-compose部署目录对应用户和组 +[user@localhost]$ sudo chown -R fate:docker /data/projects/fate +# 选择用户 +[user@localhost]$ sudo su fate +# 查看是否拥有docker权限 +[fate@localhost]$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +# 查看docker-compose部署目录 +[fate@localhost]$ ls -l /data/projects/ +total 0 +drwxr-xr-x. 2 fate docker 6 May 27 00:51 fate +``` + #### 执行部署脚本 以下修改可在任意机器执行。 diff --git a/docker-deploy/parties.conf b/docker-deploy/parties.conf index dcc86d606..b3d47586e 100644 --- a/docker-deploy/parties.conf +++ b/docker-deploy/parties.conf @@ -1,6 +1,6 @@ #!/bin/bash -user=root +user=fate dir=/data/projects/fate partylist=(10000 9999) partyiplist=(192.168.1.1 192.168.1.2)