云平台运行文档.md 3.6 KB

[TOC]

1.云平台运行准备工作

  1. 创建文件夹
mkdir /opt/mkcloud

mkdir /home/mkcloud

mkdir /home/algorithm
  1. 新建数据库mkcloud并将数据库导入

  2. mkcloud.jar上传到/opt/mkcloud

  3. 在nginx中创建存放算法平台前端的文件夹

  mkdir /usr/local/nginx/html/mkcloud
  1. 将云平台前端文件上传到该文件夹(共有三个,两个文件夹以及一个index.html)
  2. 上传基础镜像到harbor仓库
# 1.将python3_base.tar文件上传到安装harbor仓库的节点
docker load  < python3_base.tar

image-20220317151709566

docker tag server.harbor.com:80/library/python3_base:v1.0 180.76.231.231:8088/library/python3_base:v1.0

docker push 180.76.231.231:8088/library/python3_base:v1.0

2.云平台参数设置

2.1将application.yml上传到/opt/mkcloud,并进行修改

  1. 修改host、host-username、host-password为kubesphere宿主机的ip、用户名和密码
host: 10.168.57.11
host-username: root
host-password: root
host-basepath: /opt/uploadFile
host-port: 22
  1. 修改相应的端口
# 修改kubesphereUrl为kubesphere所在ip以及30881端口
kubesphereUrl: http://42.192.195.253:30881

# 修改harborUrl为harbor所在ip以及80端口
harborUrl: 42.192.195.253:80

# 修改Dockerfile和shell脚本暂存地址
tempFileLocation: /home/mkcloud/algorithm

2.2将application-dev.yml上传到/opt/mkcloud,并进行修改

修改spring:datasource:url、spring:datasource:username、spring:datasource:password为云平台数据库所在ip、用户名和密码

url: jdbc:mysql://localhost:3306/mkcloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: root

修改多数据源配置,其中url为算法平台数据库所在ip

dynamic:
  datasource:
slave2:
  driver-class-name: com.mysql.cj.jdbc.Driver
  url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
  username: root
  password: root

修改hbase集群ip,其中hbase.zookeeper.quorum为hbase集群IP

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

修改minio:endpoint为搭建好的minio IP

minio:
  endpoint: http://150.158.138.99:9006
  bucket: test0706
  access-key: minio
  secret-key: minio123

2.3修改nginx.conf配置文件,在server中添加

    location /mkcloud {
                 alias  html/mkcloud;
                 index  index.html index.htm;
                 try_files  $uri  $uri/   /index.html;
         }	
	location  ^~ /kubesphereApi/ {
		proxy_pass http://123.56.99.12:30881/;#这里的ip要改为kubesphere的ip
		proxy_set_header Host $host;
		proxy_set_header  X-Real-IP        $remote_addr;
		proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header X-NginX-Proxy true;
	}
	
location ^~ /mkcloud/mkcloud/ {  
	proxy_pass http://112.126.68.148:8085/mkcloud/;#这里的ip要改为云平台后端服务所在ip
	proxy_set_header Host $host;
	proxy_set_header  X-Real-IP        $remote_addr;
	proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
	proxy_set_header X-NginX-Proxy true;
}

3.项目启动

nohup java -jar mkcloud.jar > log.file 2>&1 &

cd/usr/local/nginx/sbin

./nginx -s reload

启动后访问http://ip/mkcloud/#/login(这里的ip要改为nginx的ip)