色空大师 2023-11-22 16:14 采纳率: 42.3%
浏览 2
已结题

eureka服务端显示客户端时多了英文单词

服务注册到eureka时ip变成了字母

写了eureka服务,将几个服务注册到eureka后,页面显示如下

img


请问:为啥会多出这几个英文单词呢
我的eureka服务
pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>eureka-server01</artifactId>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.5.RELEASE</version>
        <relativePath/>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
            <version>2.2.3.RELEASE</version>
        </dependency>
    </dependencies>
</project>

配置文件

server:
  port: 7090
spring:
  application:
    name: eureka-server
eureka:
  client:
    service-url:
      defaultZone: http://localhost:7090/eureka
    fetch-registry: false
    register-with-eureka: false
  server:
    enable-self-preservation: false # 关闭自我保护
    eviction-interval-timer-in-ms: 5000 # 每隔5秒进行一次服务列表清理

eureka客户端的配置文件

server:
  port: 7091
spring:
  application:
    name: user-service1
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/user?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
    username: root
    password: root


mybatis-plus: #显示sql日志
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
eureka:
  client:
    service-url:
      defaultZone: http://localhost:7090/eureka

之前启动的时候是正常的,突然就这样了,一头雾水

  • 写回答

2条回答 默认 最新

  • 皮蛋不吃粥 2023-11-22 16:51
    关注

    设置一下hostname,有个instance_id可以设置status的名字

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 12月1日
  • 已采纳回答 11月23日
  • 创建了问题 11月22日