ProgrammerAH

Programmer Guide, Tips and Tutorial

Skip to content

[Solved] Rocketmq Root Account Startup Error: Permission denied

Specific information

Modify the JVM size in/bin/runserver.sh and/bin/runbroker.sh to 256M
and then command nohup sh bin/mqnamesrv &, check nohup.Out and find the error permission denied . I checked on the Internet and said that non root users cannot use ports below 1000, but what does this have to do with my rocketmq.

// error
java.net.SocketException: Permission denied
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:461)
        at sun.nio.ch.Net.bind(Net.java:453)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:127)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:501)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1218)
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:965)
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:210)
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:353)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:408)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:455)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
        at java.lang.Thread.run(Thread.java:748)

Error reason

The reason for the error is that the Hyper-V function (Windows subsystem) is enabled on the computer and some ports are disabled. Specific view

Windows CMD enter the following command

netsh interface ipv4 show excludedportrange protocol=tcp

//After querying, there will be the following unavailable port range, including 9876, which makes the port unavailable, instead of the common non root account unable to use ports below 1000

 Protocol tcp port exclusion range
 Start port End port
   1064        1163
   1364        1463
   1464        1563
   1564        1663
   2501        2600
   2801        2900
   2901        3000
   3001        3100
   5357        5357
   7639        7738
   7739        7838
   9834        9933
  10034       10133
  10241       10340
  10341       10440
  10441       10540
  10541       10640
  12066       12165
  12166       12265
  50000       50059     
  Managed port exclusion.

Other Solution:

Modify the port used by rocketmq to port 9950

Project directory: /software/rocketmq

Create a namesrv.properties file in the /conf directory

The content is listenPort=9950

server startup script start-server.sh

nohup sh /software/rocketmq/bin/mqnamesrv -c /software/rocketmq/conf/namesrv.properties &> ./server.log 2>&1

broker startup script start-broker.sh

nohup sh /software/rocketmq/bin/mqbroker -n localhost:9950 &> ./broker.log 2>&1

This entry was posted in JAVA and tagged java, rocketmq, Rocketmq Root Account Startup Error, Strange questions on 2021-11-08 by Robins.

Post navigation

← Oracle monitoring error tns-01189 [How to Solve] [Solved] Odoo Cannot log in error after the Database is Recovered →

Recent Posts

  • MAFIA: 1- OpenFlow statistics (Counters, Timestamps)(mafia-sdn/p4demos/demos/1-openflow/1.1-statistics/p4src/of.p4)
  • LDSC: Could not open Corces_ATAC_1000Gv3_ldscores/Corces_ATAC.1.1.l2.ldscore[./gz/bz2]
  • Gradle Package Project Lombok Not Working: No serializer found for class com.qbb.User and no properties discovered to create BeanSerializer……
  • [Solved] PCH Warning: header stop not at file scope
  • pymysql Error: File “/usr/local/lib/python2.7/site-packages/PyMySQL-1.0.2-py2.7.egg/pymysql/connections.py”, line 167 SyntaxError: invalid syntax
Proudly powered by WordPress