[AGENT][INIT] 修复Agent启动的Bug
This commit is contained in:
@@ -5,6 +5,7 @@ import io.wdd.common.beans.response.R;
|
|||||||
import io.wdd.common.beans.response.ResultStat;
|
import io.wdd.common.beans.response.ResultStat;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
@@ -100,12 +101,18 @@ public class GlobalExceptionHandler {
|
|||||||
@ExceptionHandler(value = {HttpRequestMethodNotSupportedException.class})
|
@ExceptionHandler(value = {HttpRequestMethodNotSupportedException.class})
|
||||||
public void methodNotMatchHandler(HttpRequestMethodNotSupportedException httpRequestMethodNotSupportedException) {
|
public void methodNotMatchHandler(HttpRequestMethodNotSupportedException httpRequestMethodNotSupportedException) {
|
||||||
|
|
||||||
log.debug(
|
log.error(
|
||||||
httpRequestMethodNotSupportedException.getMessage()
|
httpRequestMethodNotSupportedException.getMessage()
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExceptionHandler(value = {ListenerExecutionFailedException.class})
|
||||||
|
public void listenerExecutionFailedExceptionHandler(ListenerExecutionFailedException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拦截数据库异常
|
* 拦截数据库异常
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import io.wdd.func.xray.beans.node.ProxyNode;
|
|||||||
import io.wdd.func.xray.beans.node.ProxyNodeType;
|
import io.wdd.func.xray.beans.node.ProxyNodeType;
|
||||||
import io.wdd.func.xray.beans.node.XrayConfigInfo;
|
import io.wdd.func.xray.beans.node.XrayConfigInfo;
|
||||||
import io.wdd.server.beans.vo.ServerInfoVO;
|
import io.wdd.server.beans.vo.ServerInfoVO;
|
||||||
|
import io.wdd.server.coreService.CoreAppService;
|
||||||
import io.wdd.server.coreService.CoreServerService;
|
import io.wdd.server.coreService.CoreServerService;
|
||||||
import io.wdd.server.service.AppInfoService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@ import static io.wdd.rpc.init.AcceptAgentInitInfo.ALL_SERVER_CITY_INDEX;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 为Xray Config信息 操作数据库而创建
|
* 为Xray Config信息 操作数据库而创建
|
||||||
|
* todo 初期只需要记录构建过的路径(MySQL), 后期如此复杂的网路可以考虑上图数据库Neo4j
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -29,7 +30,7 @@ public class XrayDBOperator {
|
|||||||
CoreServerService coreServerService;
|
CoreServerService coreServerService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
AppInfoService appInfoService;
|
CoreAppService coreAppService;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void cache() {
|
public void cache() {
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ else
|
|||||||
machineNumber=99
|
machineNumber=99
|
||||||
fi
|
fi
|
||||||
cat >/etc/environment.d/octopus-agent.conf <<EOF
|
cat >/etc/environment.d/octopus-agent.conf <<EOF
|
||||||
serverName=${city}-${hostArch}-${machineNumber}
|
serverName=${region}-${hostArch}-${machineNumber}
|
||||||
serverIpPbV4=$public_ipv4
|
serverIpPbV4=$public_ipv4
|
||||||
serverIpInV4=
|
serverIpInV4=
|
||||||
serverIpPbV6=$public_ipv6
|
serverIpPbV6=$public_ipv6
|
||||||
|
|||||||
Reference in New Issue
Block a user