本文主要是介绍【联邦学习】FATE 集群部署 step3,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
【联邦学习】FATE 集群部署step1
【联邦学习】FATE 集群部署step2
- 部署FATE
参考中文集群部署文档
all 指的是2个虚拟机都要操作
f1 只的是1号虚拟机
f2 指的是2号虚拟机
f1 root
hostnamectl set-hostname VM_0_1_centos
f2 root
hostnamectl set-hostname VM_0_2_centos
all root
vim /etc/hosts加入主机映射
追加
192.168.0.1 VM_0_1_centos
192.168.0.2 VM_0_2_centos3.2 关闭selinux
sed -i '/^SELINUX/s/=.*/=disabled/' /etc/selinux/config
setenforce 03.3 修改Linux最大打开文件数
vim /etc/security/limits.conf
追加
* soft nofile 65536
* hard nofile 655363.4 关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl status firewalld.service3.5 软件环境初始化
mkdir -p /data/app
cd /data/app
wget https://webank-ai-1251170195.cos.ap-guangzhou.myqcloud.com/fate-base.tar.gz
sudo tar -xvzf fate-base.tar.gz
cd fate-base3.5.1 初始化服务器
1)初始化服务器
sudo sh env.sh
chown –R app:apps /data/app2)配置sudo
vim /etc/sudoers.d/app
新增
app ALL=(ALL) ALL
app ALL=(ALL) NOPASSWD: ALL
Defaults !env_reset
3)配置ssh无密登录
su app
可能要设置密码 默认建议输入1ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> /home/app/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keysb.合并id_rsa_pub文件f1 app
scp ~/.ssh/authorized_keys app@192.168.0.2:/home/app/.sshf2 app
cat ~/.ssh/id_rsa.pub >> /home/app/.ssh/authorized_keys
scp ~/.ssh/authorized_keys app@192.168.0.1:/home/app/.sshall app
ssh app@192.168.0.1
ssh app@192.168.0.2
连接测试all app
安装时间较长 需要耐心等待 不要乱动
sh install_java.sh
sh install_redis.sh
sh install_py3.sh
sh install_mysql.sh
这里安装好了之后要 lsof-i:3306
*看下mysql 的状态 保证在运行 重要 这里是坑 不然后面会蹦/data/projects/common/mysql/mysql-8.0.13/bin/mysql -uroot -p -S /data/projects/common/mysql/mysql-8.0.13/mysql.sock输入 fate_dev 进入mysql
set password='fate_dev';
CREATE USER 'root'@'192.168.0.1' IDENTIFIED BY 'fate_dev';
GRANT ALL ON *.* TO 'root'@'192.168.0.1';
CREATE USER 'fate_dev'@'192.168.0.1' IDENTIFIED BY 'fate_dev';
GRANT ALL ON *.* TO 'fate_dev'@'192.168.0.1';
CREATE USER 'root'@'192.168.0.2' IDENTIFIED BY 'fate_dev';
GRANT ALL ON *.* TO 'root'@'192.168.0.2';
CREATE USER 'fate_dev'@'192.168.0.2' IDENTIFIED BY 'fate_dev';
GRANT ALL ON *.* TO 'fate_dev'@'192.168.0.2';
CREATE USER 'fate_dev'@'localhost' IDENTIFIED BY 'fate_dev';
GRANT ALL ON *.* TO 'fate_dev'@'localhost';
flush privileges;
* 注意和官方文档不一样 需要多添加一些权限 不然后面会报错f1 app
cd /data/projects/
这里可能较慢
git clone https://github.com/WeBankFinTech/FATE.git* 和官方文档的不同 此处需安装maven
sudo wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.zip
sudo unzip apache-maven-3.6.2-bin.zip
sudo vim /etc/profile
追加
export MAVEN_HOME=/data/projects/apache-maven-3.6.2
export PATH=${MAVEN_HOME}/bin:$PATH生效
source /etc/profile改阿里云镜像 为了加速下载
sudo vim /data/projects/apache-maven-3.6.2/conf/settings.xml
找到mirrors元素, 在它里面添加子元素mirror:
<mirror><id>nexus</id><mirrorOf>*</mirrorOf> <url>http://maven.aliyun.com/nexus/content/groups/public/</url></mirror><mirror><id>nexus-public-snapshots</id><mirrorOf>public-snapshots</mirrorOf><url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
</mirror>查看是否安装成功
mvn -v*和官方文档的不同 此处需安装java套件
安装java套件
sudo yum install java-devel进入项目的arch目录,进行构建打包:
cd FATE/arch
mvn clean package -DskipTests
cd ../fate-serving
mvn clean package -DskipTests
cd ../fateboard
mvn clean package -DskipTestscd /data/projects
wget https://webank-ai-1251170195.cos.ap-guangzhou.myqcloud.com/third_party.tar.gz
sudo tar -xzvf third_party.tar.gz -C FATE/arch/eggroll/storage-service-cxx/third_partysudo vim /data/projects/FATE/cluster-deploy/scripts/configurations.sh
新增
#!/bin/bash
user=app
dir=/data/projects/fate
mysqldir=/data/projects/common/mysql/mysql-8.0.13
javadir=/data/projects/common/jdk/jdk1.8.0_192
venvdir=/data/projects/fate/venv
redisip=(192.168.0.1 192.168.0.2)
redispass=fate_dev
partylist=(10000 9999)
JDBC0=(192.168.0.1 eggroll_meta fate_dev fate_dev)
JDBC1=(192.168.0.2 eggroll_meta fate_dev fate_dev)
fateflowdb0=(192.168.0.1 fate_flow fate_dev fate_dev)
fateflowdb1=(192.168.0.1 fate_flow fate_dev fate_dev)
iplist=(192.168.0.1 192.168.0.2)
iplist0=(192.168.0.1)
iplist1=(192.168.0.2)
fateboard0=(192.168.0.1)
fateboard1=(192.168.0.2)
eggautocompile=true
fedlist0=(192.168.0.1)
fedlist1=(192.168.0.2)
meta0=(192.168.0.1)
meta1=(192.168.0.2)
proxy0=(192.168.0.1)
proxy1=(192.168.0.2)
roll0=(192.168.0.1)
roll1=(192.168.0.2)
egglist0=(192.168.0.1)
egglist1=(192.168.0.2)
fllist0=(192.168.0.1)
fllist1=(192.168.0.2)
serving0=(192.168.0.1)
serving1=(192.168.0.2)
exchangeip=运行打包部署
cd /data/projects/FATE/cluster-deploy/scripts
sudo bash auto-packaging.sh
sudo bash auto-deploy.sh
注意这里有点慢
而且要输入很多次 f1 和 f2 app用户的密码all app
启动服务cd /data/projects/fate
sh services.sh all startcd /data/projects/fate/serving-server
sh service.sh startcd /data/projects/fate/python/fate_flow
sh service.sh start检查服务状态
cd /data/projects/fate
sh services.sh all statuscd /data/projects/fate/serving-server
sh service.sh statuscd /data/projects/fate/python/fate_flow
sh service.sh status
一定要保证这个服务启动了
不然查看错误日志注意这里如果报错没有找到对应模块 需要添加
执行模块到 python path最小化测试
f1 app
export PYTHONPATH = /data/projects/fate/python
source /data/projects/fate/venv/bin/activate
cd /data/projects/fate/python/examples/min_test_task /sh run.sh host fastf2 app
export PYTHONPATH = /data/projects/fate/python
source /data/projects/fate/venv/bin/activate
cd /data/projects/fate/python/examples/min_test_task/这里直接把$ {host_table} $ {host_namespace} 换成f1 中答应出来的两个变量就可以了sh run.sh guest fast $ {host_table} $ {host_namespace}
这篇关于【联邦学习】FATE 集群部署 step3的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!