diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index e63e7c4417..e23664306f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: 172.22.76.12:5000/epmet-cloud-master/epmet-user-server:0.3.225 + image: 172.22.76.12:5000/epmet-cloud-master/epmet-user-server:0.3.226 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java index 6a741f0338..6f90b55f0a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java @@ -8,6 +8,7 @@ package com.epmet; +import com.epmet.util.MySequence; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/MySequence.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/util/MySequence.java similarity index 91% rename from epmet-user/epmet-user-server/src/main/java/com/epmet/MySequence.java rename to epmet-user/epmet-user-server/src/main/java/com/epmet/util/MySequence.java index a0e5cebf60..776f3dba5d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/MySequence.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/util/MySequence.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.epmet; +package com.epmet.util; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.SystemClock; +import com.epmet.commons.tools.utils.HttpClientManager; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.LogFactory; @@ -82,7 +83,9 @@ public class MySequence { public MySequence() { this.datacenterId = getDatacenterId(maxDatacenterId); this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); - log.info("MySequence datacenterId:"+this.datacenterId+";workerId:"+this.workerId); + String msg = "MySequence datacenterId:" + this.datacenterId + ";workerId:" + this.workerId; + log.info(msg); + HttpClientManager.getInstance().sendAlarmMsg(msg); } /** @@ -107,7 +110,9 @@ public class MySequence { StringBuilder mpid = new StringBuilder(); mpid.append(datacenterId); String name = ManagementFactory.getRuntimeMXBean().getName(); - log.info("MySequence getMaxWorkerId name:"+name); + String msg = "MySequence getMaxWorkerId name:" + name; + log.info(msg); + HttpClientManager.getInstance().sendAlarmMsg(msg); if (StringUtils.isNotBlank(name)) { /* * GET jvmPid @@ -128,7 +133,9 @@ public class MySequence { try { InetAddress ip = InetAddress.getLocalHost(); NetworkInterface network = NetworkInterface.getByInetAddress(ip); - log.info("MySequence ip:"+JSON.toJSONString(ip)+";network: "+JSON.toJSONString(network)); + String msg = "MySequence ip:" + JSON.toJSONString(ip) + ";network: " + JSON.toJSONString(network); + log.info(msg); + HttpClientManager.getInstance().sendAlarmMsg(msg); if (network == null) { id = 1L; log.info("MySequen cenetwork ==null ");