disconf使用
1.创建app,确定version
2.创建配置文件redis.config
3.选择app下env环境,上传redis.config到disconf
4.创建disconf.properties到classpath,内容如下:
# 是否使用远程配置文件 # true(默认)会从远程获取配置 false则直接获取本地配置 enable.remote.conf=true # # 配置服务器的 HOST,用逗号分隔 127.0.0.1:8000,127.0.0.1:8000 # conf_server_host=10.30.5.9:80 # 版本, 请采用 X_X_X_X 格式 version=1.0 # APP 请采用 产品线_服务名 格式 app=shop-activity # 环境 env=rd # debug debug=true # 忽略哪些分布式配置,用逗号分隔 ignore= # 获取远程配置 重试次数,默认是3次 conf_server_url_retry_times=1 # 获取远程配置 重试时休眠时间,默认是5秒 conf_server_url_retry_sleep_seconds=1
5.运行程序,查看disconf管理界面app下的实例列表
version