본문 바로가기
Programming/Etc

Mac brew Rabbitmq 설치 후 실행 문제

by Renechoi 2023. 6. 1.

 

brew 로 설치하고 rabbitmq-server 실행 명령시 다음과 같은 에러가 발생했다. 

2023-06-01 18:55:42.589155+09:00 [warning] <0.131.0> Failed to create PID file "/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost.pid" directory: no such file or directory
2023-06-01 18:55:42.714424+09:00 [error] <0.229.0> Failed to create feature flags file "/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost-feature_flags" directory: no such file or directory

이 오류 메시지는 rabbitmq가 pid 파일과 feature flags 파일을 생성할 디렉토리가 존재하지 않아서 발생한 것을 나타낸다.

 

다음과 같은 방식으로 해결할 수 있다. 

 

1. /opt/homebrew/var/lib/rabbitmq/mnesia 디렉토리가 존재하는지 확인한다.

 

2. 만약 디렉토리가 존재하지 않는다면 다음 명령을 실행하여 디렉토리를 생성한다.

 

mkdir -p /opt/homebrew/var/lib/rabbitmq/mnesia

 

 

그런데 이제는 다른 에러가 발생했다. 

 

2023-06-01 19:01:02.233341+09:00 [warning] <0.131.0> Failed to write PID file "/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost.pid": permission denied
2023-06-01 19:01:03.097916+09:00 [notice] <0.44.0> Application syslog exited with reason: stopped
2023-06-01 19:01:03.097979+09:00 [notice] <0.229.0> Logging: switching to configured handler(s); following messages may not be visible in this log output

BOOT FAILED
===========
Error during startup: {error,
                          {cannot_create_mnesia_dir,
                              "/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost/",
                              eacces}}

{"Kernel pid terminated",application_controller,"{application_start_failure,rabbit,{{cannot_create_mnesia_dir,\"/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost/\",eacces},{rabbit,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,rabbit,{{cannot_create_mnesia_dir,"/opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost/",eacces},{rabbit,start,[normal,[]]}}})

Crash dump is being written to: /opt/homebrew/var/log/rabbitmq/erl_crash.dump...done

 

이 오류 메시지는 rabbitmq가 PID 파일을 작성할 권한이 없어서 발생한 것을 나타낸다.

 

또한, /opt/homebrew/var/lib/rabbitmq/mnesia/rabbit@localhost/ 디렉토리를 생성할 수 없다는 권한 거부 오류도 있다.

 

따라서 다음의 명령어를 통해 해결한다. 

 

sudo mkdir -p /opt/homebrew/var/lib/rabbitmq/mnesia
sudo chown -R $(whoami) /opt/homebrew/var/lib/rabbitmq

 

 

정상 실행 

 

 

 

default 설정 id/pwd : guest/guest이다. 

 

입력하면 다음과 같은 화면으로 접속된다. 

 

반응형