Linux Ubuntu 16.04安装百度disconf

1.安装disconf前需要安装以下依赖环境
java version "1.8.0_181"
maven Apache Maven 3.2.2
redis环境安装 参考https://blog.csdn.net/wjw1639942939/article/details/86146939
mysql环境安装 参考https://blog.csdn.net/wjw1639942939/article/details/86147387
Zookeeeper环境安装 参考https://blog.csdn.net/wjw1639942939/article/details/86148373
Nginx环境安装 参考https://blog.csdn.net/wjw1639942939/article/details/86147963
tomcat环境
2.下载disconf https://github.com/knightliao/disconf/archive/master.zip
3.解压文件 disconf-master.zip
4.创建自定义disconf安装目录
mkdir /wjw/disconf/online-resources
mkdir /wjw/disconf/war
5.复制以下文件到/wjw/disconf/online-resources下
Linux Ubuntu 16.04安装百度disconf
文章图片

cp -r /wjw/software/disconf/disconf-master/disconf-web/profile/rd//wjw/disconf/online-resources
6.进入/wjw/disconf/online-resources目录
cd /wjw/disconf/online-resources
cp application-demo.properties application.properties
注意application.properties下的 domain=disconf.com 配置nginx需要一致
7.进入/wjw/disconf/online-resources目录修改zoo.properties
cd /wjw/disconf/online-resources
vim zoo.properties
修改hosts=127.0.0.1:2181 与自己部署的zookeeper端口一致,有多个逗号分隔
注意zookeeper_url_prefix=/disconf到时候nginx需要配置成一样
8.配置disconf发布环境变量
vim /etc/profile
ONLINE_CONFIG_PATH=/wjw/disconf/online-resources
WAR_ROOT_PATH=/wjw/disconf/war
export ONLINE_CONFIG_PATH
export WAR_ROOT_PATH
【Linux Ubuntu 16.04安装百度disconf】使配置文件生效 source /etc/profile
9.打包到war到配置的环境变量
cd /wjw/software/disconf/disconf-master/disconf-web/
sh deploy/deploy.sh
打包成功后,/wjw/disconf/war目录下应有以下文件
Linux Ubuntu 16.04安装百度disconf
文章图片

10.初始化mysql所需数据库
进入sql所在目录
cd /wjw/software/disconf/disconf-master/disconf-web/sql/
Linux Ubuntu 16.04安装百度disconf
文章图片

执行以下命令初始化数据库
mysql -uroot -p123456 <0-init_table.sql
mysql -uroot -p123456 -Ddisconf<1-init_data.sql
mysql -uroot -p123456 -Ddisconf<201512/20151225.sql
mysql -uroot -p123456 -Ddisconf<20160701/20160701.sql
初始化成功通过navicat查看
Linux Ubuntu 16.04安装百度disconf
文章图片

11.tomcat配置war部署目录
cd /wjw/tomcat/disconf-server/conf/
vim server.xml
添加如下内容

Linux Ubuntu 16.04安装百度disconf
文章图片

12.配置nginx 在nginx http下添加以下内容
upstream disconf {
server 127.0.0.1:8080; //tomcat端口号
}

server {
listen8000; //转发访问端口号
server_name disconf.com; //与/wjw/disconf/online-resources application.properties下的 domain=disconf.com 一致

access_log /wjw/logs/disconf/access.log; //这个需要到/wjw/disconf/online-resources 目录下修改log目录
error_log /wjw/logs/disconf/error.log;

location / {
root /wjw/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;
}
}
12.先启动tomcat再启动nginx
tomcat 启动报C3P0错误不用管
13.浏览器输入http://116.196.117.183:8000
使用admin admin 登录
Linux Ubuntu 16.04安装百度disconf
文章图片

Linux Ubuntu 16.04安装百度disconf
文章图片

    推荐阅读