Closed 4FYamedeaR closed 1 year ago
配置文件信息
server:
port: 8844
max-http-header-size: 64KB
error:
include-message: always
spring:
profiles:
active: prod
application:
name: jetlinks-platform
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Shanghai
serialization:
WRITE_DATES_AS_TIMESTAMPS: true
default-property-inclusion: non_null
resources:
static-locations: file:./static,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/, classpath:/public/
redis:
host: (ip)
port: 6379
database: 0
# cluster:
# nodes:
# - ubuntu:6380
# - ubuntu:6381
# - ubuntu:6382
timeout: 20s
serializer: jdk # 设置fst时,redis key使用string序列化,value使用 fst序列化.
password: 863soft
r2dbc:
#url: r2dbc:postgresql://localhost:5432/jetlinks
# url: r2dbc:mysql://127.0.0.1:3306/jetlinks
url: r2dbc:mysql://(ip):8000/jet #公网8000映射3306
username: jet
password: azhAdBDXFbCTNwTb
pool:
max-size: 32
max-idle-time: 60s
max-life-time: 1m
acquire-retry: 3
# properties:F
# preparedStatementCacheQueries: 100
codec:
max-in-memory-size: 100MB
rabbitmq: # 开启了device.message.writer.rabbitmq.enabled=true时生效
host: localhost
port: 5672
username: admin
password: jetlinks
kafka: # 开启了device.message.writer.kafka.enabled=true时生效
consumer:
client-id: ${spring.application.name}-consumer:${server.port}
group-id: ${spring.application.name}
max-poll-records: 1000
producer:
client-id: ${spring.application.name}-producer:${server.port}
acks: 1
retries: 3
bootstrap-servers: ["127.0.0.1:9092"]
reactor:
debug-agent:
enabled: true # 开启调试代理,在打印异常时将会生成调用踪栈信息
data:
elasticsearch:
client:
reactive:
endpoints: (ip):9200
max-in-memory-size: 100MB
socket-timeout: 10s
connection-timeout: 15s
username: elastic
password: 863softes
easyorm:
default-schema: jet # hao 数据库默认的schema
dialect: mysql #数据库方言
elasticsearch:
index:
default-strategy: time-by-month #默认es的索引按月进行分表
settings:
number-of-shards: 1 # es 分片数量,通常对应es集群节点数量
number-of-replicas: 0 # 副本数量
# options:
# lifecycle.name: lifecycle_name # 在kibana中配置的生命周期
influxdb:
enabled: true #开启inflxdb
endpoint: "http://localhost:8086/"
database: jetlinks
max-in-memory-size: 100MB
socket-timeout: 5S
connection-timeout: 10S
tdengine:
enabled: true #开启tdengine
database: jetlinks
connector: restful # 支持restful和jdbc
jdbc:
url: jdbc:TAOS://127.0.0.1:6030/jetlinks
username: root
password: taosdata
maximum-pool-size: 32
restful:
endpoint: "http://localhost:6041/"
username: root
password: taosdata
max-in-memory-size: 100MB
socket-timeout: 5S
connection-timeout: 10S
clickhouse:
enabled: false
restful:
url: http://127.0.0.1:8123
username: default
password: jetlinks
max-batch-size: 10000 # 最大批量提交数量
batch-duration: 2s # 批量提交间隔
device:
message:
writer:
time-series:
enabled: true # 直接写出设备消息数据到时序数据库
kafka:
enabled: false # 推送设备消息到kafka
consumer: true # 从kafka订阅消息并写入到时序数据库
topic-name: device.message
# type:
# excludes:
# includes:
rabbitmq:
enabled: false # 推送设备消息到rabbitMQ
consumer: true # 从rabbitMQ订阅消息并写入到时序数据库
thread-size: 4 # 消费线程数
auto-ack: true # 自定应答,为true可能导致数据丢失,但是性能最高。
topic-name: device.message # exchange名称
# type:
# excludes:
# includes:
geo:
enable-property: true
captcha:
enabled: false # 开启验证码
ttl: 2m #验证码过期时间,2分钟
hsweb:
cors:
enable: true
configs:
- path: /**
allowed-headers: "*"
allowed-methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
allowed-origins: ["*"]
allow-credentials: true
max-age: 1800
dict:
enum-packages: org.jetlinks
file:
upload:
static-file-path: ./static/uploadFile
static-location: http://(ip):8844/uploadFile
deny-files: php,asp,jsp,exe,dll,so,cmd,bat,sh,shell,js,html
webflux:
response-wrapper:
enabled: true #开启响应包装器(将返回值包装为ResponseMessage)
excludes: # 这下包下的接口不包装
- org.springdoc
authorize:
auto-parse: true
# user-token:
# allopatric-login-mode: offlineOther ## 设置异地登录模式为 将其他地方登录的相同用户踢下线
# allopatric-login-modes:
# app: offlineOther
permission:
filter:
enabled: true # 设置为true开启权限过滤,赋权时,不能赋予比自己多的权限.
exclude-username: admin # admin用户不受上述限制
un-auth-strategy: ignore # error表示:发生越权时,抛出403错误. ignore表示会忽略越权的赋权.
cache:
type: redis
redis:
local-cache-type: caffeine
caffeine:
maximum-size: 10240
jetlinks:
server-id: ${spring.application.name}:${server.port} #设备服务网关服务ID,不同服务请设置不同的ID
logging:
system:
context:
server: ${jetlinks.server-id}
protocol:
spi:
enabled: false # 为true时开启自动加载通过依赖引入的协议包
device:
registry:
auto-discover: enabled #当无法从注册中心获取设备时,尝试从数据库中获取,并自动注册到注册中心.
storage:
default-policy: default-row # 默认设备数据存储策略
enable-last-data-in-db: false # 是否将设备最新到数据存储到数据库
# log:
# excludes: # 这些日志不存储
# - REPORT_PROPERTY
assets:
# enabled-dimensions: org
# auto-binding: true
# dimension-exclude-asset-types: organization #机构是租户的资产,但是是维度,所以不进行维度绑定
tenant-member:
enabled: true
ignore-assets: # 忽略数据权限控制的资产
- visualizationCatalog
- deviceCategory
# allow-all-assets: # 租户成员可以看全部租户下数据的资产
# - deviceCategory
event-bus:
rsocket:
enabled: false # eventbus开启rsocket支持
address:
port: 2${server.port} # 绑定端口
public-address: 127.0.0.1 # 集群间能访问到的ip地址
public-port: ${jetlinks.event-bus.rsocket.address.port} # 集群间能访问到的端口
rule:
engine:
server-id: ${jetlinks.server-id}
server-name: ${spring.application.name}
logging:
level:
org.jetlinks: debug
rule.engine: debug
org.hswebframework: info
org.springframework.transaction: debug
org.springframework.data.r2dbc.connectionfactory: warn
io.micrometer: warn
org.hswebframework.expands: error
system: debug
org.jetlinks.rule.engine: warn
org.jetlinks.supports.event: warn
org.springframework: warn
org.apache.kafka: warn
org.jetlinks.pro.device.message.writer: warn
org.jetlinks.pro.elastic.search.service: warn
org.jetlinks.pro.elastic.search.service.reactive: warn
org.jetlinks.pro.network: warn
org.jetlinks.demo: warn
io.vertx.mqtt.impl: warn
# org.jetlinks.supports.cluster: trace
# org.springframework.data.elasticsearch.client: trace
# org.elasticsearch: error
org.jetlinks.pro.influx: trace
org.elasticsearch.deprecation.search.aggregations.bucket.histogram: error
config: classpath:logback-spring.xml
file:
max-history: 1
max-size: 256MB
name: "./logs/${spring.application.name}.log"
vertx:
max-event-loop-execute-time-unit: seconds
max-event-loop-execute-time: 30
max-worker-execute-time-unit: seconds
max-worker-execute-time: 30
prefer-native-transport: true
micrometer:
time-series:
tags:
server: ${spring.application.name}
metrics:
default:
step: 30s
springdoc:
swagger-ui:
path: /swagger-ui.html
# packages-to-scan: org.jetlinks
group-configs:
- group: 设备管理相关接口
packages-to-scan:
- org.jetlinks.pro.device
- org.jetlinks.pro.geo.web
- org.jetlinks.pro.media.web
paths-to-exclude:
- /device-instance/**
- /device-product/**
- /protocol/**
- /api/v1/geo/object/**
- group: 规则引擎相关接口
packages-to-scan: org.jetlinks.pro.rule.engine.web
paths-to-exclude: /api/**
- group: 通知管理相关接口
packages-to-scan: org.jetlinks.pro.notify.manager.web
- group: 设备接入相关接口
packages-to-scan:
- org.jetlinks.pro.network.manager.web
- org.jetlinks.pro.device.web
paths-to-match:
- /gateway/**
- /network/**
- /protocol/**
- group: 系统管理相关接口
packages-to-scan:
- org.jetlinks.pro.auth
- org.hswebframework.web.system.authorization.defaults.webflux
- org.hswebframework.web.file
- org.hswebframework.web.authorization.basic.web
- org.jetlinks.pro.openapi.manager.web
- org.jetlinks.pro.logging.controller
- org.jetlinks.pro.tenant.web
cache:
disabled: false
messaging:
mqtt:
enabled: true
port: 11883
host: 0.0.0.0
使用内网ip连接数据库试试
可能和自动创建表结构有关,把表结构导到数据库里好像就可以了
不知道是不是MySQL或者es的问题还是其他的问题。 报错信息