x-namespace来支持命名空间的隔离。当有客户端的请求到达服务端,服务端将检查这个 header:default。ns1下注册服务EUREKA-DEMO-PROVIDER的一个实例,实例端口为18081。curl -X 'POST' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Content-type: application/json" \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-d '{"instance": {"instanceId": "10.91.80.100:eureka-demo-provider:18081","hostName": "10.91.80.100","app": "EUREKA-DEMO-PROVIDER","ipAddr": "10.91.80.100","status": "UP","overriddenStatus": "UNKNOWN","port": {"$": 18081,"@enabled": "true"},"securePort": {"$": 443,"@enabled": "false"},"countryId": 1,"dataCenterInfo": {"@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo","name": "MyOwn"},"leaseInfo": {"renewalIntervalInSecs": 30,"durationInSecs": 90,"registrationTimestamp": 0,"lastRenewalTimestamp": 0,"evictionTimestamp": 0,"serviceUpTimestamp": 0},"metadata": {"management.port": "18081"},"homePageUrl": "http://10.91.80.100:18081/","statusPageUrl": "http://10.91.80.100:18081/actuator/info","healthCheckUrl": "http://10.91.80.100:18081/actuator/health","vipAddress": "EUREKA-DEMO-PROVIDER","secureVipAddress": "EUREKA-DEMO-PROVIDER","isCoordinatingDiscoveryServer": "false","lastUpdatedTimestamp": "1681266990026","lastDirtyTimestamp": "1681266990889"}}' \\-v
ns2下注册服务EUREKA-DEMO-PROVIDER的一个实例,实例端口为18082。curl -X 'POST' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Content-type: application/json" \\-H "Accept: application/json" \\-H "x-namespace: ns2" \\-d '{"instance": {"instanceId": "10.91.80.100:eureka-demo-provider:18082","hostName": "10.91.80.100","app": "EUREKA-DEMO-PROVIDER","ipAddr": "10.91.80.100","status": "UP","overriddenStatus": "UNKNOWN","port": {"$": 18082,"@enabled": "true"},"securePort": {"$": 443,"@enabled": "false"},"countryId": 1,"dataCenterInfo": {"@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo","name": "MyOwn"},"leaseInfo": {"renewalIntervalInSecs": 30,"durationInSecs": 90,"registrationTimestamp": 0,"lastRenewalTimestamp": 0,"evictionTimestamp": 0,"serviceUpTimestamp": 0},"metadata": {"management.port": "18082"},"homePageUrl": "http://10.91.80.100:18082/","statusPageUrl": "http://10.91.80.100:18082/actuator/info","healthCheckUrl": "http://10.91.80.100:18082/actuator/health","vipAddress": "EUREKA-DEMO-PROVIDER","secureVipAddress": "EUREKA-DEMO-PROVIDER","isCoordinatingDiscoveryServer": "false","lastUpdatedTimestamp": "1681266990026","lastDirtyTimestamp": "1681266990889"}}' \\-v
ns1下EUREKA-DEMO-PROVIDER的实例。curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v## 返回18081端口实例
ns2下EUREKA-DEMO-PROVIDER的实例。curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Accept: application/json" \\-H "x-namespace: ns2" \\-v## 返回18082端口实例
curl -X 'POST' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Content-type: application/json" \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-d '{"instance": {"instanceId": "10.91.80.100:eureka-demo-provider:18081","hostName": "10.91.80.100","app": "EUREKA-DEMO-PROVIDER","ipAddr": "10.91.80.100","status": "UP","overriddenStatus": "UNKNOWN","port": {"$": 18081,"@enabled": "true"},"securePort": {"$": 443,"@enabled": "false"},"countryId": 1,"dataCenterInfo": {"@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo","name": "MyOwn"},"leaseInfo": {"renewalIntervalInSecs": 30,"durationInSecs": 90,"registrationTimestamp": 0,"lastRenewalTimestamp": 0,"evictionTimestamp": 0,"serviceUpTimestamp": 0},"metadata": {"management.port": "18081"},"homePageUrl": "http://10.91.80.100:18081/","statusPageUrl": "http://10.91.80.100:18081/actuator/info","healthCheckUrl": "http://10.91.80.100:18081/actuator/health","vipAddress": "EUREKA-DEMO-PROVIDER","secureVipAddress": "EUREKA-DEMO-PROVIDER","isCoordinatingDiscoveryServer": "false","lastUpdatedTimestamp": "1681266990026","lastDirtyTimestamp": "1681266990889"}}' \\-v
curl -X 'PUT' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081' \\-H "x-namespace: ns1" \\-v
curl -X 'DELETE' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081' \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps/delta' \\-H "Accept: application/json" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/instance/10.91.80.100:eureka-demo-provider:18081' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/vips/EUREKA-DEMO-PROVIDER' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'GET' 'http://127.0.0.1:8761/eureka/svips/EUREKA-DEMO-PROVIDER' \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-v
curl -X 'PUT' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081/status' \\-H "x-namespace: ns1" \\-v
curl -X 'DELETE' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081/status' \\-H "x-namespace: ns1" \\-v
curl -X 'PUT' 'http://127.0.0.1:8761/eureka/apps/EUREKA-DEMO-PROVIDER/10.91.80.100:eureka-demo-provider:18081/metadata?k=v' \\-H "x-namespace: ns1" \\-v
curl -X 'POST' 'http://127.0.0.1:8761/eureka/peerreplication/batch' \\-H "Content-type: application/json" \\-H "Accept: application/json" \\-H "x-namespace: ns1" \\-d '{"replicationList":[{"appName": "EUREKA-DEMO-PROVIDER","id": "10.91.80.100:eureka-demo-provider:18081","lastDirtyTimestamp": 1681266990889,"overriddenStatus": "UNKNOWN","status": "UP","instanceInfo": {"instanceId": "10.91.80.100:eureka-demo-provider:18081","hostName": "10.91.80.100","app": "EUREKA-DEMO-PROVIDER","ipAddr": "10.91.80.100","status": "UP","overriddenStatus": "UNKNOWN","port": {"$": 18081,"@enabled": "true"},"securePort": {"$": 443,"@enabled": "false"},"countryId": 1,"dataCenterInfo": {"@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo","name": "MyOwn"},"leaseInfo": {"renewalIntervalInSecs": 30,"durationInSecs": 90,"registrationTimestamp": 0,"lastRenewalTimestamp": 0,"evictionTimestamp": 0,"serviceUpTimestamp": 0},"metadata": {"management.port": "18081"},"homePageUrl": "http://10.91.80.100:18081/","statusPageUrl": "http://10.91.80.100:18081/actuator/info","healthCheckUrl": "http://10.91.80.100:18081/actuator/health","vipAddress": "EUREKA-DEMO-PROVIDER","secureVipAddress": "EUREKA-DEMO-PROVIDER","isCoordinatingDiscoveryServer": "false","lastUpdatedTimestamp": "1681266990026","lastDirtyTimestamp": "1681266990889"},"action": "Register"}]}' \\-v
文档反馈