centos7.x搭建disconf

###分布式配置管理平台-Disconfweb管理端安装
##安装依赖软件
#配置java、maven环境
#安装Mysql(Ver14.12Distrib5.0.45,forunknown-linux-gnu(x86_64)usingEditLinewrapper)
#安装Tomcat(apache-tomcat-7.0.50)
#安装Nginx(nginx/1.5.3)
#安装zookeeeper(zookeeper-3.3.0)port:8581
#安装Redis(2.4.5)	port:6379

本人安装的软件版本和官方不一样,比他们的高。

以下只是部分记录

#安装Tomcat
yuminstalltomcat-y

tomcatversion
Serverversion:ApacheTomcat/7.0.76
Serverbuilt:Aug7201704:31:46UTC
Servernumber:7.0.76.0
OSName:Linux
OSVersion:3.10.0-327.el7.x86_64
Architecture:amd64
JVMVersion:1.8.0_144-b01
JVMVendor:OracleCorporation
#安装nginx
yuminstallnginx-y

nginx-v
nginxversion:nginx/1.10.2
#安装zookeeper3.3.6端口改为8581
这个直接解压即可
#安装redis
yuminstallredis-y

redis-server-v
Redisserverv=3.2.3sha=00000000:0malloc=jemalloc-3.6.0bits=64build=672aed6eb816ad6c
#下载disconf
cd/usr/local/src/
wget-c-Odisconf.ziphttps://github.com/knightliao/disconf/archive/master.zip
unzipdisconf.zip
##disconf安装
#创建目录,将你的配置文件放到此地址目录online-resources下(以下地址可自行设定):
mkdir-p/data/disconf/online-resources
mkdir-p/data/disconf/war
#如果不确定如何配置,可以拷贝/disconf-web/profile/rd/目录下的文件,拷贝过去后修改即可。
cp/usr/local/src/disconf-master/disconf-web/profile/rd/*/data/disconf/online-resources/
#记得执行将application-demo.properties复制成application.properties:
cp/data/disconf/online-resources/application-demo.properties/data/disconf/online-resources/application.properties

*注意,即使只有一个redis,也应该配置两个redisclient,否则将造成内部错误。*
#构建
ONLINE_CONFIG_PATH=/data/disconf/online-resources
WAR_ROOT_PATH=/data/disconf/war
exportONLINE_CONFIG_PATH
exportWAR_ROOT_PATH
cddisconf-web
shdeploy/deploy.sh
#导入数据结构
mysql-h192.168.2.252-uroot-p<0-init_table.sql
mysql-h192.168.2.252-uroot-pdisconf<1-init_data.sql
mysql-h192.168.2.252-uroot-pdisconf<201512/20151225.sql
mysql-h192.168.2.252-uroot-pdisconf<20160701/20160701.sql
#配置文件包括:
-jdbc-mysql.properties(数据库配置)
-redis-config.properties(Redis配置,主要用于web登录使用)
-zoo.properties(Zookeeper配置)
-application.properties(应用配置)
#部署war,修改server.xml文件,在Host结点下设定Context:
vim/etc/tomcat/server.xml
<Contextpath=""docBase="/data/disconf/war/"></Context>
并设置端口为8015
启动Tomcat,即可。
#配置nginx
#添加include/etc/nginx/vhosts/*.conf;
vim/etc/nginx/nginx.conf
include/etc/nginx/vhosts/*.conf;

#编辑disconfi.conf
vim/etc/nginx/vhosts/disconf.conf

upstreamdisconf{
server127.0.0.1:8015;
}

server{

listen8081;
server_namedisconf.xxx.com;
access_log/data/disconf/log/access.log;
error_log/data/disconf/log/error.log;

location/{
root/data/disconf/war/html;
if($query_string){
expiresmax;
}
}
location~^/(api|export){
proxy_pass_headerServer;
proxy_set_headerHost$http_host;
proxy_redirectoff;
proxy_set_headerX-Real-IP$remote_addr;
proxy_set_headerX-Scheme$scheme;
proxy_passhttp://disconf;
}
}

#启动nginx
servicenginxstart

#访问8081地址即可

最后上一张部署架构图


排错:

1、我的war目录是 /data/disconf/war ,如果该目录下没有tmp,则需要创建mkdir -p/data/disconf/war/tmp

2、zookeeper连接不上,先看pom依赖文件,然后看zoo.cfg配置文件,连接需要改为外网ip,如果不需要外网,可以更改内网ip,但是127.0.0.1是不行的。

相关文章

文章浏览阅读903次。4.清除缓存目录(/var/cache/yum)下的软件...
文章浏览阅读1.5k次。Python 是一种高级解释性编程语言,已被...
文章浏览阅读2.6k次。打开终端或控制台,以root或具有sudo权...
文章浏览阅读744次,点赞24次,收藏26次。目标:通过AppSrv为...
文章浏览阅读1.1w次,点赞8次,收藏26次。chmod命令来自于英...
文章浏览阅读1.2k次。yum源的URL地址,本例中是文件系统的路...