天天看點

disconf-web 分布式配置管理平台

disconf-web 分布式配置管理平台

1、安裝mysql

2、tomcat

3、安裝nginx

4、安裝zookeeper

5、安裝redis

6、下載下傳disconf安裝包

(1)下載下傳disconf包

git clone https://github.com/knightliao/disconf.git

(2)配置disconf配置檔案

2、1 建立兩個檔案夾online-resources和war

mkdir /usr/local/disconf/war #設定War包将要被部署的位址

mkdir /usr/local/disconf/online-resources #配置檔案放到此位址目錄下

2、2 配置檔案複制

/usr/local/disconf/online-resourcesonline-resources:放的是四個配置檔案(四個所在檔案位置 下載下傳原始目錄/opt/tools/disconf/disconf-web/profile/rd的目錄下)

application-demo.properties(郵件配置163)

jdbc-mysql.properties(mysql資料庫連接配接的配置)

redis-config.properties(redis連接配接的配置)

zoo.properties(zookeeper的配置)

注意,即使隻有一個redis,也應該配置兩個redis client,否則将造成内部錯誤。*

2、3

application-demo.properties改成application.properties

2、4

cd /opt/disconf

[root@minion disconf]# ONLINE_CONFIG_PATH=/usr/local/disconf/online-resources

[root@minion disconf]# WAR_ROOT_PATH=/usr/local/disconf/war

[root@minion disconf]# export ONLINE_CONFIG_PATH

[root@minion disconf]# export WAR_ROOT_PATH

[root@minion disconf]# cd disconf-web

[root@minion disconf-web]# sh deploy/deploy.sh

腳本運作結束後會在/usr/local/disconf/war/路徑下生成web部署所用到的程式檔案

-disconf-web.war

-html

-META-INF

-WEB-INF

(3)資料庫導入

/opt/disconf/disconf-web/sql

注意sql檔案導入順序

0-init_table.sql---->1-init_data.sql---->201512/20151225.sql---->20160701/20160701.sql

(2)配置tomcat

vim /usr/local/apache-tomcat-9.0.5/conf/server.xml

<Host name="localhost" appBase="webapps"

unpackWARs="true" autoDeploy="true">

<Context path="/" docBase="/usr/local/disconf/war"></Context>

(2)配置nginx服務

upstream disconf {

server 127.0.0.1:8080;

}

server {

listen 8000;

server_name localhost;

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;
}           

繼續閱讀