欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mq启动异常

程序员文章站 2022-03-23 16:46:38
...
org.apache.rocketmq.client.exception.MQClientException: No name server address, please set it.
See http://rocketmq.apache.org/docs/faq/ for further details.
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:558)
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1058)
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1017)
	at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:208)
	at org.apache.rocketmq.example.quickstart.Producer.main(Producer.java:67)
org.apache.rocketmq.client.exception.MQClientException: No name server address, please set it.
See http://rocketmq.apache.org/docs/faq/ for further details.
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:558)
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1058)
	at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1017)

修改一下/etc/profile 增加 export NAMESRV_ADDR=localhost:9876

然后重启一下profile  关掉一下mqnames 和mqbrokers 在启动

启动mqnamesrv

nohup sh bin/mqnamesrv &

启动broker时。。

 nohup sh mqbroker -n 192.168.197.139:9876 autoCreateTopicEnable=true > ~/logs/rocketmqlogs/broker.log 2>&1 &

就可以了。

执行一下发送数据

[aaa@qq.com rocketmq]# sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
02:18:03.971 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
02:18:03.977 [main] DEBUG i.n.c.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 4
02:18:03.988 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
02:18:03.988 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
02:18:03.989 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
02:18:03.989 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: true
02:18:03.990 [main] DEBUG i.n.util.internal.PlatformDependent - Java version: 8
02:18:03.990 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noUnsafe: false
02:18:03.990 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
02:18:03.990 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noJavassist: false
02:18:04.093 [main] DEBUG i.n.util.internal.PlatformDependent - Javassist: available
02:18:04.093 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
02:18:04.093 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
02:18:04.093 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
02:18:04.111 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
02:18:04.112 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
02:18:04.167 [MQClientFactoryScheduledThread] DEBUG i.n.util.internal.ThreadLocalRandom - -Dio.netty.initialSeedUniquifier: 0x8e19777279445df9 (took 7 ms)
02:18:04.200 [MQClientFactoryScheduledThread] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: unpooled
02:18:04.201 [MQClientFactoryScheduledThread] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 65536
02:18:04.201 [MQClientFactoryScheduledThread] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
02:18:04.226 [NettyClientSelector_1] DEBUG i.n.u.i.JavassistTypeParameterMatcherGenerator - Generated: io.netty.util.internal.__matchers__.org.apache.rocketmq.remoting.protocol.RemotingCommandMatcher
02:18:04.240 [MQClientFactoryScheduledThread] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacity.default: 262144
02:18:04.245 [NettyClientWorkerThread_1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.bytebuf.checkAccessible: true
02:18:04.246 [NettyClientWorkerThread_1] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
02:18:04.246 [NettyClientWorkerThread_1] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.maxRecords: 4
02:18:04.323 [NettyClientSelector_1] DEBUG io.netty.util.internal.Cleaner0 - java.nio.ByteBuffer.cleaner(): available
SendResult [sendStatus=SEND_OK, msgId=C0A8C5880C683D4EAC69437114DC0000, offsetMsgId=C0A8C58800002A9F0000000000008E4E, messageQueue=MessageQueue [topic=TopicTest, brokerName=localhost.localdomain, queueId=3], queueOffset=51]
SendResult [sendStatus=SEND_OK, msgId=C0A8C5880C683D4EAC694371153D0001, offsetMsgId=C0A8C58800002A9F0000000000008F00, messageQueue=MessageQueue [topic=TopicTest, brokerName=localhost.localdomain, queueId=0], queueOffset=51]
SendResult [sendStatus=SEND_OK, msgId=C0A8C5880C683D4EAC69437115570002, offsetMsgId=C0A8C58800002A9F0000000000008FB2, messageQueue=MessageQueue [topic=TopicTest, brokerName=localhost.localdomain, queueId=1], queueOffset=50]
SendResult [sendStatus=SEND_OK, msgId=C0A8C5880C683D4EAC694371155A0003, offsetMsgId=C0A8C58800002A9F0000000000009064, messageQueue=MessageQueue [topic=TopicTest, brokerName=localhost.localdomain, queueId=2], queueOffset=51]
SendResult [sendStatus=SEND_OK, msgId=C0A8C5880C683D4EAC694371155D0004, offsetMsgId=C0A8C58800002A9F0000000000009116, messageQueue=MessageQueue [topic=TopicTest, brokerName=localhost.localdomain, queueId=3], queueOffset=52]

 

---------------------------------------------------------------

 

nohup sh mqbroker -n localhost:9876 -c ./conf/2m-noslave/broker-a.properties &

mq启动异常

相关标签: mq