跳转到内容

单租户

本次部署将使用以下技术栈和工具;如遇不同环境导致差异,请根据实际情况采用相应的替代方案。本教程仅供参考。部分基础中间件的安装请参考 8.2 版本文档或自行完成处理;本文仅提供云枢安装相关的注意事项与配置文件。

  • 数据库:PostgreSQL16 建议使用16,做过强适配
  • JDK版本:OpenJDK 1.8
  • Redis版本:Redis7+
  • Nginx版本:1.5.4+
apt update && apt install vim -y && apt install zip -y && apt install unzip -y
mkdir -p /data

上传云枢和报表文件至/data目录下

cd /data/ && unzip cloudpivot_*.zip && rm -rf cloudpivot_*.zip;unzip reporter-deploy-*.zip && rm -rf reporter-deploy-*.zip

用户管理端无需刷入SQL脚本,只需配置好对应数据库信息,启动程序后会自动刷入

spring:
jpa:
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#database-platform: org.hibernate.dialect.Oracle12cDialect # Oracle
#database-platform: org.hibernate.dialect.SQLServerDialect # SQL Server
#database-platform: org.hibernate.dialect.DmDialect # DM
database-platform: com.authine.cloudpivot.plugins.databse.PostgreSelfDialect # PostgreSQL
#database-platform: org.hibernate.dialect.MySQL5InnoDBDialect # MySQL
show-sql: false
properties:
hibernate:
temp:
use_jdbc_metadata_defaults: true #数据库为PostgreSQL时需将此配置放开
redis:
host: xx.xx.xx.xx
database: 1
password: ExamplePassword
port: 6379
prefix: "user-"
Terminal window
/data/cloudpivot/program/backEnd/deploy.sh cloudpivot_user

先在执行cloudpivot_launcher库中执行/cloudpivot/db/launcher/postgresql/ddl.sql

使用postgresql的时候一定要注意cht别名,目前8.6.9以前都需要去掉才能刷入

spring:
redis:
host: xx.xx.xx.xx #地址
database: 1
password: ExamplePassword #密码
port: 6379 #端口
prefix: ""
quartz:
auto-startup: false #本地启动时,不加入quartz集群
security:
oauth:
sso_uri: http://127.0.0.1:8091/user
Terminal window
/data/cloudpivot/program/backEnd/deploy.sh launcher

此配置来自官网包中的nginx配置,只是进行了优化,优化了/admin跳转问题

#对应的云枢服务配置信息 多节点负载均衡模式可自行调整
upstream cloud8 {
least_conn;
server 127.0.0.1:8081;
}
#对应的用户服务配置信息 多节点负载均衡模式可自行调整
upstream cloudpivotuser {
least_conn;
server 127.0.0.1:8091;
}
upstream manage {
least_conn;
server 127.0.0.1:8090;
}
#对应的报表服务配置信息 多节点负载均衡模式可自行调整
upstream report2 {
least_conn;
server 127.0.0.1:6062;
}
server {
listen 8090 default_server;
listen [::]:8090 default_server;
server_name _;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
underscores_in_headers on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript image/jpeg image/gif image/png image/svg+xml font/ttf font/otf application/json;
gzip_vary off;
if_modified_since off;
root /data/cloudpivot/program/frontEnd/portal/;
server_tokens off;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/index.html $uri/ /index.html;
# absolute_redirect off;
# 入口页面不缓存
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
location ~* ^.+\.(css|js|ico|gif|jpg|jpeg|png)$ {
log_not_found off;
# 关闭日志
access_log off;
# 缓存时间30天
expires 30d;
}
location ^~ /api/ {
proxy_pass http://cloud8;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 可将下面两个配置为固定值: 对应入口层协议和端口 (适用于: nginx外层还有proxy并与当前scheme, server_port不一致的情况)
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port $server_port;
#proxy_set_header X-Forwarded-Port 443;
client_max_body_size 200m;
proxy_read_timeout 300;
}
location ^~ /api/api/runtime/ai/ {
proxy_pass http://cloud8;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
client_max_body_size 200m;
proxy_read_timeout 36000;
proxy_buffering off;
gzip off;
add_header X-Accel-Buffering no;
}
location ^~ /user/ {
# user服务的IP地址和端口,内网地址
proxy_pass http://cloudpivotuser;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
client_max_body_size 200m;
proxy_read_timeout 7300;
}
location ^~ /platform/tenant/ {
proxy_pass http://manage;
proxy_set_header Host $http_host;
proxy_set_header Forwarded host=$http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m;
proxy_read_timeout 3000;
error_page 401 =302 http://$server_name:$server_port/platform/#/login;
}
location ^~ /v1/ {
proxy_pass http://cloud8/api/v1/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 36000;
}
location ^~ /dashboard/ {
proxy_pass http://report2/dashboard/;
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-Forwarded-Proto $scheme;
proxy_read_timeout 300;
}
location ^~ /data-source/ {
proxy_pass http://report2/data-source/;
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-Forwarded-Proto $scheme;
proxy_read_timeout 300;
}
location ^~ /common/ {
proxy_pass http://report2/common/;
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-Forwarded-Proto $scheme;
proxy_read_timeout 300;
}
location ^~ /statistic/ {
proxy_pass http://report2/statistic/;
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-Forwarded-Proto $scheme;
proxy_read_timeout 300;
}
location ~ /WW_verify_(.*)\.txt {
default_type text/plain;
set $rescode $1;
return 200 "$rescode";
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

云枢8.6.x版本使用6.2.x的报表版本。

直接执行初始化脚本:report-init-postgres.sql(已替代原先 report_postgre.sql + all_init.sql 两步操作)

附件下载:report-init-postgres.sql

先将附件脚本上传到服务器(例如 /data/report-init-postgres.sql),然后执行:

psql -h host -p 5432 -U db_user -d report -f /data/report-init-postgres.sql

先执行以下命令再做编辑

cd /data/reporter-deploy/bin/ && chmod 755 *

使用命令vim /data/reporter-deploy/bin/report.config修改配置文件 主要修改内容如下,其他配置请参考云枢开发者手册

# 注意:5.X及以上版本配置云枢地址即可
REPORTER_ADAPTOR_HOST="http://127.0.0.1:8080/api/"
# 日志目录
REPORTER_LOG_DIR=/data/reporter-deploy/applog

数据库配置:

REPORTER_DATASTORE_DB_DRIVERREPORTER_DATASTORE_DB_URLREPORTER_DATASTORE_DB_USERREPORTER_DATASTORE_DB_PASSWORDREPORTER_MYBATIS_PLUS_MAPPER_LOCATIONS五个属性

# pgsql
REPORTER_DATASTORE_DB_DRIVER="org.postgresql.Driver"
REPORTER_DATASTORE_DB_URL="jdbc:postgresql://host:5432/report"
# oracle
# REPORTER_DATASTORE_DB_DRIVER="oracle.jdbc.driver.OracleDriver"
# REPORTER_DATASTORE_DB_URL="jdbc:oracle:thin:@//host:41521/db_name"
REPORTER_DATASTORE_DB_USER="db_user"
REPORTER_DATASTORE_DB_PASSWORD="db_password"
# 仪表盘数据库的Mybatis-plus对应的mapper,默认的是mysql,如果是oracle,classpath:/oraclemapper/*.xml,
# 如果是sql server,classpath:/mssqlmapper/*.xml
# 如果是达梦,classpath:/dmmapper/*.xml
# 如果是PostgreSQL,classpath:/pgmapper/*.xml
# 如果是华为GaussDB,classpath:/gaussdbmapper/*.xml
# 如果是崖山数据库,classpath:/yashanmapper/*.xml
REPORTER_MYBATIS_PLUS_MAPPER_LOCATIONS=classpath:/mapper/*.xml

安装配置文件:此操作主要是为了执行脚本生成配置文件

/data/reporter-deploy/bin/setup.sh

© 2025-2026 LiuXing. All Rights Reserved.