在windows下安裝運行disconf


一.環境准備

  1.下載disconf源碼 (本文以2.6.36為例)

    https://github.com/knightliao/disconf 

  2.下載nginx1.10.2(windows版)

    http://nginx.org/download/nginx-1.10.2.zip

  3.安裝好tomcat

  4.安裝好redis

  5.安裝好zookeeper,可參見http://www.cnblogs.com/mrluo735/p/5345879.html

 

二.修改配置

  1.disconf配置修改

      1).jdbc-mysql.properties  修改數據庫連接

      2).redis-config.properties  修改redis連接

      3).zoo.properties      修改zookeeper連接

      4).將application-demo.properties 改名為 application.properties

  2.打包disconf-web

    生成的最終target應當如下

      

  3.構建war包

    新建war文件夾,然后分別將war包和相關文件夾從disconfig-web及生成的target下copy出來,最終結果如下,tmp文件夾可以忽略

    

  4.修改tomcat配置

    打開/conf/server.xml文件

    在Host節點里增加

<Context path="" docBase="D:\\javaspace\\apache-tomcat\\apache-tomcat-8.0.36\\webapps\\disconfig-rd\\war"></Context>

    重啟tomcat

  5.修改nginx配置

    打開/conf/nginx.conf文件

    將nginx默認端口改為8000(因為默認端口被iis占用)

    增加server節點如下    

    server {
		listen			8082;
		server_name		localhost;
		
		location / {
			root D:\javaspace\apache-tomcat\apache-tomcat-8.0.36\webapps\disconfig-rd\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://127.0.0.1:8080;
		}
	}

    重啟nginx

 

三.安裝disconf數據庫

  可以參考disconf-web/sql/readme.md

  注意順序執行 0-init_table.sql,1-init_data.sql,201512/20151225.sql,20160701/20160701.sql

 

 

其他參考網址:http://blog.csdn.net/starfd/article/details/51556379


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM