반응형

Linux에 설치하기

호스트네임 설정

설치 스크립트

#!/bin/sh

## Install RabbitMQ signing key
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -

## Add Bintray repositories that provision latest RabbitMQ and Erlang 21.x releases
sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF

## sync package metadata
sudo apt-get update -y

## install erlang
sudo apt-get install -y \
    erlang-base \
    erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
    erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
    erlang-runtime-tools erlang-snmp erlang-ssl \
    erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl

# install dependencies manually
sudo apt-get install -y socat

## download rabbitmq
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.5/rabbitmq-server_3.8.5-1_all.deb

## install rabbitmq
sudo dpkg -i rabbitmq-server_3.8.5-1_all.deb

## remove rabbitmq deb file
rm rabbitmq-server_3.8.5-1_all.deb

## enable rabbitmq_management
sudo rabbitmq-plugins enable rabbitmq_management

RabbitMQ 사용자 추가

USERNAME=ubuntu \
PASSWORD=123456 \
VHOST=example \
&& sudo rabbitmqctl add_user ${USERNAME} ${PASSWORD} \
&& sudo rabbitmqctl set_user_tags ${USERNAME} administrator \
&& sudo rabbitmqctl add_vhost ${VHOST} \
&& sudo rabbitmqctl set_permissions -p ${VHOST} ${USERNAME} '.*' '.*' '.*'

RabbitMQ 실행

sudo service rabbitmq-server start

RabbitMQ WEB 접속

Docker로 설치하기

docker-compose.yml

version: "3.3"
services:
  rabbitmq:
    container_name: rabbitmq
    image: rabbitmq:3-management
    environment:
      TZ: "Asia/Seoul"
      RABBITMQ_DEFAULT_USER: "guest"
      RABBITMQ_DEFAULT_PASS: "guest"
      RABBITMQ_DEFAULT_VHOST: "test"
    ports:
      - "5672:5672"
      - "15672:15672"

참고

반응형

'Development > RabbitMQ' 카테고리의 다른 글

[RabbitMQ] Spring 연동  (0) 2020.12.30
[RabbitMQ] Web UI  (0) 2020.12.30
[RabbitMQ] 클러스터 구성하기  (0) 2020.12.30
[RabbitMQ] RabbitMQ란?  (0) 2020.12.30

+ Recent posts