dubboe版本2.7.1

spring cloud alibaba最新官网examples

根据readme中说明文档依次启动

1、nacos,默认用户名密码nacos/nacos

2、启动spring-cloud-dubbo-server-sample,此时可以在nacos中看到发布的服务

3、启动spring-cloud-dubbo-server-sample,此处控制台会输出如下异常信息

2019-05-06 17:03:47.991 ERROR 27988 --- [           main] org.apache.dubbo.qos.server.Server       :  [DUBBO] qos-server can not bind localhost:22222, dubbo version: 2.7.1, current host: xxxxxxxxx

java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_77]
at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_77]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_77]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1332) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:984) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:258) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.33.Final.jar:4.1.33.Final]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_77]

意思就说22222这个端口已经占用了,因为在执行步骤2的时候就默认已经使用22222端口,所有在启动步骤3的时候就会出现端口被占用的情况,此异常不会影响服务的正常使用,只是qos(qos是Dubbo的在线运维命令)不能使用了。具体qos使用自行了解。

解决办法:

1、启动时添加jvm参数,不推荐

-Ddubbo.application.qos.enable=true
-Ddubbo.application.qos.port=33333
-Ddubbo.application.qos.accept.foreign.ip=false

3、spring boot应用可以在application.properties或者application.yaml中配置上述配置:

application.properties:

dubbo.application.qos.enable=true
dubbo.application.qos.port=33333
dubbo.application.qos.accept.foreign.ip=false

application.yaml,注意下面的配置不是

application:
qos:
port: 33333
enable: true
accept-foreign-ip: false

PS: 网上很多说的配置要是是qosPort=xxxx,或者是qos-port=xxxx,都是不起作用的,如果用的yaml的配置方式,只能是上述的配置方式,虽然在idea会提示不能解决properties类型。

通过org.apache.dubbo.qos.protocol.QosProtocolWrapper中解析的配置如下可以正式加载方式:

private void startQosServer(URL url) {
try {
if (!hasStarted.compareAndSet(false, true)) {
return;
} boolean qosEnable = url.getParameter("qos.enable", true);
if (!qosEnable) {
this.logger.info("qos won't be started because it is disabled. Please check dubbo.application.qos.enable is configured either in system property, dubbo.properties or XML/spring-boot configuration.");
return;
} int port = url.getParameter("qos.port", 22222);
boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter("qos.accept.foreign.ip", "false"));
Server server = Server.getInstance();
server.setPort(port);
server.setAcceptForeignIp(acceptForeignIp);
server.start();
} catch (Throwable var6) {
this.logger.warn("Fail to start qos server: ", var6);
} }

默认加载的就是qos.port属性。

参考:https://blog.csdn.net/chao_1990/article/details/89886880

ERROR qos-server can not bind localhost:22222的更多相关文章

  1. [DUBBO] qos-server can not bind localhost:22222错误解决

    问题描述 在启动dubbo-consumer工程时报错,信息如下: 2019-11-29 09:22:18.001 ERROR [RMI TCP Connection(2)-127.0.0.1] [o ...

  2. qos-server can not bind localhost:22222, dubbo version: 2.6.0, current host: 127.0.0.1【问题解决】

    好吧,这个问题比较low,但是记录一下,以免后期遗忘. 说白了,这个问题就是端口被占用了. 问题: qos-server can not bind localhost:22222, dubbo ver ...

  3. centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysq ...

  4. mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'

    就当作自己忘记Mysql密码把,忘记密码的解决方法 一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Acce ...

  5. linux mysql -- ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid)

    转载 http://blog.csdn.net/caiyaodeng/article/details/45937183 linux 链接mysql 报错 ERROR! The server quit ...

  6. mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    mysql中文乱码解决 mysql修改my.cnf后启动报错Starting MySQL... ERROR! The server quit without updating PID file (/v ...

  7. Starting MySQL... ERROR! The server quit without updating PID file (/home/mysql-5.6.43/data/localhost.localdomain.pid).

    启动MySQL出现如下错误 May :: localhost mysqld: Starting MySQL... ERROR! The server quit without updating PID ...

  8. Mac Mysql mysql_secure_installation Error: Access denied for user 'root'@'localhost' (using password: YES)

    mysql由brew安装, 期间好像自动更新了一次 然后再次执行mysql_secure_installation, 输入root密码后报错, 重装mysql还是不行 Error: Access de ...

  9. MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解决办法

    MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解决办法 1 问题 [root@localhost m ...

随机推荐

  1. StringJoiner 源码阅读

    StringJoiner 属性说明 /** * StringJoiner 使用指定的分割符将多个字符串进行拼接,并可指定前缀和后缀 * * @see java.util.stream.Collecto ...

  2. linux之gzip命令

    命令格式: gzip [选项] 压缩(解压缩)的文件名 参数: -d 将压缩文件解压. -l  对每个压缩文件,显示压缩文件的大小,未压缩文件的大小,压缩比,未压缩文件的名字 -v 对每一个压缩和解压 ...

  3. flask 学习(四)

    最近在学“数据库配置”这一部分,试着运行示例5-1的程序时解释器提示出错: $\venv\lib\site-packages\flask_sqlalchemy\__init__.py:800: U s ...

  4. python 中 __dict__函数的使用

    class F: def __init__(self, name, age): self.name = name self.age = age obj = F('tom', 20)s = obj.__ ...

  5. 2019CVPR:Classification-Reconstruction Learning for Open-Set Recogition(Abstract)

    Abstract Open-set classification is a problem of handling 'unknown' classes that are not contained i ...

  6. 【HANA系列】【第六篇】SAP HANA XS使用JavaScript(JS)调用存储过程(Procedures)

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列][第六篇]SAP HANA XS ...

  7. 461. 汉明距离(Hamming Distance)leetcode

    首先附上题目链接: https://leetcode-cn.com/problems/hamming-distance/ 一:题目 两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目. ...

  8. IE11兼容IE8的设置

    我们在使用ie11浏览器的时候,有些网站的兼容性不是太好,这个时候就要设置下ie11的兼容性了.那么ie11浏览器怎么设置兼容IE8呢?下面就让小编给大家介绍一下吧. 首先我们打开电脑里面的ie11浏 ...

  9. 【Linux开发】linux设备驱动归纳总结(三):7.异步通知fasync

    linux设备驱动归纳总结(三):7.异步通知fasync xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...

  10. 生成一个水平+垂直居中的div

    这是前端布局经常用到的布局方式,水平垂直居中:面试也经常会问到. 一. 绝对定位实现居中 注意:使用绝对定位布局的时候,外层元素必须也设置有position属性,具体设置为什么值看具体情况.只要不是s ...