分布式配置管理平台 - Disconf web管理台安装【Windows】

配置简单,按步骤操作即可;以下配置方法,同样适用于linux~

1.环境配置

配置java、maven环境,并安装mysql,reids,zookeeeper,Nginx,Tomcat

2.下载disconf

github下载https://codeload.github.com/knightliao/disconf/zip/master

或csdn下载:http://download.csdn.net/download/syc001/10000954  版本(2.6.36)

解压:

unzip disconf-master.zip

目录结构如下:


3.初始化数据库

mysql创建数据库: 命名disconf 
导入sql语句(sql路径 :{ disconf_master }/disconf_web/sql/):
执行
mysql -uroot -p disconf < 0-init_table.sql
mysql -uroot -p disconf < 1-init_data.sql
mysql -uroot -p disconf < 201512/20151225.sql
mysql -uroot -p disconf < 20160701/20160701.sql

4. 修改配置

配置文件包括:
- jdbc-mysql.properties (数据库配置)
- redis-config.properties (Redis配置)
- zoo.properties (Zookeeper配置)
- application.properties (应用配置)
copy 配置文件:
cp {disconf_master}/disconf_web/profile/rd/* {disconf_master}/disconf_web/src/main/java/resoures/
注意,记得执行将application-demo.properties复制成application.properties:

5.打war包

cd  {disconf_master}/disconf_web/
mvn clean install
cp  {disconf_master}/disconf_web/target/disconf-web.war  {tomcat_home}/webapps/

6.准备静态资源文件

cd {tomcat_home}/webapps/
mkdir html
cp -R {disconf_master}/disconf_web/html/assets  {tomcat_home}/webapps/html/
cp -R {disconf_master}/disconf_web/html/dep  {tomcat_home}/webapps/html/
cp -R {disconf_master}/disconf_web/html/*.html  {tomcat_home}/webapps/html/

7.配置tomcat并启动

vi   {tomcat_home}/conf/server.xml
设置端口号为8080
加入context节点
<Context path=""docBase=" {tomcat_home}/webapps/disconff-web"></Context>  ###此处为添加disconf目录。
如下图:

 启动Tomcat.

8.配置nginx并启动

修改nginx配置
vi  {nginx_home}/conf/nginx.conf
	upstream disconf {
		server 127.0.0.1:8080;      #代理tomcat,动态请求转发至后端tomcat程序
	}
    server {
        listen       8089;
        #server_name  localhost;
		server_name  disconf.com;  #如果使用域名,可以设置为disconf.com(可以自定义),但它必须与 application.properties配置文件中的domain保持一致

		location / {
			root D:\\software\\tomcat\\tomcat8-8080\\webapps\\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;
		}
  	  
	    location = /favicon.ico {
			log_not_found off;
			access_log off;
		} 
启动:
start nginx 

9.启动测试

输入:http://localhost:8089/
登陆:
默认用户名/密码:admin/admin 
如下图:




  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值