Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Setting Up RocketMQ on Linux Using Docker and Accessing the Management Interface

Tech May 15 1

1. Create the /opt/rocketmq/docker-compose.yml and /opt/rocketmq/broker.conf configuration files

2. Configure docker-compose.yml with the management interface port set to 8090

version: '3.5'
services:
  rmqnamesrv:
    image: foxiswho/rocketmq:server
    container_name: rmqnamesrv
    ports:
      - 9876:9876
    networks:
      rmq:
        aliases:
          - rmqnamesrv
  rmqbroker:
    image: foxiswho/rocketmq:broker
    container_name: rmqbroker
    ports:
      - 10909:10909
      - 10911:10911
    volumes:
      - ./broker.conf:/etc/rocketmq/broker.conf
    environment:
      NAMESRV_ADDR: "rmqnamesrv:9876"
      JAVA_OPTS: " -Duser.home=/opt"
      JAVA_OPT_EXT: "-server -Xms128m -Xmx128m -Xmn128m"
    command: mqbroker -c /etc/rocketmq/broker.conf
    depends_on:
      - rmqnamesrv
    networks:
      rmq:
        aliases:
          - rmqbroker
  rmqconsole:
    image: styletang/rocketmq-console-ng
    container_name: rmqconsole
    ports:
      - 8090:8080
    environment:
      JAVA_OPTS: "-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"
    depends_on:
      - rmqnamesrv
    networks:
      rmq:
        aliases:
          - rmqconsole
networks:
  rmq:
    name: rmq
    driver: bridge

3. broker.conf

# Cluster name
brokerClusterName = DefaultCluster

# Node name
brokerName = broker-a

# Broker ID, 0 represents master, other positive integers represent slave, cannot be less than 0
brokerId = 0

# Time to delete commit logs that exceed the retention period, default value 04
deleteWhen = 04

# File retention time in hours, default value 72 hours
fileReservedTime = 72

# Broker role
brokerRole = ASYNC_MASTER

# Flushing method
flushDiskType = ASYNC_FLUSH

# Broker service address, use internal IP for internal use, public IP for external access, modify as needed
brokerIP1 = 192.168.11.110

4. Navigate to the rocketmq directory and start the cotnainers

cd /opt/rocketmq
docker-compose up -d

5. Access the management interafce after the contianers start successfully

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.