1. 程式人生 > >windows系統下Disconf web安裝-分布式配置管理平臺

windows系統下Disconf web安裝-分布式配置管理平臺

div idea found csdn 參考 fig 插入 設置redis oba

文章參考自

http://blog.csdn.net/syc001/article/details/78128117

https://www.cnblogs.com/mrluo735/p/6322719.html

http://disconf.readthedocs.io/zh_CN/latest/tutorial-client/src/Tutorial9.html (官方文檔)

一.環境準備   

1.下載disconf源碼https://github.com/knightliao/disconf   

2.下載nginx1.10.2(windows版) http://nginx.org/download/nginx-1.10.2.zip  

3.安裝tomcat https://tomcat.apache.org/download-70.cgi   

4.安裝redis https://www.cnblogs.com/M-LittleBird/p/5902850.html(windows安裝指導) https://github.com/MicrosoftArchive/redis/tags(安裝包)   

5.安裝好zookeeper http://blog.csdn.net/tlk20071/article/details/52028945(windows安裝指導)

二、組件配置

1、tomcat配置

idea的tomcat配置

技術分享圖片

技術分享圖片

技術分享圖片

2、nginx配置(nginx-1.12.2\conf\nginx.conf)看好插入的層級管理,不要插入錯了

upstream disconf {  
    server 127.0.0.1:9999;      #代理tomcat,動態請求轉發至後端tomcat程序,這裏和tomcat的端口號配置相同  
   }  
   server {  
       listen       8089;  #這裏是nginx的監聽端口
        server_name  localhost; 
  
    location / {  
        root E:\project\disconf\disconf\disconf-web\html;   #這裏指向項目中disconf-web子模塊中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:9999;      #tomcat端口
    }  
        
    location = /favicon.ico {  
        log_not_found off;  
        access_log off;  
    }  
}

3、Redis配置(redis-3.2.100\redis.windows.conf)

設置密碼

# requirepass foobared 在配置文件中找到這項,然後解開註釋即可,這個會在後面配置文件中配置
#設置Redis密碼

requirepass foobared

這裏啟動可以參考上面文章,很有幫助

4、zookeeper配置

技術分享圖片

5、數據庫配置

創建一個數據庫,我這裏創建的是disconf數據庫,然後按順序執行下面的腳本

技術分享圖片

6、disconf配置

將disconf-web添加到父模塊中

技術分享圖片

技術分享圖片

項目配置文件配置----將rd中的配置文件修改----然後復制到src/resourse中

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

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

3).zoo.properties      修改zookeeper連接

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

技術分享圖片

三、項目啟動

1、先啟動中間件(nginx、zookeeper、Redis)

2、然後用idea啟動項目

技術分享圖片

3、輸入網址http://localhost:8089/main.html

可以看到以下,表示啟動成功,然後登陸吧(賬號admin-密碼admin)

技術分享圖片

技術分享圖片

windows系統下Disconf web安裝-分布式配置管理平臺