S
sub_sync_data
分平台数据同步(总分模式)
项目介绍
基于quzrtz的动态任务管理,定时同步总平台数据到分平台,并提供任务的监控管理。
软件架构
spring boot、quartz
部署及启动
- 下载sub_sync_data-1.0.0.jar包
- 启动命令
nohup java -jar scyd_sync_data-1.0.0.jar --spring.config.location=application.yml > sub_sync_data.log &
,其中--spring.config.location=application.yml
指定配置文件路径 - 环境要求jdk1.8、mysql(动态任务管理)、es(原数据同步)、redis(数据缓存)
配置文件说明
application.yml
spring:
redis: # redis配置
cluster:
nodes:
- 10.3.1.54:6379
- 10.3.1.56:6379
- 10.3.1.57:6379
timeout: 3600 # 连接超时时间(毫秒)
jedis:
pool:
max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
password: # 密码,默认为空
data:
elasticsearch: # es配置,5.x
cluster-name: subes6
cluster-nodes: 10.3.1.102:9300
repositories:
enabled: true
datasource:
driverClassName: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://test-db-01:3306/guttv_job?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
username: root
password: Guttv@1234ABCxyz!
freemarker:
request-context-attribute: request
cache: false
charset: UTF-8
check-template-location: true
content-type: text/html
template-loader-path: classpath:templates
suffix: .html
expose-request-attributes: true
expose-session-attributes: true
quartz:
job-store-type: jdbc
properties:
org.quartz.scheduler.instanceName: clusteredScheduler
org.quartz.scheduler.instanceId: AUTO
org.quartz.jobStore.class: org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix: QRTZ_
org.quartz.jobStore.useProperties: false
org.quartz.threadPool.threadCount: 20
org.quartz.jobStore.isClustered: true
org.quartz.jobStore.clusterCheckinInterval: 20000
security:
user:
name: user
password: pass
mybatis:
mapper-locations: classpath:/mapper/*.xml
type-aliases-package: com.guttv.scyd.bean
logging:
level:
org.springframework: warn
com.guttv: debug
jobDetailSaveHistory: 5
chiefPlatform:
oms_api: http://dev-02.guttv.lab:7890/oms_api
vod_api: http://dev-02.guttv.lab:7891/vod_api
sc: 1100121022988022335581750 #分平台业务组合code,多个code ,分隔
sg: 1100122022055962258270018 #分平台业务分组(点播)code,多个code ,分隔
ag: xxx #渠道商code
access_token: fb188b5d2c4ebfbc672764729ebdadfd703f0c783ef46880e4b9b8223d685b27
pt_name: 四川移动 #平台名称,用于监控报警
接口说明
接口地址 | 请求方式 | 请求参数 | 返回内容 | 备注 |
---|---|---|---|---|
/api/centrifugoToken | GET | secret<必填,字符串,密钥> timestamp<必填,字符串,毫秒时间戳> userCode<必填,字符串,用户code(clientId)> |
获取消息服务器token | |
/api/getAuthInfo | GET | domainCode<必填,字符串,分发域code> clientID<必填,字符串,客户端id> contentID<必填,字符串,内容id> playUrl<必填,字符串,播放地址> key<必填,字符串,密钥> |
播放鉴权 |