Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocketmq 5.1.3部署问题 #95

Open
988494 opened this issue Oct 16, 2023 · 1 comment
Open

rocketmq 5.1.3部署问题 #95

988494 opened this issue Oct 16, 2023 · 1 comment

Comments

@988494
Copy link

988494 commented Oct 16, 2023

docker-compose.yml配置为如下:

version: '3.8'
services:
  # 单机版
  rocketmq_nameserver1:
    image: apache/rocketmq:5.1.3
    container_name: rocketmq_nameserver1
    environment:
      # 时区上海
      TZ: Asia/Shanghai
      JAVA_OPT_EXT: "-server -Xms512M -Xmx512M -Xmn128m"
    ports:
      - "9876:9876"
    volumes:
      # 数据挂载
      - /opt/docker/rocketmq/logs:/home/rocketmq/logs
    command: sh mqnamesrv
    privileged: true
    restart: always
    networks:
      rocketmq-net:
        ipv4_address: 172.150.0.10

  rocketmq_broker1:
    image: apache/rocketmq:5.1.3
    container_name: rocketmq_broker1
    depends_on:
      - rocketmq_nameserver1
    environment:
      # 时区上海
      TZ: Asia/Shanghai
      NAMESRV_ADDR: rocketmq_nameserver1:9876
      JAVA_OPT_EXT: "-server -Xms512M -Xmx512M -Xmn128m"
    ports:
      - "10909:10909"
      - "10911:10911"
      - "10912:10912"
    volumes:
      # 数据挂载
      - /opt/docker/rocketmq/logs:/home/rocketmq/logs
      # 需要给 /opt/docker/rocketmq/store 设置777权限
      - /opt/docker/rocketmq/store:/home/rocketmq/store
      - /opt/docker/rocketmq/conf/broker.conf:/home/rocketmq/rocketmq-5.1.3/conf/broker.conf
    command: sh mqbroker --enable-proxy  -c /home/rocketmq/rocketmq-5.1.3/conf/broker.conf
    privileged: true
    restart: always
    networks:
      rocketmq-net:
        ipv4_address: 172.150.0.20

  # rocketmq 可视化平台
  rocketmq_dashboard:
    image: apacherocketmq/rocketmq-dashboard:latest
    container_name: rocketmqDashboard
    depends_on:
      - rocketmq_nameserver1
    environment:
      # 时区上海
      TZ: Asia/Shanghai
      JAVA_OPTS: "-Drocketmq.namesrv.addr=rocketmq_nameserver1:9876"
    ports:
      - "18080:8080"
    privileged: true
    restart: always
    networks:
      rocketmq-net:
        ipv4_address: 172.150.0.30

networks:
  rocketmq-net:
    external: true
    name: rocketmq # 为网络设置自定义名称,如果不设置,则为:docker_rocketmq-net
    ipam:
      driver: default # 自定义 IPAM 驱动程序,设置默认的
      config:
        - subnet: "172.150.0.0/24" #设置网络的网络段
          gateway: "172.150.0.1"

容器【rocketmq_nameserver1】

OpenJDK 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
OpenJDK 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
The Name Server boot success. serializeType=JSON, address 0.0.0.0:9876

容器【rocketmq_broker1】

OpenJDK 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
OpenJDK 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
Mon Oct 16 15:59:13 CST 2023 rocketmq-proxy startup successfully

看上面运行的日志结果,是成功的

容器【rocketmqDashboard】

16:06:13,652 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:06:13,653 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:06:13,653 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/rocketmq-dashboard.jar!/BOOT-INF/classes!/logback.xml]
16:06:13,665 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@5fa7e7ff - URL [jar:file:/rocketmq-dashboard.jar!/BOOT-INF/classes!/logback.xml] is not of type file
16:06:13,702 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:06:13,703 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:06:13,707 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:06:13,709 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:06:13,732 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
16:06:13,733 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:06:13,752 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1177096266 - No compression will be used
16:06:13,752 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1177096266 - Will use the pattern /root/logs/consolelogs/rocketmq-console-%d{yyyy-MM-dd}.%i.log for the active file
16:06:13,754 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - The date pattern is 'yyyy-MM-dd' from file name pattern '/root/logs/consolelogs/rocketmq-console-%d{yyyy-MM-dd}.%i.log'.
16:06:13,754 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Roll-over at midnight.
16:06:13,756 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Setting initial period to Mon Oct 16 16:05:30 CST 2023
16:06:13,756 |-WARN in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - SizeAndTimeBasedFNATP is deprecated. Use SizeAndTimeBasedRollingPolicy instead
16:06:13,756 |-WARN in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - For more information see http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedRollingPolicy
16:06:13,757 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:06:13,759 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /root/logs/consolelogs/rocketmq-console.log
16:06:13,759 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/root/logs/consolelogs/rocketmq-console.log]
16:06:13,759 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
16:06:13,759 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:06:13,760 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:06:13,760 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:06:13,760 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@4d76f3f8 - Registering current configuration as safe fallback point


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

