> [TOC] # 1、算法平台运行准备工作 ## 1.1、创建文件夹 ```shell mkdir /opt/uploadFile mkdir /opt/aiplat mkdir /opt/aiplat/docker_ca mkdir /opt/aiplat/test0708/testPython.py mkdir /opt/aiplat/demoCSV mkdir /opt/aiplat/dataPreProcess ``` ## 1.2、将生成的docker远程连接证书复制到/opt/aiplat/docker_ca下 ```shell cp /etc/docker/* /opt/aiplat/docker_ca/ ``` ## 1.3、新建数据库renren_fast并将数据库导入 ## 1.4、将renren-fast.jar上传到/opt/aiplat ## 1.5、在nginx中创建存放算法平台前端的文件夹 ```shell mkdir /usr/local/nginx/html/aiplat ``` 将算法平台前端文件上传到该文件夹(共有三个,两个文件夹以及一个index.html) # 2、算法平台参数设置 ## 2.1、将application.yml上传到/opt/aiplat,并进行修改 修改minio:endpoint为搭建好的minio IP ```yaml minio: endpoint: http://150.158.138.99:9006 bucket: test0706 access-key: minio secret-key: minio123 ``` 修改docker:url为搭建好的docker所在IP ```yaml docker: url: https://10.168.57.11:2376 ``` 修改host、host-username、host-password为docker宿主机的ip、用户名和密码 ```yaml host: 10.168.57.11 host-username: root host-password: root host-basepath: /opt/uploadFile host-port: 22 ``` 修改docker证书存放路径 ```yaml docker_ca: /opt/aiplat/docker_ca ``` 修改获取kafka实时数据ip与端口,此ip为集群的kafkaIP ```yaml realTimeKafka1: 10.168.57.10:9092 realTimeKafka2: 10.168.57.11:9092 realTimeKafka3: 10.168.57.12:9092 ``` 修改算法结果入库模板ip(注:需提前将该ip所指服务器的hbase开启thrift服务,开启命令为./bin/hbase-daemon.sh start thrift) ```yaml resultToDB: 10.168.57.10 ``` 修改数据预处理数据集存放文件夹 ```yaml datasetLocation: /opt/aiplat/demoCSV ``` 修改数据预处理python文件存放文件夹 ```yaml dataPreProcessLocation: /opt/aiplat/dataPreProcess ``` ###2.2将application-dev.yml上传到/opt/aiplat,并进行修改 修改spring:datasource:url、spring:datasource:username、spring:datasource:password为算法平台数据库所在ip、用户名和密码 ```yaml url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false username: root password: root ``` 修改多数据源配置,其中url要改为大数据平台数据库所在ip ```yaml dynamic: datasource: bigData: url: jdbc:mysql://localhost:3306/hebing?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false username: root password: root driver-class-name: com.mysql.jdbc.Driver ``` 修改hbase集群ip,其中hbase.zookeeper.quorum为hbase集群IP ```yaml hbase: config: hbase.zookeeper.quorum: 10.168.57.10,10.168.57.11,10.168.57.12 hbase.zookeeper.property.clientPort: 2181 zookeeper.znode.parent: /hbase hbase.client.keyvalue.maxsize: 1048576000 ``` ## 2.2、argo 1. 修改renren-fast代码src/main/resources/application.yml如下部分 ```shell 1.argo下 basepath为7.2 端口映射部分argo-server对应的端口,具体值为 https://ip:端口(注意此处为https,端口为红框标记端口) 2.argo下minioendpoint为7.2 端口映射部分minio对应的端口,具体值为http://ip:端口(端口为红框标记端口) 3.argo下 minioAccess-key 为 admin 4.argo下 minioSecret-key 为 password 5.argo下spark 相关参数暂时先不改,具体环境还未确定。 ``` 2. Akubenetes ```shell 1.Akubenete下basepath 值为 kubernetes环境 ip+端口,具体值为 https://ip:6443。(此处为https) 2.Akubenete下kubeconfig-path 值为 kubernetes环境配置文件,需从部署k8s环境的服务器上下载,该配置文件在服务器上的地址为/root/.kube/config。 并将此处地址改为存放该config文件的具体地址。 ``` ![image-20220317210313188](assets/image-20220317210313188.png) ```yaml renren-fast src/main/resources/application.yml 需更改如下部分 #Argo argo: basepath: http://192.168.222.100:32639 minioendpoint: http://192.168.222.100:31471 # minioAccess-key: admin minioAccess-key: vzZBapBXei60zI1t6oPl # minioSecret-key: password minioSecret-key: nkjkRpJLkpb2THUpGKtdMBPPEi3XdmllnOctF8yS sparkMasterRest: spark://10.168.57.10:16066 sparkMaster: spark://10.168.57.10:7077 sparkHdfsurl: hdfs://10.168.57.10:9000 #kubenetes Argo部分获取pod日志 Akubenetes: basepath: https://192.168.222.100:6443 kubeconfig-path: D:\\zhang\\VSCodeProjects\\0209\\config ``` ## 2.3、修改nginx.conf配置文件,在server中添加 ```shell location /aiplat { alias html/aiplat; index index.html index.htm; try_files $uri $uri/ /index.html; } ``` # 3、项目启动 ```shell nohup java -jar renren-fast.jar > log.file 2>&1 & cd/usr/local/nginx/sbin ./nginx -s reload ``` 启动后访问http://ip/aiplat/#/login(这里的ip要改为nginx的ip)