百度DisConf-分布式配置管理平台-安装

1.百度DisConf-分布式配置管理平台-安装

如果想了解DisConf,可阅读 百度DisConf-分布式配置管理平台-简介,

1.1 安装依赖软件

  • 安装Mysql(Ver 14.12 Distrib 5.0.45, for unknown-linux-gnu (x86_64) using EditLine wrapper)
  • 安装Tomcat(apache-tomcat-7.0.50)
  • 安装Nginx(nginx/1.5.3)
  • 安装 zookeeeper (zookeeper-3.3.0)
  • 安装 Redis (2.4.5)

1.2 下载disConf

disconf下载地址

下载后的目录如下:
百度DisConf-分布式配置管理平台-安装_第1张图片
把disconf-web打成war包:
然后进入到:\disconf-master\disconf-web
执行
mvn clean install
百度DisConf-分布式配置管理平台-安装_第2张图片
直接下载地址:https://download.csdn.net/download/fd2025/10464458

1.3 初始化sql

/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50623
Source Host           : localhost:3306
Source Database       : disconf

Target Server Type    : MYSQL
Target Server Version : 50623
File Encoding         : 65001

Date: 2018-06-07 12:02:44
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `app`
-- ----------------------------
DROP TABLE IF EXISTS `app`;
CREATE TABLE `app` (
  `app_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '唯一的ID(没有啥意义,主键,自增长而已)',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'APP名(一般是产品线+服务名)',
  `description` varchar(255) NOT NULL DEFAULT '' COMMENT '介绍',
  `create_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '生成时间',
  `update_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '修改时',
  `emails` varchar(255) NOT NULL DEFAULT '' COMMENT '邮箱列表逗号分隔',
  PRIMARY KEY (`app_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='app';

-- ----------------------------
-- Records of app
-- ----------------------------
INSERT INTO `app` VALUES ('1', 'disconf_demo', 'disconf_demo', '20140415155127', '20140415155127', '[email protected]');
INSERT INTO `app` VALUES ('2', 'disconf_demo', 'disconf demo', '99991231235959', '99991231235959', '');
INSERT INTO `app` VALUES ('3', 'ssm框架整合', 'ssm框架整合', '20180607104233', '20180607104233', '');
INSERT INTO `app` VALUES ('4', 'ssm-web', 'ssm-web', '20180607111001', '20180607111001', '');

-- ----------------------------
-- Table structure for `config`
-- ----------------------------
DROP TABLE IF EXISTS `config`;
CREATE TABLE `config` (
  `config_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '唯一的ID(没有啥意义,主键,自增长而已)',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '配置文件/配置项',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:1是正常 0是删除',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '配置文件名/配置项KeY名',
  `value` text NOT NULL COMMENT '0 配置文件:文件的内容,1 配置项:配置值',
  `app_id` bigint(20) NOT NULL COMMENT 'appid',
  `version` varchar(255) NOT NULL DEFAULT 'DEFAULT_VERSION' COMMENT '版本',
  `env_id` bigint(20) NOT NULL COMMENT 'envid',
  `create_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '生成时间',
  `update_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '修改时间',
  PRIMARY KEY (`config_id`)
) ENGINE=InnoDB AUTO_INCREMENT=156 DEFAULT CHARSET=utf8 COMMENT='配置';

-- ----------------------------
-- Records of config
-- ----------------------------
INSERT INTO `config` VALUES ('1', '0', '1', 'confA.properties', 'varA=200000\\r\\nvarA2=300000', '1', '1_0_0_0', '1', '20140415155127', '20140415155127');
INSERT INTO `config` VALUES ('2', '1', '1', 'keyA', '8888', '1', '1_0_0_0', '1', '99991231235959', '99991231235959');
INSERT INTO `config` VALUES ('4', '0', '1', 'coefficients.properties', 'coe.baiFaCoe=1.3\ncoe.yuErBaoCoe=1.3\n', '2', '1_0_0_0', '1', '99991231235959', '20141205154137');
INSERT INTO `config` VALUES ('5', '1', '1', 'moneyInvest', '10000', '2', '1_0_0_0', '1', '99991231235959', '20140902183514');
INSERT INTO `config` VALUES ('6', '0', '1', 'remote.properties', 'remoteHost=127.0.0.1\r\nremotePort=8081', '2', '1_0_0_0', '1', '20140729174707', '20140804233309');
INSERT INTO `config` VALUES ('7', '1', '1', 'discountRate', '0.5', '2', '1_0_0_0', '1', '20140801142833', '20140905130141');
INSERT INTO `config` VALUES ('12', '0', '1', 'redis.properties', 'redis.host=127.0.0.1\nredis.port=6379', '2', '1_0_0_0', '1', '20140811172327', '20141011154244');
INSERT INTO `config` VALUES ('16', '0', '1', 'static.properties', 'staticVar=147', '2', '1_0_0_0', '1', '20140814202654', '20140905145616');
INSERT INTO `config` VALUES ('17', '1', '1', 'staticItem', '30', '2', '1_0_0_0', '1', '20140814210709', '20140814211054');
INSERT INTO `config` VALUES ('29', '0', '1', 'empty.properties', 'redis.host=127.0.0.1\r\nredis.port=8310', '2', '1_0_0_0', '1', '20140909164001', '20140909164125');
INSERT INTO `config` VALUES ('48', '0', '1', 'myserver.properties', 'server=127.0.0.1:16600,127.0.0.1:16602,127.0.0.1:16603\nretry=5\n', '2', '1_0_0_0', '1', '20140911223117', '20141117153116');
INSERT INTO `config` VALUES ('119', '0', '1', 'myserver_slave.properties', '#online\r\nserver=127.0.0.1:16700,127.0.0.1:16700,127.0.0.1:16700,127.0.0.1:16700\r\nretry=3', '2', '1_0_0_0', '1', '20141103163302', '20141103163302');
INSERT INTO `config` VALUES ('122', '0', '1', 'testXml.xml', '\n\n    \n        \n            /tradeMap\n            /tradeMap\n        \n    \n', '2', '1_0_0_0', '1', '20141103202829', '20141110193440');
INSERT INTO `config` VALUES ('143', '0', '1', 'testXml2.xml', '\n\n    \n        \n            /tradeMap\n            /tradeMap\n        \n    \n', '2', '1_0_0_0', '1', '20141110193605', '20141110193605');
INSERT INTO `config` VALUES ('146', '0', '1', 'code.properties', 'syserror.paramtype=\\u8bf7\\u6c42\\u53c2\\u6570\\u89e3\\u6790\\u9519\" + \"\\u8bef', '2', '1_0_0_0', '1', '20150107115835', '20150107115835');
INSERT INTO `config` VALUES ('147', '0', '1', 'testJson.json', '{\"message\": {}, \"success\": \"true\"}', '2', '1_0_0_0', '1', '20150121150626', '20150121153650');
INSERT INTO `config` VALUES ('148', '0', '1', 'autoconfig.properties', 'auto=bbdxxjdccd', '2', '1_0_0_0', '1', '20150320130619', '20150320224956');
INSERT INTO `config` VALUES ('149', '0', '1', 'autoconfig2.properties', 'auto2=cd', '2', '1_0_0_0', '1', '20150320130625', '20150320203808');
INSERT INTO `config` VALUES ('154', '0', '0', 'db.properties', 'jdbc.driver=com.mysql.jdbc.Driver\r\njdbc.url=jdbc:mysql://localhost:3306/shiro?characterEncoding=utf-8\r\njdbc.username=k2mwfNyZL/M=\r\njdbc.password=k2mwfNyZL/M=', '3', '1', '3', '20180607105801', '20180607110943');
INSERT INTO `config` VALUES ('155', '0', '1', 'db.properties', 'jdbc.driver=com.mysql.jdbc.Driver\r\njdbc.url=jdbc:mysql://localhost:3306/shiro?characterEncoding=utf-8\r\njdbc.username=k2mwfNyZL/M=\r\njdbc.password=k2mwfNyZL/M=', '4', '1', '3', '20180607111027', '20180607111027');

-- ----------------------------
-- Table structure for `config_history`
-- ----------------------------
DROP TABLE IF EXISTS `config_history`;
CREATE TABLE `config_history` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `config_id` bigint(20) NOT NULL,
  `old_value` longtext NOT NULL,
  `new_value` longtext NOT NULL,
  `create_time` varchar(14) NOT NULL DEFAULT '99991231235959',
  `update_by` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of config_history
-- ----------------------------
INSERT INTO `config_history` VALUES ('1', '154', '', 'jdbc.driver=com.mysql.jdbc.Driver\r\njdbc.url=jdbc:mysql://localhost:3306/shiro?characterEncoding=utf-8\r\njdbc.username=k2mwfNyZL/M=\r\njdbc.password=k2mwfNyZL/M=', '20180607105801', '6');
INSERT INTO `config_history` VALUES ('2', '154', 'jdbc.driver=com.mysql.jdbc.Driver\r\njdbc.url=jdbc:mysql://localhost:3306/shiro?characterEncoding=utf-8\r\njdbc.username=k2mwfNyZL/M=\r\njdbc.password=k2mwfNyZL/M=', '', '20180607110943', '6');
INSERT INTO `config_history` VALUES ('3', '155', '', 'jdbc.driver=com.mysql.jdbc.Driver\r\njdbc.url=jdbc:mysql://localhost:3306/shiro?characterEncoding=utf-8\r\njdbc.username=k2mwfNyZL/M=\r\njdbc.password=k2mwfNyZL/M=', '20180607111027', '6');

-- ----------------------------
-- Table structure for `env`
-- ----------------------------
DROP TABLE IF EXISTS `env`;
CREATE TABLE `env` (
  `env_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT 'DEFAULT_ENV' ,
  PRIMARY KEY (`env_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ;

-- ----------------------------
-- Records of env
-- ----------------------------
INSERT INTO `env` VALUES ('1', 'rd');
INSERT INTO `env` VALUES ('2', 'qa');
INSERT INTO `env` VALUES ('3', 'local');
INSERT INTO `env` VALUES ('4', 'online');

-- ----------------------------
-- Table structure for `role`
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `role_id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_name` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名',
  `create_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '创建时间',
  `create_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
  `update_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '更新时间',
  `update_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', '普通人', '99991231235959', '2', '99991231235959', '2');
INSERT INTO `role` VALUES ('2', '管理员', '99991231235959', '2', '99991231235959', '2');
INSERT INTO `role` VALUES ('3', '测试管理员', '99991231235959', '2', '99991231235959', '2');

-- ----------------------------
-- Table structure for `role_resource`
-- ----------------------------
DROP TABLE IF EXISTS `role_resource`;
CREATE TABLE `role_resource` (
  `role_res_id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'role-resource id',
  `role_id` int(10) NOT NULL DEFAULT '0' COMMENT '用户角色id',
  `url_pattern` varchar(200) NOT NULL DEFAULT '' COMMENT 'controller_requestMapping_value + method_requestMapping_value',
  `url_description` varchar(200) NOT NULL DEFAULT '' COMMENT 'url功能描述',
  `method_mask` varchar(4) NOT NULL DEFAULT '' COMMENT 'GET, PUT, POST, DELETE, 1: accessible',
  `update_time` varchar(14) NOT NULL DEFAULT '99991231235959' COMMENT '更新时间',
  PRIMARY KEY (`role_res_id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COMMENT='用户角色_url访问权限表';

-- ----------------------------
-- Records of role_resource
-- ----------------------------
INSERT INTO `role_resource` VALUES ('1', '1', '/api/app/list', 'app列表', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('2', '2', '/api/app/list', 'app列表', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('3', '3', '/api/app/list', 'app列表', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('4', '1', '/api/app', '生成一个app', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('5', '2', '/api/app', '生成一个app', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('6', '3', '/api/app', '生成一个app', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('7', '1', '/api/env/list', 'env-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('8', '2', '/api/env/list', 'env-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('9', '3', '/api/env/list', 'env-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('10', '1', '/api/account/session', '会话', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('11', '2', '/api/account/session', '会话', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('12', '3', '/api/account/session', '会话', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('13', '1', '/api/account/signin', '登录', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('14', '2', '/api/account/signin', '登录', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('15', '3', '/api/account/signin', '登录', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('16', '1', '/api/account/signout', '登出', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('17', '2', '/api/account/signout', '登出', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('18', '3', '/api/account/signout', '登出', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('19', '1', '/api/config/item', '获取配置项', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('20', '2', '/api/config/item', '获取配置项', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('21', '3', '/api/config/item', '获取配置项', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('22', '1', '/api/config/file', '获取配置文件', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('23', '2', '/api/config/file', '获取配置文件', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('24', '3', '/api/config/file', '获取配置文件', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('25', '1', '/api/zoo/hosts', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('26', '2', '/api/zoo/hosts', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('27', '3', '/api/zoo/hosts', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('28', '1', '/api/zoo/prefix', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('29', '2', '/api/zoo/prefix', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('30', '3', '/api/zoo/prefix', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('31', '1', '/api/zoo/zkdeploy', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('32', '2', '/api/zoo/zkdeploy', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('33', '3', '/api/zoo/zkdeploy', 'zoo', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('34', '1', '/api/web/config/item', '创建item-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('35', '2', '/api/web/config/item', '创建item-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('36', '3', '/api/web/config/item', '创建item-config', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('37', '1', '/api/web/config/file', '创建file-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('38', '2', '/api/web/config/file', '创建file-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('39', '3', '/api/web/config/file', '创建file-config', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('40', '1', '/api/web/config/filetext', '创建file-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('41', '2', '/api/web/config/filetext', '创建file-config', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('42', '3', '/api/web/config/filetext', '创建file-config', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('43', '1', '/api/web/config/versionlist', '版本list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('44', '2', '/api/web/config/versionlist', '版本list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('45', '3', '/api/web/config/versionlist', '版本list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('46', '1', '/api/web/config/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('47', '2', '/api/web/config/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('48', '3', '/api/web/config/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('49', '1', '/api/web/config/simple/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('50', '2', '/api/web/config/simple/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('51', '3', '/api/web/config/simple/list', 'config-list', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('52', '1', '/api/web/config/{configId}', 'get/post', '1001', '99991231235959');
INSERT INTO `role_resource` VALUES ('53', '2', '/api/web/config/{configId}', 'get/post', '1001', '99991231235959');
INSERT INTO `role_resource` VALUES ('54', '3', '/api/web/config/{configId}', 'get/post', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('55', '1', '/api/web/config/zk/{configId}', 'get-zk', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('56', '2', '/api/web/config/zk/{configId}', 'get-zk', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('57', '3', '/api/web/config/zk/{configId}', 'get-zk', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('58', '1', '/api/web/config/download/{configId}', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('59', '2', '/api/web/config/download/{configId}', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('60', '3', '/api/web/config/download/{configId}', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('61', '1', '/api/web/config/downloadfilebatch', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('62', '2', '/api/web/config/downloadfilebatch', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('63', '3', '/api/web/config/downloadfilebatch', 'download', '1000', '99991231235959');
INSERT INTO `role_resource` VALUES ('64', '1', '/api/web/config/item/{configId}', 'update', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('65', '2', '/api/web/config/item/{configId}', 'update', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('66', '3', '/api/web/config/item/{configId}', 'update', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('67', '1', '/api/web/config/file/{configId}', 'update/post', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('68', '2', '/api/web/config/file/{configId}', 'update/post', '0010', '99991231235959');
INSERT INTO `role_resource` VALUES ('69', '3', '/api/web/config/file/{configId}', 'update/post', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('70', '1', '/api/web/config/filetext/{configId}', 'update', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('71', '2', '/api/web/config/filetext/{configId}', 'update', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('72', '3', '/api/web/config/filetext/{configId}', 'update', '0000', '99991231235959');
INSERT INTO `role_resource` VALUES ('73', '1', '/api/account/password', '修改密码', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('74', '2', '/api/account/password', '修改密码', '0100', '99991231235959');
INSERT INTO `role_resource` VALUES ('75', '3', '/api/account/password', '修改密码', '0000', '99991231235959');

-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `name` varchar(50) NOT NULL COMMENT '姓名',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `token` varchar(255) NOT NULL COMMENT 'token',
  `ownapps` varchar(255) NOT NULL DEFAULT '' COMMENT '能操作的APPID,逗号分隔',
  `role_id` bigint(20) NOT NULL DEFAULT '1' COMMENT '角色ID',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'testUser1', '5eec8499597a115c88e0a9580ae1562ab85d0b1a', 'b9070d385a13357efa09e50e080607c2b299241b', '2', '1');
INSERT INTO `user` VALUES ('2', 'testUser2', '71e9dc667eefa5a3a4840cb4f1ce22bc246f22f0', 'b169dec42f61ec6cbad88d70e7c4c6b89630ccfb', '2', '1');
INSERT INTO `user` VALUES ('3', 'testUser3', 'e2cdc4a9195030543e38e19a923f075d54471cc4', 'a1a20b0e03a5191c530cbfc064eda3c16254df64', '2', '1');
INSERT INTO `user` VALUES ('4', 'testUser4', '5cef2d7e4ada5a615f03e12b569d80aedfb056fc', '007b07fccbc1c82c987f7b8e4651e85cca01cf2b', '2', '1');
INSERT INTO `user` VALUES ('5', 'testUser5', 'f996eeaa224abe0037d99adbce73c315e13238f9', 'c9dfdcb50a3d84f2b6a4771dcb7c2ceb19e7d281', '2', '1');
INSERT INTO `user` VALUES ('6', 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'f28d164d23291c732f64134e6b7d92be3ff8b1b3', '', '2');
INSERT INTO `user` VALUES ('7', 'admin_read', 'b76f3e20d1c8d0bc17d40158e44097d5eeee8640', '2022ab9c2754d62f9ddba5fded91e4238247ebaf', '2', '3');
INSERT INTO `user` VALUES ('8', 'mobiledsp', '0855b44a368e44dc6e6825532073b29a368584af', '132069654193f802203d1c6c86e753ecede698f6', '4', '1');
INSERT INTO `user` VALUES ('9', 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'f28d164d23291c732f64134e6b7d92be3ff8b1b3', '2', '1');

1.4 部署war包

1、在${TOMCAT_HOME}/webapps/下新建html文件夹。

2、将\disconf-master\disconf-web\html下的所有文件拷贝到html文件夹下

3、将打好的war包拷贝到${TOMCAT_HOME}/webapps/下。

4、将\disconf-master\disconf-web\profile\rd下的

jdbc-mysql.properties (数据库配置)
redis-config.properties (Redis配置)
zoo.properties (Zookeeper配置)
application.properties (应用配置)

拷贝到 ${TOMCAT_HOME}/webapps/disconf-web\WEB-INF\classes下
:将application-demo.properties复制成application.properties,即使只有一个redis,也应该配置两个redis client,否则将造成内部错误。*
然后修改文件下的配置文件

1.5 配置tomcat

修改${TOMCAT_HOME}/conf/server.xml


      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        
        
<Context path="" docBase="D:\\server\\apache-tomcat-7.0.69\webapps\\disconf-web"> Context>  
        
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"

               pattern="%h %l %u %t "%r" %s %b" >



Valve>
      Host>

1.6 配置nginx

修改nginx.conf ,可直接拷贝进去就可以。

#user  root;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;
    gzip_http_version 1.0;
    gzip_disable "MSIE [1-6].";
    gzip_types text/plain application/x-javascript text/css text/javascript application/x-httpd-php image/jpeg image/gif image/png;

upstream disconf {
    server localhost:8090;
}

server {
    listen   80;
    server_name disconf.com;
    access_log  d:/access.log;
    error_log  d:/error.log;

    location / {
        root D:\server\apache-tomcat-7.0.69\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;
    }
}
}

1.6测试

启动zookeeper、redis、mysql、tomcat、nginx
访问:http://localhost 默认用户名密码:adming/admin
百度DisConf-分布式配置管理平台-安装_第3张图片
登录进去的页面:
百度DisConf-分布式配置管理平台-安装_第4张图片
到此,已成功安装。

百度DisConf-分布式配置管理平台-安装_第5张图片

你可能感兴趣的:(百度disconf)