[2023-10-16 16:06:14.376]  INFO Starting App v1.0.0 on 5219c92722f3 with PID 8 (/rocketmq-dashboard.jar started by root in /)
[2023-10-16 16:06:14.377]  INFO No active profile set, falling back to default profiles: default
[2023-10-16 16:06:16.016]  INFO Tomcat initialized with port(s): 8080 (http)
[2023-10-16 16:06:16.027]  INFO Initializing ProtocolHandler ["http-nio-0.0.0.0-8080"]
[2023-10-16 16:06:16.028]  INFO Starting service [Tomcat]
[2023-10-16 16:06:16.028]  INFO Starting Servlet engine: [Apache Tomcat/9.0.29]
[2023-10-16 16:06:16.140]  INFO Initializing Spring embedded WebApplicationContext
[2023-10-16 16:06:16.140]  INFO Root WebApplicationContext: initialization completed in 1717 ms
[2023-10-16 16:06:16.891]  INFO Initializing ExecutorService 'applicationTaskExecutor'
[2023-10-16 16:06:16.986]  INFO Adding welcome page: class path resource [static/index.html]
[2023-10-16 16:06:17.118]  INFO Initializing ExecutorService 'taskScheduler'
[2023-10-16 16:06:17.129]  INFO Exposing 2 endpoint(s) beneath base path '/actuator'
[2023-10-16 16:06:17.192]  INFO Starting ProtocolHandler ["http-nio-0.0.0.0-8080"]
[2023-10-16 16:06:17.221]  INFO Tomcat started on port(s): 8080 (http) with context path ''
[2023-10-16 16:06:17.223]  INFO Started App in 3.352 seconds (JVM running for 3.908)
RocketMQLog:WARN No appenders could be found for logger (io.netty.util.internal.PlatformDependent0).
RocketMQLog:WARN Please initialize the logger system properly.
[2023-10-16 16:06:30.266]  INFO create MQAdmin instance ClientConfig [namesrvAddr=rocketmq_nameserver1:9876, clientIP=172.150.0.30, instanceName=1697443590009, clientCallbackExecutorThreads=4, pollNameServerInterval=30000, heartbeatBrokerInterval=30000, persistConsumerOffsetInterval=5000, pullTimeDelayMillsWhenException=1000, unitMode=false, unitName=null, vipChannelEnabled=true, useTLS=false, language=JAVA, namespace=null] success.
[2023-10-16 16:06:30.746]  INFO start time: 5.200 μs
[2023-10-16 16:06:30.770]  WARN Exception caught: mqAdminExt get broker stats data TOPIC_PUT_NUMS failed
[2023-10-16 16:06:30.770]  WARN Response [CODE: 1  DESC: The stats <TOPIC_PUT_NUMS> <DefaultCluster_REPLY_TOPIC> not exist
For more information, please visit the url, http://rocketmq.apache.org/docs/faq/] 
16:06:33,404 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:06:33,405 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:06:33,405 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/rocketmq-dashboard.jar!/BOOT-INF/classes!/logback.xml]
16:06:33,460 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@5fa7e7ff - URL [jar:file:/rocketmq-dashboard.jar!/BOOT-INF/classes!/logback.xml] is not of type file
16:06:33,536 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:06:33,536 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:06:33,542 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:06:33,547 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:06:33,577 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
16:06:33,579 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:06:33,593 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1177096266 - No compression will be used
16:06:33,593 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1177096266 - Will use the pattern /root/logs/consolelogs/rocketmq-console-%d{yyyy-MM-dd}.%i.log for the active file
16:06:33,595 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - The date pattern is 'yyyy-MM-dd' from file name pattern '/root/logs/consolelogs/rocketmq-console-%d{yyyy-MM-dd}.%i.log'.
16:06:33,595 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Roll-over at midnight.
16:06:33,597 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - Setting initial period to Mon Oct 16 16:06:30 CST 2023
16:06:33,597 |-WARN in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - SizeAndTimeBasedFNATP is deprecated. Use SizeAndTimeBasedRollingPolicy instead
16:06:33,597 |-WARN in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@27f8302d - For more information see http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedRollingPolicy
16:06:33,599 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:06:33,600 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /root/logs/consolelogs/rocketmq-console.log
16:06:33,600 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/root/logs/consolelogs/rocketmq-console.log]
16:06:33,601 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
16:06:33,601 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:06:33,601 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:06:33,601 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:06:33,602 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@4d76f3f8 - Registering current configuration as safe fallback point


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

