webPage logService 日志服务 剥离

【旧的场景】
1、x.a.com指向负载均衡服务器ipL;
2、代码所在的应用服务器ipA,ipB,ipC,运行nginx-phpFPM服务,提供2个服务;
2.1、应用服务器ipA,ipB,ipC中web服务:
webPage-URL: http://x.a.com/m-phpPage/c/v;
2.2、应用服务器pA,ipB,ipC中log服务:
writeLog-URL: http://x.a.com/m--phpWriteTxtLog/c/v(日志在本地落盘,分布于ipA,ipB,ipC;);
3、ipL为ipA,ipB,ipC提供负载均衡服务;


【新的场景】
第0期:
1、不修改原有url即不修改现有代码(php+js)且不修改DNS;
2、修改ipA,ipB,ipC中的nginx配置文件,对writeLog-URL转发至在服务器ipD上的日志服务器Flume组件(日志在日志服务器落盘,分布于ipD;);

后期计划:
1、请求发给网关;
2、网关将请求分发至具体的服务;
(在第0期中,nginx转发日志请求后,请求首先到了ipD上的网关服务,之后被依照Flume组件要求经网关处理后半透明地2次转发至了日志服务);

【操作步骤-第0期】
a.启动Fluem;
b.启动网关;
java -jar /data/gateway/java/target/NettyA-1.0-SNAPSHOT-jar-with-dependencies.jar 18080 10.24.192.192 50000
c.在ipA上备份nginx.conf,修改nginx.conf;
location /visit/ {
proxy_pass http://10.24.192.192:18080/;
}
d.在ipA上平滑重启nginx( /usr/local/nginx/sbin/nginx -s reload; );
e.分析观察网关服务、日志服务的状态;如无误则对ipB、ipC进行scp配置文件、ssh平滑启动nginx;否则回滚nginx配置;

scp /usr/local/nginx/conf/* root@b:/usr/local/nginx/;scp /usr/local/nginx/conf/* root@c:/usr/local/nginx/;ssh root@b "/usr/local/nginx/sbin/nginx -s reload;";ssh root@c "/usr/local/nginx/sbin/nginx -s reload;";

原文地址:https://www.cnblogs.com/rsapaper/p/9974768.html