disconf tomcat/springboot配置启动注意事项

standalone 启动示例
//-Ddisconf.conf=/tmp/disconf.properties

java -Ddisconf.env=rd \
-Ddisconf.enable.remote.conf=true \
-Ddisconf.conf_server_host=127.0.0.1:8000 \
-Dlogback.configurationFile=logback.xml \
-Dlog4j.configuration=file:log4j.properties \
-Djava.ext.dirs=lib \
-Xms1g -Xmx2g -cp ampq-logback-client-0.0.1-SNAPSHOT.jar \
com.github.knightliao.consumer.ConsumerMain >/dev/null 2>&1 &

tomcat 启动示例

linux环境在catalina.sh

“if [ $have_tty -eq 1 ]; then”之后增加
JAVA_OPTS=”-Ddisconf.conf=/hao24/config/disconf_open/disconf.properties”

window环境 startup.bat第一行
SET CATALINA_OPTS= “-Ddisconf.conf=/hao24/config/disconf_open/disconf.properties”

在tomcat的serlvet.xml中将
中的reloadable设置为false,因为这个是动态热更新,最后不要每次更新都重启项目

springboot的jar包项目外部配置文件启动示例:
java -Ddisconf.conf=C:\Users\Administrator\Desktop\disconf.properties -jar hao24-third.jar

猜你喜欢

转载自blog.csdn.net/qq_37519791/article/details/81389429
今日推荐