disconf安裝部署


1.client

pom文件引入
<dependency>
    <groupId>com.baidu.disconf</groupId>
    <artifactId>disconf-client</artifactId>
    <version>2.6.36</version>
</dependency>

2.web

1.依賴軟件mysql、tomcat、nginx、zookeeper、redis
2.git下載disconf(https://github.com/knightliao/disconf.git)
3.創建兩個文件夾:source(配置文件)、war(war包)
4.將上述兩個文件夾路徑引入環境變量
ONLINE_CONFIG_PATH=/home/work/dsp/disconf-rd/online-resources
WAR_ROOT_PATH=/home/work/dsp/disconf-rd/war
export ONLINE_CONFIG_PATH
export WAR_ROOT_PATH
source /etc/profile
5.cd disconf/disconf-web
6.sh deploy/deploy.sh(一定在disconf-web下運行)
注:1.文件必須從git拉取,不要從window傳到linux

3.配置tomcat

tomcat/conf/server.xml中Host節點加入war包路徑:
<Context path="" docBase="/usr/local/disconf/war"></Context>

4.配置nginx

nginx.conf中http節點加入:
upstream disconf {
    server 127.0.0.1:8080;//如果tomcat中war包部署端口一致
}

server {

    listen   8888;//瀏覽器訪問端口
    server_name disconf.com;
    access_log /usr/local/nginx/logs/disconf/access.log;
    error_log /usr/local/nginx/var/logs/disconf/error.log;

    location / {
        root /usr/local/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;
    }
}

5.使用

啟動tomcat和nginx,訪問http://localhost:8888/


免責聲明!

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



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