The disconf distributed configuration management platform is mainly used here to support window and linux.
Required environment: Windows, nginx1.8.1, redis3.0.5, zookeeper3.4.6, mysql5.7, python2.7.11, Git-2.6.4-64-bit.exe
1. Download and unzip nginx, unzip it to d :/dev/nginx-1.9.9, start nginx , try http://localhost See if you can access the nginx welcome page. |
2. Install Git-2.6.4-64-bit.exe and use the git – version command in GitBash to confirm the version information: git version 2.6.4.windows.1 |
3. Install python-2.7.11.amd64.msi , add C:\Python27 to the PATH environment variable, use it in GitBash python - version command to confirm version information: Python 2.7.11 |
4. Download and unzip d:\dev\zookeeper-3.4.7 , d:\dev\redis64-2.8.19 , d:\dev\apache-tomcat-8.0.15 Install mysql , etc. on this machine, and confirm that the above can be started normally: |
Copy and modify d:\dev\zookeeper-3.4.7\conf\ zoo_sample.cfg in the same directory as zoo.cfg , switch GitBash Go to d:\dev\zookeeper-3.4.7\bin , use the command ./zkServer.sh start to start zk , there is no problem, it can be connected by default Connect to port 2181 (only one is deployed). |
Redis prepares two: d:\dev\redis64-2.8.19, copy redis.windows.6380.conf, redis.windows.6379.conf (copy the configuration file to modify the name, modify the port) , switch on the Windows command line respectively Go to d:\dev\redis64-2.8.19-xxxx , use the commands redis-server.exe redis.windows.6380.conf, redis-server.exe redis.windows.6379.conf to start redis , there is no problem, the prompt can be Connect to port xxxx , running in stand-alone mode (two Redis ). Configure tomcat Set the CATALINA_HOME environment variable /d/dev/apache-tomcat-8.0.15 , start startup.sh in GitBash , visit There is no problem asking http://localhost:8080 . |
Create a new directory d:\home\work\dsp\disconf-rd
d:\home\work\dsp\disconf-rd\online-resources (copy 4 configuration files here) d:\home\work\dsp\disconf-rd\war |
d:\home\work\var\logs\disconf |
5. Copy the following 4 configuration files to d:\home\work\dsp\disconf-rd\online-resources , in the d:\workspace\disconf\disconf-web\profile\rd directory, and modify the configuration - jdbc-mysql.properties ( database configuration ) |
- redis-config.properties (Redis configuration ) |
- zoo.properties (Zookeeper configuration ) |
- application.properties ( application configuration) is copied and renamed from application-demo.properties |
6. |
Switch to the d:\workspace\disconf directory in GitBash, and execute the following commands one by one ONLINE_CONFIG_PATH=/d/home/work/dsp/disconf-rd/online-resources WAR_ROOT_PATH=/d/home/work/dsp/disconf-rd/war export ONLINE_CONFIG_PATH |
export WAR_ROOT_PATH |
cd disconf-web |
sh deploy/deploy.sh |
After the end, you can see that war and a bunch of files, including static resources, are generated under d:\home\work\dsp\disconf-rd\war . |
7. Execute the initialization of 0-init_table.sql and 1-init_data.sql in d:\workspace\disconf\disconf-web\sql and need to execute the disconf-web\sql\201512\20151225.sql file |
Note: the tomcat port needs to be the same as the nginx port 8080
upstream disconf {
server 127.0.0.1:8080;
}
server 127.0.0.1:8080;
}
server_name localhost;
access_log /disconf/work/var/logs/disconf/access.log;
error_log /disconf/work/var/logs/disconf/error.log;
root /disconf/work/dsp/disconf-rd/war/html;
if ($query_string) {
expires max;
}
}
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;
}
}
9.执行 nginx –s reload重新加载 nginx配置,访问 http://localhost:8081看是否可以访问到 disconf静态页面,没有问题。 |
10.修改 d:\dev\apache-tomcat-8.0.15中的 server.xml文件,在 Host结点下设定 Context,并 设置端口为8015,GitBash中启动 tomcat:startup.sh <Context path="" docBase="d:\home\work\dsp\disconf-rd\war"></Context> |
11.访问 http://localhost:8081,以admin/admin登录,OK。 |
总结一下,GitBash中启动 zk,Windows命令行启动 6379和 6380两个 redis,GitBash中启 动tomcat,就这样。 |