mq启动异常

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 &

就可以了。

执行一下发送数据

[root@localhost 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 &

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值