Spring Cloud Config 端口冲突 [英] Spring Cloud Config port conflict
问题描述
我开始在这里使用 spring 云代码:https://github.com/spring-cloud/spring-cloud-config
I started playing around with the spring cloud code here: https://github.com/spring-cloud/spring-cloud-config
我尝试在同一台主机上运行服务器和客户端.但是,我不断收到一个错误(如下),声称该地址已被使用.服务器默认应该运行在8888端口,那么客户端和服务器是不是不能运行在同一台主机上呢?我基本上是想回答这个问题,但我在途中遇到了这个端口问题:Spring-Cloud 配置服务器忽略配置属性文件
and I tried to run the server and client on the same host. However I keep getting an error (below) which claims that the address is already in use. The server should run on port 8888 by default, so is it not possible for both the client and the server to run on the same host? I'm basically trying to answer this question, but I'm running into this port problem on the way: Spring-Cloud configuration server ignores configuration properties file
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:414)
at sun.nio.ch.Net.bind(Net.java:406)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:737)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:471)
at org.apache.coyote.http11.Http11NioProtocol.start(Http11NioProtocol.java:80)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:237)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEm
beddedServletContainer.java:194)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.ja
va:155)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplic
ationContext.java:272)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.jav
a:132)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
at sample.Application.main(Application.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:408)
at java.lang.Thread.run(Thread.java:745)
推荐答案
我在使用 Spring Boot 1.8 版和 Spring Cloud M2 时遇到了同样的问题.使用 Spring Boot 1.2.0.RC2 和 Spring Cloud 版本 1.0.0.M3,端口问题似乎消失了
I had the same issue with Spring Boot version 1.8 and M2 of Spring Cloud. With Spring Boot 1.2.0.RC2 and Spring Cloud version 1.0.0.M3 the port problem seems to be gone
这篇关于Spring Cloud Config 端口冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!