dubbo在虚拟机中执行命令启动服务提供者显示成功,查看日志发现报错

在master中执行[root@master bin]# sh start-db.sh后,显示:
SERVER_PROTOCOL=dubbo
SERVER_PORT=20880
LOGS_FILE=/tmp/dubbo.log
STDOUT_FILE=/tmp/stdout.log
Starting the dubbo-provider ....OK!
PID: 2886
STDOUT: /tmp/stdout.log

到tmp下查看stdout.log后发现报错如下:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:356)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2502)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2539)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2321)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:832)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:417)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148)
at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1360)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1414)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:602)
......
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.(Socket.java:425)
at java.net.Socket.(Socket.java:241)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:258)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:306)
... 81 more
[ERROR] 2016-09-08 02:19:49 DruidDataSource@(DruidDataSource.java:629):dataSource init error
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

是哪里配置的问题么?

1个回答

你确定是dubbo的问题吗,他报错jdbc

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
springBoot整合dubbo的能否配置在消费先启动后再启动提供者能让服务注入进去。

![就像这时候在提供者还未启动时,这个对象是空的就算后面dubbo检查到提供者以启动了,但是这个消费者还是空的没办法注入值](https://img-ask.csdn.net/upload/201709/30/1506759230_72813.png) 就像这时候在提供者还未启动时,这个对象是空的就算后面dubbo检查到提供者以启动了,但是这个消费者还是空的没办法注入值. 这样就有了个启动顺序在。运维那群人就不想(#><)

dubbo中服务提供者和消费者在一个应用中也是远程调用吗?

标准springboot代码,接口实现类上标注@Service注解,controller引用则标注@Autowired自动注入,controller和service在一个应用中。 1、现在要引入dubbo,那么接口实现类上加Dubbo的@Service注解,原来的springboot的注解还保留吗? 2、在调用的地方,如果把@Autowired换成dubbo的@Reference,提供者和消费者在一个应用中,是直接调用还是走rpc呢? 3、部署应用时,根据资源情况,有可能实现类和调用打包到一个应用中,也可能打包到不同应用中走rpc调用,是否调用处同时标注springboot的@Autowired和dubbo的@Reference呢?总之,我希望代码不动能同时支持两种情况,谢谢!

springmvc+dubbo 启动过程几点问题,求解答

springmvc中引入dubbo的配置文件后,在启动web容器的时候会加载dubbo的配置文件 并由dubbo的解释器进行解析xml配置,装配到spring容器,问题来了,问题1:我并没有启动dubbo的服务,dubbo是怎么启动的?问题2:dubbo的启动是通过com.alibaba.dubbo.container.Main中的main方法启动的,源码中是在main方法中又启动了一个SpringContainer,这里的Main是谁来调用的?问题3:以上过程中是不是启动了两spring容器?

dubbo可以指定服务提供者吗?

我们测试环境经常会有人一不小心把本地的服务注册上去,出现了多个提供者,其中本地的提供者和测试环境的提供者有区别,导致开发时出现时好时坏的情况。所以希望可以指定提供者的IP。 思路有负载均衡策略、禁止注册提供者等,但研究了下没找到该怎么做

往虚拟机上装一个dubbo服务,启动的时候一直停在Starting the localhost.localdomain...

如题... 往虚拟机上装一个dubbo服务 启动的时候一直停在Starting the localhost.localdomain... 使用eclispse maven assembly打包的 在windows上能正常运行 放到虚拟机上就不行了 ![图片说明](https://img-ask.csdn.net/upload/201909/10/1568112580_468194.png)

dubbo中服务提供者能在程序运行途中注册服务吗

比如说zookeeper全部挂掉了,此时我有一个新服务提供者启动了,这时候注册不上去,那zookeeper重启后,这个服务能注册上去吗,同样的情况eureka呢

新手使用dubbo,启动tomcat后无报错,访问页面为什么是这样的

页面如图:![图片说明](https://img-ask.csdn.net/upload/201809/18/1537271766_672802.png) 页面源码是正常的 ![图片说明](https://img-ask.csdn.net/upload/201809/18/1537271775_662924.png) tomcat只有一个警告: Setting property 'source' to 'org.eclipse.jst.jee.server:ycslypt_web' did not find a matching property.

dubbo消费者测试启动报错

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springservice': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.mixky.dubbo.dubbo_mid.IDemo. No provider available for the service com.mixky.dubbo.dubbo_mid.IDemo:1.0.0 from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo_consumer&dubbo=2.5.3&interface=com.mixky.dubbo.dubbo_mid.IDemo&methods=sayHello&pid=13084&revision=1.0.0&side=consumer&timestamp=1498285528059&version=1.0.0 to the consumer 192.168.0.184 use dubbo version 2.5.3 at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:151) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:252) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:973) at com.mixky.dubbo.dubbo_customer.ClientDemo.main(ClientDemo.java:15) Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.mixky.dubbo.dubbo_mid.IDemo. No provider available for the service com.mixky.dubbo.dubbo_mid.IDemo:1.0.0 from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo_consumer&dubbo=2.5.3&interface=com.mixky.dubbo.dubbo_mid.IDemo&methods=sayHello&pid=13084&revision=1.0.0&side=consumer&timestamp=1498285528059&version=1.0.0 to the consumer 192.168.0.184 use dubbo version 2.5.3 at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420) at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300) at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138) at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:144) ... 6 more

zookeeper+dubbo+tomcat启动tomcat失败

1、启动时显示的日志 INFO logger.LoggerFactory - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter ERROR common.Version - [DUBBO] Duplicate class com/alibaba/dubbo/common/Version.class in 2 jar [file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-2.8.3.jar!/com/alibaba/dubbo/common/Version.class, file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-common-2.8.3.jar!/com/alibaba/dubbo/common/Version.class], dubbo version: 2.8.3, current host: 127.0.0.1 ERROR common.Version - [DUBBO] Duplicate class com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class in 2 jar [file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-2.8.3.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class, file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-config-spring-2.8.3.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class], dubbo version: 2.8.3, current host: 127.0.0.1 INFO config.PropertyPlaceholderConfigurer - Loading properties file from Resource[/WEB-INF/dubbo.properties, loaded by ResourceLoadingService] INFO config.PropertyPlaceholderConfigurer - Loading properties file from URL [file:/home/rdc/dubbo.properties] WARN config.PropertyPlaceholderConfigurer - Could not load properties from URL [file:/home/rdc/dubbo.properties]: /home/rdc/dubbo.properties (No such file or directory) INFO config.WebxConfiguration - Application is running in Production Mode. INFO upload.UploadService - Upload Parameters: { Repository Path = /data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/temp Maximum Request Size = 5M Maximum File Size = n/a Threshold before Writing to File = 10K Keep Form Field in Memory = false File Name Key = [ [1/1] filename ] } INFO context.WebxComponentsContext - Bean '(inner bean)#28fca922' of type [class com.alibaba.citrus.springext.util.SpringExtUtil$ConstructorArg] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'dubbo-admin' of type [class com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'com.alibaba.dubbo.config.RegistryConfig' of type [class com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'registryService' of type [class com.alibaba.dubbo.config.spring.ReferenceBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean '(inner bean)#28fca922' of type [class com.alibaba.citrus.webx.config.impl.WebxConfigurationImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@7eb88bc8: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,templateService,mappingRuleService,dataResolverService,exceptionPipeline,resourceLoadingService,messageSource,uriBrokerService,restfulRewrite,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dubbo-admin,com.alibaba.dubbo.config.RegistryConfig,registryService,configService,consumerService,overrideService,ownerService,providerService,routeService,userService,governanceCache,productionModeSensiblePostProcessor,webxConfiguration,requestContexts,com.alibaba.citrus.service.requestcontext.impl.RequestContextBeanFactoryPostProcessor#0,uploadService,pullService,formService,module.screen.Error404,module.screen.ErrorOther,moduleLoaderService,messageResourceService,com.alibaba.citrus.webx.context.WebxComponentsLoader$WebxComponentsCreator,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/common/' INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled INFO zkclient.ZkEventThread - Starting ZkClient event thread. 请问这是什么情况?大神。。。。。

关于在tomcat中启动dubbo

https://www.cnblogs.com/qingdaofu/p/7214547.html 这是我看的教程网站,为什么我把war放到webapp下以后启动只能访问tomcat的主页 而不能访问dubbo的求解。弄了一晚上了 ![图片说明](https://img-ask.csdn.net/upload/201804/14/1523669831_197484.jpg) ![图片说明](https://img-ask.csdn.net/upload/201804/14/1523669863_686400.jpg) ![图片说明](https://img-ask.csdn.net/upload/201804/14/1523669918_803930.jpg) ![图片说明](https://img-ask.csdn.net/upload/201804/14/1523669878_438260.jpg)

zookeeper没有启动,启动dubbo为什么不报异常

zookeeper没有启动的情况下,启动dubbo提供者为什么不报异常?应该怎么解决呢? (按理说应该是要报连接异常的啊!) [图片说明](https://img-ask.csdn.net/upload/201805/12/1526097786_473454.jpg)

Nacos+dubbo提供者与消费者不在同一机器上

各位大佬好,我想把dubbo服务提供者部署到阿里云上,然后在本地运行服务消费者,试了好多网上的方法,都不管用。阿里的安全组也放行了。 我用docker-compose部署的,而且设置了ip与端口,配置如下: (我也试过docker-compose中不配置environment,不行。) ``` version: '3.1' services: provider-ucenter: build: ./provider-ucenter/ image: provider-ucenter:1.0.0 restart: always container_name: provider-ucenter environment: DUBBO_IP_TO_REGISTRY: 39.105.137.237 DUBBO_PORT_TO_REGISTRY: 8500 ports: - "8500:8500" provider-message: build: ./provider-message/ image: provider-message:1.0.0 restart: always container_name: provider-message environment: DUBBO_IP_TO_REGISTRY: 39.105.137.237 DUBBO_PORT_TO_REGISTRY: 8530 ports: - "8530:8530" ``` 运行后,nacos控制台显示服务均上线: ![图片说明](https://img-ask.csdn.net/upload/202003/22/1584872505_718997.png) 而且各服务的IP,端口都正确,如userservice: ![图片说明](https://img-ask.csdn.net/upload/202003/22/1584872605_649558.png) 然后,我在本地跑服务消费者,报错: ``` org.apache.dubbo.remoting.RemotingException: client(url: dubbo://39.105.137.237:8500/com.supermarket.manage.provider.api.ucenter.UserService?anyhost=true&application=business-cloud&bean.name=ServiceBean:com.supermarket.manage.provider.api.ucenter.UserService:1.0.0&category=providers&check=false&codec=dubbo&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&heartbeat=60000&interface=com.supermarket.manage.provider.api.ucenter.UserService&lazy=false&methods=getCountByPhone,getUserByUsername,bindPhone,updatePasswordById,getCountByUsername,insertUser,updateUserById,untiePhone,getUsernameByUserId,userLoginByUsername,getUserByUserId,getUserByBuyerId,register&path=com.supermarket.manage.provider.api.ucenter.UserService&pid=3176&protocol=dubbo&qos.enable=false&register=true&register.ip=192.168.18.1&release=2.7.3&remote.application=provider-ucenter&revision=1.0.0&serialization=kryo&side=consumer&sticky=false&timeout=5000&timestamp=1584871255294&version=1.0.0) failed to connect to server /39.105.137.237:8500, error message is:Connection refused: no further information: /39.105.137.237:8500 ``` 但是把提供者和消费者放在同一个服务器上就能成功。 请问大佬们有没有什么好的建议

zookeeper,dubbo服务注册,消费者调用为null

启动dubbo服务注册是zkdebug异常显示,node null ![图片说明](https://img-ask.csdn.net/upload/201710/23/1508747613_419774.jpg) 下面是我的dubbo配置,应该是没问题的,其他模块多事没有问题的![图片说明](https://img-ask.csdn.net/upload/201710/23/1508747748_422645.png)![图片说明](https://img-ask.csdn.net/upload/201710/23/1508747755_945005.png)麻烦各路大神帮忙看看

dubbo服务已启动,作为消费者的我调用服务端的接口,一直报错

错误如图,有没有大神解释一下这是为啥子@_@![![图片说明](https://img-ask.csdn.net/upload/201802/01/1517414531_602045.png)图片说明](https://img-ask.csdn.net/upload/201802/01/1517414523_949781.png) 附上错误信息:[DUBBO] Decode request failed: com/esotericsoftware/kryo/KryoException, dubbo version: 2.8.4, current host: 169.xxx.xxx.70 java.lang.NoClassDefFoundError: com/esotericsoftware/kryo/KryoException

Dubbo服务部署到服务器上,从本地访问服务器上的服务访问不通

<br> ### /----------原问题----------/(问题已经解决,答案在后文) <br> <br> 如题,项目使用的是dubbo+nacos,在本地上启动provider端和customer端,可以正常访问。 (provider和customer端同时部署到服务器上,也可以正常访问) 但是,把provider端部署到linux服务器上,再从本地启动customer端就访问不了,一直显示超时(两者分开部署,访问显示超时)... ``` org.apache.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer. start time: 2019-10-21 11:32:02.027, end time: 2019-10-21 11:32:12.047, client elapsed: 1 ms, server elapsed: 10018 ms, timeout: 10000 ms, request: Request [id=5, version=2.0.2, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=sayHello, parameterTypes=[], arguments=[], attachments={path=com.braisedpanda.suanfa.service.TestService, activelimit_filter_start_time=1571628722027, interface=com.braisedpanda.suanfa.service.TestService, version=1.0.0, timeout=10000}]], channel: /172.215.1.27:50876 -> /172.17.0.2:20880 at org.apache.dubbo.remoting.exchange.support.DefaultFuture.doReceived(DefaultFuture.java:189) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:153) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.remoting.exchange.support.DefaultFuture$TimeoutCheckTask.run(DefaultFuture.java:252) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449) ~[dubbo-2.7.3.jar:2.7.3] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_211] ``` 网页报错:![图片说明](https://img-ask.csdn.net/upload/201910/21/1571629077_503413.png) 配置: ![图片说明](https://img-ask.csdn.net/upload/201910/21/1571629427_901327.png) ![图片说明](https://img-ask.csdn.net/upload/201910/21/1571629436_736567.png) 部署linux:![图片说明](https://img-ask.csdn.net/upload/201910/21/1571629510_364799.png) 网上各种方法都试过了,折腾一周了还是不行, 设置timeout时间,关闭Linux防火墙,删除了连接数据的代码,直到后来我甚至怀疑服务器有问题,又租了台服务器测试还是不行....... 快要崩溃了... 希望有大佬能指出问题... <br> <br> <br> /----------以下是问题解决方案----------/ ####先说下问题出现的原因: dubbo服务部署在linux服务器上时,它默认使用的是linux系统的内网,对外暴露的是内网的地址,这就导致我本地项目访问该服务器服务时,访问不通,出现超时错误。这就解释了为什么服务端和消费端同时部署在本地,或者同时部署在服务器上时,可以畅通无阻的访问了。 ![图片说明](https://img-ask.csdn.net/upload/201910/23/1571810544_540718.png) 如图片所示,我原先注册的服务全是172开头的内网,本地访问不通。后来修改了之后,dubbo对外暴露外网,可以顺利访问。 至于如何让dubbo在linux部署时暴露外网服务,网上有很多教程,说什么修改linux hosts主机名和公网ip,修改linux DNS地址,甚至还有禁用linux网卡.. 这些我都试过了,全都没用~ 每个人的情况都不一样,可能对有些人有用 ####我的解决办法: 1、 我在项目配置中添加了: spring.cloud.nacos.discovery.ip=39.98.131.xxx (这个ip地址,是你要部署服务器的公网地址。 比如你要部署到公网地址为39.98.131.588这台服务器上, 那上面就写39.98.131.588) 2、docker 运行镜像时,添加 DUBBO_IP_TO_REGISTRY语句 ``` docker run -d -e DUBBO_IP_TO_REGISTRY=39.98.131.xxx -e DUBBO_PORT_TO_REGISTRY=20880 -p 20880:20880 --name xxx xxxx(镜像名称) ``` 这下,这个问题终于解决了,真的坑,折腾我好久了,麻蛋~ 下面贴上我的配置,仅供参考,方面同样被这个问题困扰的小伙伴早点脱困 bootstrap.yml ``` ##应用名称 spring: main: allow-bean-definition-overriding: true # profiles: # active: public cloud: nacos: discovery: enabled: true register-enabled: true server-addr: ${spring.cloud.nacos.config.server-addr} namespace: ${spring.cloud.nacos.config.namespace} config: server-addr: 47.98.135.xxx:8848 group: provider namespace: c229ab10-2e39-4444-be97-048b3a5ef49d file-extension: yaml ``` <br> application.properties ``` spring.application.name=balance-suanfa-provider dubbo.application.name=balance-suanfa-provider dubbo.scan.base-packages=com.braisedpanda.suanfa.service dubbo.protocol.name=dubbo dubbo.protocol.port=20880 #这个本地测试就注释吧,部署到服务器上时,根据服务器公网填写 #spring.cloud.nacos.discovery.ip=39.98.131.xxx dubbo.registry.address=nacos://47.98.135.xxx:8848 dubbo.provider.loadbalance=myRoundRobin #dubbo.provider.actives=8 #dubbo.provider.executes=8 dubbo.provider.dispatcher=message dubbo.provider.threadpool=cached dubbo.provider.timeout=50000 dubbo.provider.delay=-1 dubbo.application.dump-directory=/tmp dubbo.provider.cluster=failfast dubbo.consumer.check=false dubbo.registry.check=false ``` 附上两篇有用的参考连接: https://juejin.im/post/5b2072016fb9a01e2d704431 https://www.jianshu.com/p/7c29a24a917d

dubbo启动报错连接服务超时

dubbo启动会检查所有提供者,有的能调通,有的由于服务器设置不能调通。怎样设置只要有能调通的就不报错,而不是遇到调不通的就报错。求各位大神解答。。。。。。。。。。

容器启动dubbo消费者时总是提示找不到接口类,是什么原因?

这是发布成功的服务,用telnet命令可以调到: ![图片说明](https://img-ask.csdn.net/upload/201609/07/1473259441_617095.png) 这是启动消费者时报的错:接口类找不到 ![图片说明](https://img-ask.csdn.net/upload/201609/07/1473259458_82030.png) 这是消费者配置文件,(因为用main方法启动就是正确的,所以认为此配置文件是正确的) ![图片说明](https://img-ask.csdn.net/upload/201609/07/1473259427_536267.jpg)

DUBBO启动报错找不到服务

ERROR 10:16:41,178 AbstractClient:<init> - [DUBBO] Failed to start NettyClient caedmon-PC/192.168.0.234 connect to the server /60.191.124.236:21890 (check == false, ignore and retry later!), cause: client(url: dubbo://60.191.124.236:21890/com.sendinfo.ebiz3.account.server.UserServer?anyhost=true&application=wuzhen-b2c-provider&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=20000&dubbo=2.5.3&heartbeat=60000&interface=com.sendinfo.ebiz3.account.server.UserServer&methods=queryConsumerPointVo,updateAccount,queryConsumer,updateLogin,loginOut,getLogin,regConsumer,getAccount,queryLogin,updateConsumer&pid=6212&side=consumer&timeout=5000&timestamp=1425544252633) failed to connect to server /60.191.124.236:21890 client-side timeout 3000ms (elapsed: 3003ms) from netty client 192.168.0.234 using dubbo version 2.5.3, dubbo version: 2.5.3, current host: 192.168.0.234 com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://60.191.124.236:21890/com.sendinfo.ebiz3.account.server.UserServer?anyhost=true&application=wuzhen-b2c-provider&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=20000&dubbo=2.5.3&heartbeat=60000&interface=com.sendinfo.ebiz3.account.server.UserServer&methods=queryConsumerPointVo,updateAccount,queryConsumer,updateLogin,loginOut,getLogin,regConsumer,getAccount,queryLogin,updateConsumer&pid=6212&side=consumer&timeout=5000&timestamp=1425544252633) failed to connect to server /60.191.124.236:21890 client-side timeout 3000ms (elapsed: 3003ms) from netty client 192.168.0.234 using dubbo version 2.5.3 at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:127) at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:280) at com.alibaba.dubbo.remoting.transport.AbstractClient.<init>(AbstractClient.java:103) at com.alibaba.dubbo.remoting.transport.netty.NettyClient.<init>(NettyClient.java:61) at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.connect(NettyTransporter.java:37) at com.alibaba.dubbo.remoting.Transporter$Adpative.connect(Transporter$Adpative.java) at com.alibaba.dubbo.remoting.Transporters.connect(Transporters.java:67) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.connect(HeaderExchanger.java:37) at com.alibaba.dubbo.remoting.exchange.Exchangers.connect(Exchangers.java:102) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.initClient(DubboProtocol.java:378) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getSharedClient(DubboProtocol.java:344) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getClients(DubboProtocol.java:321) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.refer(DubboProtocol.java:303) at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:62) at com.alibaba.dubbo.rpc.Protocol$Adpative.refer(Protocol$Adpative.java) at com.alibaba.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:395) at com.alibaba.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:224) at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:195) at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:449) at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:273) at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:259) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.access$400(ZookeeperRegistry.java:45) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$3.childChanged(ZookeeperRegistry.java:159) at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$2.handleChildChange(ZkclientZookeeperClient.java:82) at org.I0Itec.zkclient.ZkClient$8.run(ZkClient.java:583) at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71)

dubbo发布到tomcat7之后无法访问,提示404,日志显示启动报错

发布在webapps目录下 ![图片说明](https://img-ask.csdn.net/upload/201705/26/1495762983_598664.png) 但访问报错 ![图片说明](https://img-ask.csdn.net/upload/201705/26/1495763091_616601.png) 8080可以正常访问,而且manager app下显示/dubbo的running状态为false ![图片说明](https://img-ask.csdn.net/upload/201705/26/1495763585_835885.png) 启动日志如下: May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCa che', 'org.apache.jasper.compiler.TldLocationsCache@5fdddbf6') May 26, 2017 1:10:38 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j system May 26, 2017 1:10:38 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext May 26, 2017 1:10:47 AM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class com.alibaba.citrus.webx.context.WebxContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type [com. alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo] while setting bean property 'brokers' with key [0]; nested exception is org.springfram ework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type [com.alibaba.citrus.servic e.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exc eption is org.springframework.beans.factory.BeanCreationException: Error creatin g bean with name 'server': Error setting property values; nested exception is or g.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable or has an invalid setter method. Does the pa rameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.BeanDefinitionValueResolver .resolveInnerBean(BeanDefinitionValueResolver.java:230) at org.springframework.beans.factory.support.BeanDefinitionValueResolver .resolveValueIfNecessary(BeanDefinitionValueResolver.java:122) at org.springframework.beans.factory.support.BeanDefinitionValueResolver .resolveManagedList(BeanDefinitionValueResolver.java:287) at org.springframework.beans.factory.support.BeanDefinitionValueResolver .resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) "localhost.2017-05-26.log" 362L, 43836C 1,1 Top May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 26, 2017 1:10:34 AM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5fdddbf6') May 26, 2017 1:10:38 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j system May 26, 2017 1:10:38 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext May 26, 2017 1:10:47 AM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class com.alibaba.citrus.webx.context.WebxContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type [com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo] while setting bean property 'brokers' with key [0]; nested exception is or g.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type [com.ali baba.citrus.service.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreation Exception: Error creating bean with name 'server': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcepti on: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable or has a n invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) 求大神们帮忙看看什么情况 (zookeeper已经启动了)

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

立方体线框模型透视投影 (计算机图形学实验)

计算机图形学实验 立方体线框模型透视投影 的可执行文件,亲测可运行,若需报告可以联系我,期待和各位交流

2019 AI开发者大会

2019 AI开发者大会

组成原理课程设计(实现机器数的真值还原等功能)

实现机器数的真值还原(定点小数)、定点小数的单符号位补码加减运算、定点小数的补码乘法运算和浮点数的加减运算。

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

软件测试2小时入门

软件测试2小时入门

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

计算机图形学-球的光照模型课程设计

计算机图形学-球的光照模型,有代码完美运行,有课程设计书

Linux常用命令大全(非常全!!!)

Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错。我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短小但却功能强大。我将我了解到的命令列举一下,仅供大家参考: 系统信息 arch 显示机器的处理器架构 uname -m 显示机器的处理器架构 uname -r 显示正在使用的内核版本 d...

因为看了这些书,我大二就拿了华为Offer

四年了,四年,你知道大学这四年我怎么过的么?

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

fakeLocation13.5.1.zip

fakeLocation13.5.1 虚拟定位 ios13.5.1的最新驱动下载,iPhone/iPad免越狱虚拟定位工具Location-cleaned驱动已更新

UnityLicence

UnityLicence

Python可以这样学(第一季:Python内功修炼)

Python可以这样学(第一季:Python内功修炼)

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

土豆浏览器

土豆浏览器可以用来看各种搞笑、电影、电视剧视频

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

php+mysql学生成绩管理系统

学生成绩管理系统,分三个模块:学生,教师和管理员。 管理员模块:负责学生、老师信息的增删改;发布课程信息的增删改,以便让学生选课;审核老师提交的学生成绩并且打印成绩存档;按照课号查询每个课号的学生成绩

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

推荐24个国外黄色网站欣赏

在中国清朝,明黄色的衣服只有皇子才有资格穿,慢慢的黄色在中国就成了高贵的颜色。在人们的色彩印象中,黄色也表现为暂停。所以当你的网页设计采用黄色的时候,会让人们在你的网页前停留。 黄色,就像橙色和红色,黄色也是一个暖色。它有大自然、阳光、春天的涵义,而且通常被认为是一个快乐和有希望的色彩。黄色是所有色相中最能发光的颜色,给人轻快,透明,辉煌,充满希望的色彩印象。 黄色是一个高可见的色...

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

C++语言基础视频教程

C++语言基础视频教程

玩转Python-Python3基础入门

玩转Python-Python3基础入门

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问