diff --git a/build.gradle b/build.gradle index e8084ea80..301835c20 100644 --- a/build.gradle +++ b/build.gradle @@ -122,7 +122,8 @@ dependencies { exclude group: 'org.apache.commons' } compile 'org.thymeleaf:thymeleaf:3.0.11.RELEASE' - compile 'ognl:ognl:3.2.14' + // 使用3.1.26才能确保Thymeleaf正常 +// compile 'ognl:ognl:3.2.14' testCompile test,mbg diff --git a/src/main/java/com/webank/webase/node/mgr/deploy/chain/ChainService.java b/src/main/java/com/webank/webase/node/mgr/deploy/chain/ChainService.java index 5ceea3e36..058a67535 100644 --- a/src/main/java/com/webank/webase/node/mgr/deploy/chain/ChainService.java +++ b/src/main/java/com/webank/webase/node/mgr/deploy/chain/ChainService.java @@ -367,13 +367,14 @@ public boolean generateConfigLocalAndInitDb(String chainName, List deployNodeInfoList, List ipConfigParseList, String webaseSignAddr, String imageTag, byte encryptType, String agencyName){ - log.info("start initChainDbData chainName:{}, ipConfigParseList:{}", - chainName, ipConfigParseList); + log.info("start initChainDbData chainName:{}, deployNodeInfoList:{},ipConfigParseList:{}", + chainName, deployNodeInfoList, ipConfigParseList); ProgressTools.setInitChainData(); // insert chain final TbChain newChain = ((ChainService) AopContext.currentProxy()).insert(chainName, chainName, imageTag, encryptType, ChainStatusEnum.INITIALIZED, RunTypeEnum.DOCKER, webaseSignAddr); + log.info("initChainDbData insert newChain {}", newChain); // all host ips Map newIpHostMap = new HashMap<>(); @@ -395,6 +396,7 @@ public void initChainDbData(String chainName, List deployNodeIn newIpHostMap.putIfAbsent(config.getIp(), host); }); + log.info("initChainDbData temp newIpHostMap {}", newIpHostMap); // insert nodes for all hosts. there may be multiple nodes on a host. newIpHostMap.keySet().forEach((ip) -> { List nodePathList = null; @@ -404,12 +406,15 @@ public void initChainDbData(String chainName, List deployNodeIn throw new NodeMgrException(ConstantCode.LIST_HOST_NODE_DIR_ERROR.attach(ip)); } + log.info("initChainDbData temp nodePathList {}", nodePathList); for (Path nodeRoot : CollectionUtils.emptyIfNull(nodePathList)) { // get node properties NodeConfig nodeConfig = NodeConfig.read(nodeRoot, encryptType); + log.info("initChainDbData temp nodeConfig {}", nodeConfig); // get frontPort DeployNodeInfo targetNode = this.getFrontPort(deployNodeInfoList, ip, nodeConfig.getChannelPort()); + log.info("initChainDbData temp targetNode {}", targetNode); if (targetNode == null) { throw new NodeMgrException(ConstantCode.DEPLOY_INFO_NOT_MATCH_IP_CONF); } @@ -426,6 +431,7 @@ public void initChainDbData(String chainName, List deployNodeIn DockerCommandService.getContainerName(host.getRootDir(), chainName, nodeConfig.getHostIndex()), nodeConfig.getJsonrpcPort(), nodeConfig.getP2pPort(), nodeConfig.getChannelPort(), newChain.getId(), newChain.getChainName(), FrontStatusEnum.INITIALIZED); + log.info("initChainDbData insert front {}", front); this.frontService.insert(front); // insert node and front group mapping @@ -444,6 +450,7 @@ public void initChainDbData(String chainName, List deployNodeIn // update group timestamp and node list Pair> longListPair = nodeConfig.getGroupIdToTimestampNodeListMap().get(groupId); + log.info("initChainDbData temp longListPair {}", longListPair); if (longListPair != null) { this.groupService.updateTimestampNodeIdList(groupId,longListPair.getKey(),longListPair.getValue()); } diff --git a/src/main/java/com/webank/webase/node/mgr/deploy/service/DockerCommandService.java b/src/main/java/com/webank/webase/node/mgr/deploy/service/DockerCommandService.java index 3732f30d9..c96a610ce 100644 --- a/src/main/java/com/webank/webase/node/mgr/deploy/service/DockerCommandService.java +++ b/src/main/java/com/webank/webase/node/mgr/deploy/service/DockerCommandService.java @@ -118,6 +118,7 @@ public void pullImage(String ip, String imageTag, int imagePullType, String down log.info("pullImage from cdn"); ansibleService.execPullDockerCdnShell(ip, downloadPath + "/download", imageTag, webaseVersion); } + // todo 加上一个check image,确保拉取成功 } diff --git a/src/main/java/com/webank/webase/node/mgr/frontgroupmap/FrontGroupMapService.java b/src/main/java/com/webank/webase/node/mgr/frontgroupmap/FrontGroupMapService.java index ee0ed12ae..f4f6c3f32 100644 --- a/src/main/java/com/webank/webase/node/mgr/frontgroupmap/FrontGroupMapService.java +++ b/src/main/java/com/webank/webase/node/mgr/frontgroupmap/FrontGroupMapService.java @@ -95,10 +95,12 @@ public TbFrontGroupMap newFrontGroupWithStatus(Integer frontId, Integer groupId, */ @Transactional public TbFrontGroupMap newFrontGroup(Integer frontId, Integer groupId, GroupStatus groupStatus) { + log.info("start newFrontGroup {}|{}|{}", frontId, groupId, groupStatus); TbFrontGroupMap tbFrontGroupMap = new TbFrontGroupMap(frontId, groupId, groupStatus.getValue()); //add db frontGroupMapMapper.insertSelective(tbFrontGroupMap); + log.info("end newFrontGroup {}|{}|{}", frontId, groupId, groupStatus); return tbFrontGroupMap; } diff --git a/src/main/java/com/webank/webase/node/mgr/group/GroupService.java b/src/main/java/com/webank/webase/node/mgr/group/GroupService.java index 903752b00..89c4f19e9 100644 --- a/src/main/java/com/webank/webase/node/mgr/group/GroupService.java +++ b/src/main/java/com/webank/webase/node/mgr/group/GroupService.java @@ -1111,7 +1111,7 @@ public void updateGroupNodeCount(int groupId, int nodeCount) { @Transactional public void updateTimestampNodeIdList(int groupId, long timestamp,List nodeIdList) { - log.debug("start updateTimestampNodeIdList groupId:{} nodeCount:{}", groupId, timestamp, nodeIdList); + log.info("start updateTimestampNodeIdList groupId:{} nodeCount:{}|{}", groupId, timestamp, nodeIdList); this.groupMapper.updateTimestampNodeList(groupId, timestamp,JsonTools.toJSONString(nodeIdList)); } @@ -1120,6 +1120,8 @@ public void updateTimestampNodeIdList(int groupId, long timestamp,List n public TbGroup insertIfNew(int groupId, int nodeCount, String groupDesc, GroupType groupType, GroupStatus groupStatus, Integer chainId, String chainName) { + log.info("insertIfNew insert group {}|{}|{}|{}|{}|{}|{}", + groupId, nodeCount, groupDesc, groupType, groupStatus, chainId, chainName); TbGroup group = this.groupMapper.getGroupByChainIdAndGroupId(chainId,groupId); if (group != null) { return group;