* admin端口调整完成

* server端适配调整

* 调整部分功能

* 单机/集群admin调试完成

* 重新发布前端页面

* bug fix

* 解决server端admin配置会被远程覆盖的问题
解决default-instance.xml无法加载远程zkServers配置的问题

* 集群模式下取活动实例的问题
This commit is contained in:
rewerma
2019-08-31 12:22:16 +08:00
committed by agapple
parent 89055f7405
commit 274e91f8aa
12 changed files with 135 additions and 68 deletions

View File

@@ -2,7 +2,7 @@ package com.alibaba.otter.canal.admin;
/**
* Canal Admin动态管理接口
*
*
* @author agapple 2019年8月24日 下午9:45:49
* @since 1.1.4
*/
@@ -41,6 +41,13 @@ public interface CanalAdmin {
*/
boolean restart();
/**
* 获取所有当前节点下所有实例
*
* @return 实例信息
*/
String getInstances();
/**
* 获取所有当前节点下运行中的实例
*
@@ -50,7 +57,7 @@ public interface CanalAdmin {
/**
* 通过实例名检查
*
*
* @param destination
* @return
*/
@@ -96,7 +103,7 @@ public interface CanalAdmin {
/**
* 获取Instance的机器日志列表
*
*
* @param destination
*/
String listInstanceLog(String destination);

View File

@@ -58,6 +58,9 @@ public class SessionHandler extends SimpleChannelHandler {
case "list":
message = canalAdmin.getRunningInstances();
break;
case "instances":
message = canalAdmin.getInstances();
break;
default:
byte[] errorBytes = AdminNettyUtils.errorPacket(301,
MessageFormatter.format("ServerAdmin action={} is unknown", action).getMessage());
@@ -129,9 +132,11 @@ public class SessionHandler extends SimpleChannelHandler {
}
} catch (Throwable exception) {
byte[] errorBytes = AdminNettyUtils.errorPacket(400,
MessageFormatter.format("something goes wrong with channel:{}, exception={}",
ctx.getChannel(),
ExceptionUtils.getStackTrace(exception)).getMessage());
MessageFormatter
.format("something goes wrong with channel:{}, exception={}",
ctx.getChannel(),
ExceptionUtils.getStackTrace(exception))
.getMessage());
AdminNettyUtils.write(ctx.getChannel(), errorBytes);
}
}