카이도스의 Tech Blog

Docker - nGrinder 설치1(단일 서버) 본문

Docker

Docker - nGrinder 설치1(단일 서버)

카이도스 2024. 3. 9. 23:10
728x90
반응형

2024.03.09 - [Docker] - Docker - nGrinder 설치2(서버 다른 서버)

 

Docker - nGrinder 설치2(서버 다른 서버)

2024.03.09 - [Docker] - Docker - nGrinder 설치1(단일 서버) Docker - nGrinder 설치1(단일 서버) # 컨트롤러 컨테이너 기동 sudo docker run -d -v ~/ngrinder-controller:/opt/ngrinder-controller --name controller -p 80:80 -p 16001:16001 -p 1

djdakf1234.tistory.com


# 컨트롤러 컨테이너 기동
sudo docker run -d -v ~/ngrinder-controller:/opt/ngrinder-controller --name controller -p 80:80 -p 16001:16001 -p 12000-12009:12000-12009 ngrinder/controller

# 에이전트 컨테이너1 기동
sudo docker run -d --name agent1 --link controller:controller ngrinder/agent

# 에이전트 컨테이너2 기동
sudo docker run -d --name agent2 --link controller:controller ngrinder/agent

# 확인
sudo docker ps
CONTAINER ID   IMAGE                 COMMAND             CREATED          STATUS          PORTS                                           NAMES
aa6a236d7e77   ngrinder/agent        "/scripts/run.sh"   25 seconds ago   Up 24 seconds                                           agent2
16546aed2624   ngrinder/agent        "/scripts/run.sh"   26 seconds ago   Up 26 seconds                                           agent1
ea0bfebbf6fb   ngrinder/controller   "/scripts/run.sh"   44 seconds ago   Up 43 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:12000-12009->12000-12009/tcp, :::12000-12009->12000-12009/tcp, 0/tcp, 0.0.0.0:16001->16001/tcp, :::16001->16001/tcp   controller

# 웹 접속 후 확인 : admin / admin
ip -br -4 addr show dev eth0 | awk '{print $3}' | cut -d '/' -f1 | awk '{ print "ngrinder = http://"$1"" }'

# agent 컨테이너에서 정보 확인 : controller 통신을 위해서 /etc/hosts 파일 내용 사용
sudo docker exec -it agent1 env
sudo docker exec -it agent1 cat /etc/hosts | tail -n 2
172.17.0.2	controller ea0bfebbf6fb
172.17.0.3	16546aed2624

sudo docker exec -it agent2 env
sudo docker exec -it agent2 cat /etc/hosts | tail -n 2
172.17.0.2	controller ea0bfebbf6fb
172.17.0.4	aa6a236d7e77

  • 웹 접속 후 확인 : admin / admin ⇒ 로그인 후 상단 admin → Agent Management 클릭


# 프로세스 확인
sudo docker ps
CONTAINER ID   IMAGE                 COMMAND             CREATED       STATUS       PORTS                                     NAMES
aa6a236d7e77   ngrinder/agent        "/scripts/run.sh"   2 hours ago   Up 2 hours                                     agent2
16546aed2624   ngrinder/agent        "/scripts/run.sh"   2 hours ago   Up 2 hours                                     agent1
ea0bfebbf6fb   ngrinder/controller   "/scripts/run.sh"   2 hours ago   Up 2 hours   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:12000-12009->12000-12009/tcp, :::12000-12009->12000-12009/tcp, 0/tcp, 0.0.0.0:16001->16001/tcp, :::16001->16001/tcp   controller

# 삭제 후 확인
sudo docker stop agent2
sudo docker stop agent1
sudo docker stop controller

sudo docker ps
CONTAINER ID   IMAGE                 COMMAND             CREATED       STATUS       PORTS                                     NAMES

# 강제 종료
sudo docker kill agent2
sudo docker kill agent1
sudo docker kill controller

# 중지된 모든 컨테이너 삭제
sudo docker container prune
728x90
반응형

'Docker' 카테고리의 다른 글

Docker - Nginx 설치  (0) 2024.03.09
Docker - Mysql 설치  (0) 2024.03.09
Docker - Postgresql 설치  (0) 2024.03.09
Docker - nGrinder 설치2(서버 다른 서버)  (0) 2024.03.09
Docker 설치  (0) 2024.03.09
Comments