[2023-10-16 16:06:34.136]  INFO Starting App v1.0.0 on 5219c92722f3 with PID 7 (/rocketmq-dashboard.jar started by root in /)
[2023-10-16 16:06:34.138]  INFO No active profile set, falling back to default profiles: default
[2023-10-16 16:06:36.052]  INFO Tomcat initialized with port(s): 8080 (http)
[2023-10-16 16:06:36.063]  INFO Initializing ProtocolHandler ["http-nio-0.0.0.0-8080"]
[2023-10-16 16:06:36.064]  INFO Starting service [Tomcat]
[2023-10-16 16:06:36.064]  INFO Starting Servlet engine: [Apache Tomcat/9.0.29]
[2023-10-16 16:06:36.163]  INFO Initializing Spring embedded WebApplicationContext
[2023-10-16 16:06:36.163]  INFO Root WebApplicationContext: initialization completed in 1944 ms
[2023-10-16 16:06:36.893]  INFO Initializing ExecutorService 'applicationTaskExecutor'
[2023-10-16 16:06:36.976]  INFO Adding welcome page: class path resource [static/index.html]
[2023-10-16 16:06:37.285]  INFO Initializing ExecutorService 'taskScheduler'
[2023-10-16 16:06:37.313]  INFO Exposing 2 endpoint(s) beneath base path '/actuator'
[2023-10-16 16:06:37.361]  INFO Starting ProtocolHandler ["http-nio-0.0.0.0-8080"]
[2023-10-16 16:06:37.398]  INFO Tomcat started on port(s): 8080 (http) with context path ''
[2023-10-16 16:06:37.408]  INFO Started App in 3.683 seconds (JVM running for 4.296)

【遇到的问题】:访问192.168.26.150:18080访问不了,实在找不到原因
1.防火墙已全部关闭,能访问主机能ping通192.168.26.150
能不能出一个rocket 5.1.3 的详细配置呢!真的遇到很多很多问题

@huangsunting
Copy link

huangsunting commented Apr 14, 2024

官方文档比较坑,甚至没有docker的部署示例。。。
rocketmq5.x引入了proxy,需要开放一下端口,不然访问不了。

  • 1.先简单安装一下,8081是grpc访问端口,8080是remoting访问(如果需要)
    docker run -d
    --name rmqbroker
    --net rmq_net
    -p 10911:10911 -p 10909:10909 -p 8081:8081
    --privileged=true
    apache/rocketmq:5.2.0 sh mqbroker -n rmqnamesrv:9876 --enable-proxy

  • 2.拷贝文件后,删除容器
    docker cp rmqbroker:/home/rocketmq/rocketmq-5.2.0/conf /你的目录/docker/rocketmq/broker/conf

  • 3.重新安装,endpoints=localhost:8081
    docker run -d
    --name rmqbroker
    --net rmq_net
    -p 10911:10911 -p 10909:10909 -p 8081:8081 -p 8080:8080
    --privileged=true
    -v 你的目录/docker/rocketmq/broker/logs:/home/rocketmq/logs
    -v 你的目录/docker/rocketmq/broker/store:/home/rocketmq/store
    -v 你的目录/docker/rocketmq/broker/conf:/home/rocketmq/rocketmq-5.2.0/conf
    -e "MAX_HEAP_SIZE=1024M"
    apache/rocketmq:5.2.0 sh mqbroker -n rmqnamesrv:9876 --enable-proxy -c /home/rocketmq/rocketmq-5.2.0/conf/broker.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants