# 数据指标独立安装说明
当前文档仅针对EOS Platform8.3.1微服务环境下的指标模块独立安装,暂时不会提供standalone版本的介质和安装说明。
# 第一步、介质准备
1.数据指标后端介质(必须):Primeton_Metrics_Server.tar.gz
2.数据指标前端介质(必须):Primeton_Metrics_UI.tar.gz
3.EOS Platform 8.3.1微服务介质(必须):通过售后地址下载,微服务平台基座。
4.IData 1.15版本介质及相关license(必须):通过售后地址下载,用于指标配置时快速看板生成。
5.数据集成平台Primeton DWS 7.0LA3(可选):数据指标通过和DWS集成,实现基于指标配置的自动测算任务生成,并提供相应作业的管理和监控功能。
# 第二步、环境准备
# 第三步、数据库初始化
# 1.创建数据库用户/Schema
创建 metrics 数据库。以Mysql为例,执行如下脚本:
CREATE DATABASE `metrics` DEFAULT CHARACTER SET utf8mb4;
# 2.执行初始化脚本
微应用安介质安装时需要按顺序执行对应数据库的数据库初始化脚本。初始化脚本路径为 Primeton_Mertics_Server/db-scripts/,根据不同数据库类型做了不同的目录。目前已经适配的数据库包括Mysql5.7。
目前数据库脚本一共分成了4部分,分别是bfp、eos、lowcode和metrics。 其中bfp、eos、lowcode作为基础组建依赖,都需要在metrics库中做初始化,默认执行all.sql即可。 metrics中包含了afcenter的数据初始化内容,需要分别在damp、afcenter两个库中执行对应脚本。
以Mysql为例,按顺序执行如下脚本:
1)在metrics数据库下执行:
1.bfp
db-scripts/bfp/Mysql/all.sql
2.eos
db-scripts/eos/Mysql/all.sql
3.lowcode
db-scripts/lowcode/Mysql/all.sql
4.metrics
db-scripts/metrics/Mysql/00-table.sql
db-scripts/metrics/Mysql/01-data.sql
2)在afcenter数据库下执行:
1.db-scripts/metrics/Mysql/02-data-afc.sql #需要先完成afcenter基础环境数据库的初始化
# 第四步、后端部署
# 1.解压介质
在/opt/primeton/server目录下创建 metrics 文件夹,将 Primeton_Mertics_Server.tar.gz 复制到 metrics 目录下并解压。
# 2.配置文件修改
微应用安介质安装时的配置文件,有需要修改的地方会在后面用“###”提示说明。
1.config/application.properties #公共配置
2.config/application-afc.properties #afcenter集成配置
3.config/application-dws.properties #dws集成配置
4.config/application-nacos.properties #nacos注册中心配置
5.config/bootstrap.properties #nacos配置中心配置
6.config/application-job.properties #用于afc-xxl集成,无需修改
7.config/METRIC/config/user-config.xml #数据源配置
1)公共配置:config/application.properties
server.port=28078 ###可根据实际情况修改,注意端口冲突
spring.application.name=DAMP ###原则上不允许修改
server.servlet.session.timeout=PT120M
spring.session.store-type=none
server.app-server.accept-count=1000
server.app-server.max-connections=10000
server.app-server.max-threads=500
server.app-server.min-space-threads=50
#file upload
spring.servlet.multipart.max-file-size=100MB ###文件上传大小限制,与nginx配套修改
spring.servlet.multipart.max-request-size=100MB ###同上
#spring.profiles.active=eureka
spring.profiles.active=nacos,afc,damp,dm,job
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
management.endpoints.web.exposure.include=hystrix.stream,health,info,loggers,eos,mappings
out.config.folder=config
eos.application.sys-code=EOS-DEMO-SYS ###EOS默认配置,可以不修改。如果在Governor中配置需要根据配置情况修改
eos.application.sys-key=dc6baaed30e541d78bb91274803d9432 ###同上
# eos environment: dev prod test
eos.profiles.active=dev
# eos-cache
eos.cache.mode=redis
spring.redis.host=127.0.0.1 ###修改redis对应ip,本机则不需要修改
spring.redis.port=6379 ###修改redis对应端口,默认端口不需要修改
spring.redis.password= ###如果redis开启认证则需要配置密码
spring.redis.lettuce.pool.max-active=100
spring.redis.lettuce.pool.max-idle=100
spring.redis.lettuce.pool.max-wait=5000
2)afcenter组件配置:config/application-afc.properties
afc.application.name=AFCENTER ###根据实际情况修改
afc.application.tenant=sys_tenant
bps.application.name=BPS-SERVER ###根据实际情况修改
bps.tenant.id=
# attachment
# mode: local,db,nexus,aliyun-oss,minio ###7.3.1 新增minio
afc.attachments.persistence-mode=local ###根据实际情况修改
afc.attachments.local.dir=
afc.attachments.nexus.repository-url=
afc.attachments.nexus.username=
afc.attachments.nexus.password=
afc.attachments.aliyun-oss.endpoint=
afc.attachments.aliyun-oss.access-key-id=
afc.attachments.aliyun-oss.access-key-secret=
afc.attachments.aliyun-oss.bucket-name=
afc.attachments.libre-office.host=
afc.attachments.libre-office.port=
# 公共资源管理模块配置
# if use nacos/eureka
public-resource.application.name=PUBLIC-RESOURCE ###根据实际情况修改
# else
public-resource.application.name=AFCENTER
3)dws集成配置:config/application-dws.properties
dws.application.name=DWS ###DWS应用名/应用访问地址,根据实际情况修改
dws.application.tenant=sys_tenant ###根据实际情况修改
4)注册中心配置:config/application-nacos.properties
spring.cloud.nacos.discovery.enabled=true
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 ###根据实际情况修改
#spring.cloud.nacos.discovery.username=nacos
#spring.cloud.nacos.discovery.password=nacos
eureka.client.enabled=false
5)配置中心配置:config/bootstrap.properties
spring.cloud.nacos.config.enabled=true
spring.cloud.nacos.config.server-addr=127.0.0.1:8848 ###根据实际情况修改
#spring.cloud.nacos.config.username=nacos
#spring.cloud.nacos.config.password=nacos
6)数据源配置:config/METRIC/config/user-config.xml
...
<group name="default"> ### 根据实际情况修改
<configValue key="Database-Type">MySql</configValue>
<configValue key="Jdbc-Type"/>
<configValue key="C3p0-DriverClass">com.mysql.jdbc.Driver</configValue>
<configValue key="C3p0-Url">jdbc:mysql://127.0.0.1:3306/metrics?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false</configValue>
<configValue key="C3p0-UserName">username</configValue>
<configValue key="C3p0-Password">password</configValue>### 明文密码,启动后会自动加密
<configValue key="C3p0-PoolSize">10</configValue>
<configValue key="C3p0-MaxPoolSize">50</configValue>
<configValue key="C3p0-MinPoolSize">10</configValue>
<configValue key="C3p0-MaxIdleTime">600</configValue>
<configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
<configValue key="C3p0-MaxStatements">0</configValue>
<configValue key="C3p0-NumHelperThreads">1</configValue>
<configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
<configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
<configValue key="Retry-Connect-Count">1</configValue>
</group>
...
# 第五步、前端部署
# 1.解压介质
- 解压 Primeton_Metrics_UI.tar.gz,获得metrics文件夹。
- 将metrcis文件夹复制到前端afcenter目录下 /opt/primeton/web/afcenter即可。
# 2. 配置文件修改
- 在 nginx 安装目录下的 conf/nginx.conf 配置文件中增加数据资产前端配置,在配置文件中添加 include /home/primeton/web/conf/*.conf; ##-根据实际情况修改文件路径。
user root; ###根据实际用户配置,建议使用root启动
worker_processes 1; ###根据实际情况配置,除非测试环境否则不建议1
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 100M;
client_body_buffer_size 10M;
fastcgi_intercept_errors on;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include /home/primeton/web/conf/*.conf; ##-根据实际情况修改文件路径
}
- 检查 nginx 配置文件,配置在 /opt/primeton/web/conf/eos8.conf。默认不需要做特殊配置。
upstream eosgateway {
server 127.0.0.1:9090; #gateway默认端口
}
#EOS afcenter by gateway
server {
listen 80;
#client_body_buffer_size 10m; #缓存区大小
client_max_body_size 100m;
location ~ /(.*)/api/ {
proxy_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_pass http://eosgateway;
}
location ~ \.biz\.ext$ {
proxy_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_pass http://eosgateway;
}
location / {
root "/opt/primeton/web/afcenter";
access_log /opt/primeton/web/logs/access.log ;
error_log /opt/primeton/web/logs/error.log warn;
index index.html index.htm;
try_files $uri /index.html;
}
}
# 第六步、启动服务
# 后端启动
Linux 系统
[root@localhost server]# ./metrics/bin/startup.sh
Windows 系统
D:\Desktop\server> ./metrics/bin/startup.cmd
# 前端启动
Linux 系统
[root@localhost nginx]# ./sbin/nginx
Windows 系统
D:\Desktop\server> nginx.exe
# 第六步、低开组件安装
目前数据指标相关流程采用EOS低开平台部署,需要从介质中获取低开介质包,具体路径为Primeton_Metrics_Server/metrics/lowcode_project_contribution.zip。
1.使用admin账号登陆afcenter,找到【开发平台】菜单。
2.在开发平台中找到“指标”应用,点击进入开发ide。
3.在ide左上角点击+号图标,选择导入构建包,将介质中的构建包导入系统。
4.导入成功后左侧资源树中会出现【metrics_portal】目录,在目录中可以查看到低开相关实体、流程、服务等资源。
5.确认导入成功后流程会自动部署,此时关闭ide即可,无需重启。
# 第七步、权限配置
给相应人员配置角色【指标管理员】,即可拥有全部指标模块权限。