Commit b40a173e by carrieyzzhang

receiver log

parent f4b034a3
...@@ -63,8 +63,12 @@ ...@@ -63,8 +63,12 @@
<report.url>http://172.31.1.122:9010</report.url> <report.url>http://172.31.1.122:9010</report.url>
<admin.url>http://localhost:8080</admin.url> <admin.url>http://localhost:8080</admin.url>
<receiver.host>172.31.30.1,172.31.22.39,172.31.22.38,172.31.4.0,172.31.3.123,172.31.16.68,172.31.30.154,172.31.26.177</receiver.host> <receiver.host>172.31.30.1,172.31.22.39,172.31.22.38,172.31.4.0,172.31.3.123,172.31.16.68,172.31.30.154,172.31.27.121,172.31.17.216</receiver.host>
<receiver.port>8080</receiver.port> <receiver.port>8080</receiver.port>
<io.receiver.host>172.31.4.0,172.31.3.123</io.receiver.host>
<io.receiver.port>8222</io.receiver.port>
<trackingio.url>http://52.80.113.103:8002</trackingio.url> <trackingio.url>http://52.80.113.103:8002</trackingio.url>
<demo.url>http://localhost:9010</demo.url> <demo.url>http://localhost:9010</demo.url>
...@@ -182,7 +186,11 @@ ...@@ -182,7 +186,11 @@
<report.url>http://localhost:8003/</report.url> <report.url>http://localhost:8003/</report.url>
<admin.url>http://localhost:9020</admin.url> <admin.url>http://localhost:9020</admin.url>
<receiver.host>ec2-54-223-170-25.cn-north-1.compute.amazonaws.com.cn</receiver.host> <receiver.host>ec2-54-223-170-25.cn-north-1.compute.amazonaws.com.cn</receiver.host>
<receiver.port>8081</receiver.port> <receiver.port>8080</receiver.port>
<io.receiver.host>ec2-54-223-170-25.cn-north-1.compute.amazonaws.com.cn</io.receiver.host>
<io.receiver.port>8081</io.receiver.port>
<trackingio.url>http://localhost:8002</trackingio.url> <trackingio.url>http://localhost:8002</trackingio.url>
<demo.url>http://localhost:9003</demo.url> <demo.url>http://localhost:9003</demo.url>
...@@ -264,6 +272,9 @@ ...@@ -264,6 +272,9 @@
<receiver.host>172.31.30.1,172.31.22.39,172.31.22.38,172.31.4.0,172.31.3.123,172.31.16.68,172.31.30.154,172.31.27.121,172.31.17.216</receiver.host> <receiver.host>172.31.30.1,172.31.22.39,172.31.22.38,172.31.4.0,172.31.3.123,172.31.16.68,172.31.30.154,172.31.27.121,172.31.17.216</receiver.host>
<receiver.port>8080</receiver.port> <receiver.port>8080</receiver.port>
<io.receiver.host>172.31.4.0,172.31.3.123</io.receiver.host>
<io.receiver.port>8222</io.receiver.port>
<profile.table>kudu.default.profile_</profile.table> <profile.table>kudu.default.profile_</profile.table>
<event.table>tkio_bigtable_view.event_</event.table> <event.table>tkio_bigtable_view.event_</event.table>
<usergroup.table>tkio_bigtable.tkio_user_group</usergroup.table> <usergroup.table>tkio_bigtable.tkio_user_group</usergroup.table>
......
...@@ -91,6 +91,39 @@ public class LogController { ...@@ -91,6 +91,39 @@ public class LogController {
} catch (Exception e) { } catch (Exception e) {
logger.error("url: {}", url, e); logger.error("url: {}", url, e);
try { try {
MailUtils.sendSimpleEmail("io日志流服务", "日志流服务暂不可用, url: " + url + ", message:" + e.getMessage(), Constant.mlist);
} catch (Exception e1) {
logger.error("邮件服务不可用 getLogs()");
}
continue;
}
}
String[] ioHostArray = Constant.ioreceiverHost.split(",");
for (String host : ioHostArray) {
String url = "http://"+host.trim()+":"+ Constant.receiverPort+"/receive/newlylogs/"+appId;
try {
String httpresult = HttpClientUtil.doHttpGetRequest(url, host);
if (!StringUtil.isEmpty(httpresult)) {
try {
JSONObject httpresultObject = new JSONObject(httpresult);
if (httpresultObject.has("result")) {
JSONArray resultArray = httpresultObject.getJSONArray("result");
for (int i=0; i<resultArray.length(); i++) {
JSONObject ob = resultArray.getJSONObject(i);
obList.add(ob);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
} catch (Exception e) {
logger.error("url: {}", url, e);
try {
MailUtils.sendSimpleEmail("日志流服务", "日志流服务暂不可用, url: " + url + ", message:" + e.getMessage(), Constant.mlist); MailUtils.sendSimpleEmail("日志流服务", "日志流服务暂不可用, url: " + url + ", message:" + e.getMessage(), Constant.mlist);
} catch (Exception e1) { } catch (Exception e1) {
logger.error("邮件服务不可用 getLogs()"); logger.error("邮件服务不可用 getLogs()");
......
...@@ -37,6 +37,8 @@ public class Constant { ...@@ -37,6 +37,8 @@ public class Constant {
public static String trackingUrl = commonBundle.getString("trackingio.url"); public static String trackingUrl = commonBundle.getString("trackingio.url");
public static String receiverHost = commonBundle.getString("receiver.host"); public static String receiverHost = commonBundle.getString("receiver.host");
public static String receiverPort = commonBundle.getString("receiver.port"); public static String receiverPort = commonBundle.getString("receiver.port");
public static String ioreceiverHost = commonBundle.getString("io.receiver.host");
public static String ioreceiverPort = commonBundle.getString("io.receiver.port");
public static String demoUrl = commonBundle.getString("demo.url"); public static String demoUrl = commonBundle.getString("demo.url");
public static String flowneed = commonBundle.getString("flowneed"); public static String flowneed = commonBundle.getString("flowneed");
public static String reportExportTask = commonBundle.getString("report.export.task"); public static String reportExportTask = commonBundle.getString("report.export.task");
......
...@@ -6,6 +6,8 @@ report.export.task=${report.export.task} ...@@ -6,6 +6,8 @@ report.export.task=${report.export.task}
receiver.host=${receiver.host} receiver.host=${receiver.host}
receiver.port=${receiver.port} receiver.port=${receiver.port}
io.receiver.host=${io.receiver.host}
io.receiver.port=${io.receiver.port}
report.url=${report.url} report.url=${report.url}
awsneed=${awsneed} awsneed=${awsneed}
iscache=${iscache} iscache=${iscache}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment