Distributed configuration management platform -
Disconf web management terminal installation ] 1. Environment configuration Configure java, maven environment, and install mysql, reids, zookeeper, Nginx 2. Download disconf Download https://codeload.github.com/knightliao/disconf/zip/master Unzip: unzip disconf-master.zip 3. Compile and package Create a directory [plain] view plain copy print? mkdir /home/disconf/online-resources mkdir /home/disconf/war cd disconf-master mvn clean install ONLINE_CONFIG_PATH=/home/disconf/online-resources WAR_ROOT_PATH=/ home/disconf/war export ONLINE_CONFIG_PATH
export WAR_ROOT_PATH
cd disconf-web
sh deploy/deploy.sh
Finished generating a file in the /home/disconf/war directory
[plain] view plain copy
print?
-disconf-web.war
-html
-jpaas_control
-META-INF
-Release
-tmp
-WEB-INF
4. Modify the configuration
1) Put the configuration file in this address directory: /home/disconf/online-resources The
configuration file includes:
- jdbc-mysql.properties (database configuration)
- redis-config.properties (Redis configuration)
- zoo.properties (Zookeeper configuration)
- application.properties (application configuration)
Note, remember to copy application-demo.properties to application.properties:
cp application-demo.properties application.properties
2) Modify the disconf configuration
cd /home/disconf/war/WEB-INF/classes/
application.properties
jdbc-mysql.properties
redis-config.properties
zoo.properties
Modify the address port in the file and adjust the log directory
#log4j.properties
$ {catalina.home}/logs/disconf-log4j.log
#logback.xml
<property name="log.base" value="${catalina.home}/logs/disconf-web"/>
<property name="log .monitor" value="${catalina.home}/logs/monitor"/>
5. Initialize the database and
follow the instructions in disconf-master/disconf-web/sql/readme.txt to import data in sequence
6. Configure tomcat
Install tomcat configuration server .xml configure war directory
<Context path="" docBase="/home/disconf/disconf/war"></Context>
7. Configure nginx
Install nginx, and configure, installation reference: http://blog.csdn.net/zhu_tianwei/article/details/17752581
Configuration: vi /home/disconf/nginx/conf/nginx.conf
[plain] view plain copy
print?
upstream disconf {
server 127.0.0.1:8080;
}
server {
listen 8000;
server_name localhost;
access_log logs/disconf_access.log;
error_log logs/disconf_error.log;
location / {
root /home/disconf/disconf/war/html;
if ($ query_string) {
expires max;
}
}
location ~ ^/(api|export) {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://disconf;
}
}
can be accessed through http://192.168.1.90:8000/ Default user: admin/admin
About the use of reference official documents:
general overview
TutorialSummary function general overview
Article introduction: distributed configuration management platform Disconf
Annotation-based distributed configuration (supports configuration files and configuration items) It is
recommended to use disconf for new projects
Tutorial 1 Annotated Distributed Configuration File
Tutorial 2 Annotated Distributed Configuration File Advanced: Notification of Configuration Update
Tutorial 3 Annotated Distributed Configuration Item
Tutorial 4 Annotated Distributed Static Configuration File and Static Configuration Item
Note: Move the configuration file to a dedicated class instead of being scattered in various places in the project, and the entire code structure is clear and easy to understand and manage. Even if you don't use disconf one day, you only need to remove the annotation.
XML-based distributed configuration (no code intrusion) (only supports configuration files) It is recommended to use Tutorial 8 XML-based distributed configuration file management, automatic reload
when using disconf for old projects . Tutorial 5 XML-based distributed configuration file management, no Automatic reload, especially useful for those heavy resources such as jdbc, etc. Other Tutorial 6 disconf-web function details Tutorial 7 Customizable partially managed distributed configuration Tutorial disconf and dubbo integration demo Tutorial 9 Realize unity in the true sense On-line packageTutorial 10Implement a configuration updateDownloaderAgentConfiguration InstructionsExceptionsConsiderationLimitations and PrecautionsConsiderationsZookeeper Abnormal Considerations
disconf configuration
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326234226&siteId=291194637
Recommended
Ranking