[Ngrinder] MAC M1 설치

may_yun·2023년 3월 17일
2

nGrinder
nGrinder는 Controller와 Agent로 나눠져 있습니다.

  • Controller
    부하테스트를 위한 웹 인터페이스 제공
    테스트 스크립트 작성
    테스트 결과를 수집하여 통계로 보여줌

  • Agent
    Controller의 명령을 받아 실제로 target에 부하를 발생시킴
    CPU, memory 모니터링도 가능
    저는 하나의 Controller와 3개의 Agent를 둬서 테스트를 진행합니다.


Ngrinder 설치

  1. Ngrinder: https://github.com/naver/ngrinder/releases
    현재 기준 3.5.8 최신

위 링크에 들어가서 war 파일을 다운 받는다

  1. 터미널에서 war 파일 실행
    다운받은 war 위치에서 실행해야한다

java -jar ngrinder-controller-3.5.8.war --port=8300
java -Djava.io.tmpdir=/Users/seoyun/ngrinder -XX:MaxPermSize=200m -jar ngrinder-controller-3.5.8.war --port=8300
  • 성공적으로 실행

3-1. 브라우저에 지정해준 port 번호로 접속

localhost:8300

3-2. ngrinder 로그인
초기 아이디와 비밀번호는 admin이다

에이전트(Agent) 설치

  1. 에이전트 설치

  2. 다운로드 받은 tar 파일 압축 풀기
    터미널에서 해당 경로로 이동한 뒤 압축 풀기

tar -xvf ngrinder-agent-{version}-localhost.tar
//tar -xvf ngrinder-agent-3.5.8-localhost.tar

  1. 압축이 풀린 agent 폴더로 이동
cd ngrinder-agent

  1. agent 실행
    ⭐️controller가 실행된 상태에서 agent를 실행해 줘야한다
    (윈도우는 sh가 아닌 .bat으로 실행)
    test를 하려면 agent가 켜져있어야한다 agent가 request를 보내기 때문에

./run_agent.sh
  • 실행 완료 화면

실행이 완료되었으면 아까 접속했던 localhost:8300의 에이전트 관리 탭으로 넘어가면 확인해볼 수 있다

  1. localhost:8300의 에이전트 관리 탭


설치시 발생한 에러

📌 발생한 에러
: nGrinder 실행 시 필요한 임시 파일의 저장 경로를 명시하지 않아서 나는 에러이다. 따라서 실행 시 아래와 같이 임시 파일을 생성할 위치를 명시해주면 된다.

Please set `java.io.tmpdir` property like following. tmpdir should be different from the OS default tmpdir.
`java -Djava.io.tmpdir=${NGRINDER_HOME}/lib -jar ngrinder-controller.war`

➡️ 해결

java -Djava.io.tmpdir=/Users/seoyun/ngrinder-pinpoint -jar ngrinder-controller-3.5.8.war --port=8300

📌 실행시 발생한 에러

Caused by: org.ngrinder.common.exception.NGrinderRuntimeException: Can not check available ports because given local IP address '218.38.137.28' is unreachable. Please check the `/etc/hosts` file or manually specify the local IP address in `${NGRINDER_HOME}/system.conf`.
Error creating bean with name 'consoleManager': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Can not check available ports because given local IP address '218.38.137.28' is unreachable. Please check the `/etc/hosts` file or manually specify the local IP address in `${NGRINDER_HOME}/system.conf`.

➡️ 해결 방법

'Please check the `/etc/hosts` file or manually specify the local IP address
in `${NGRINDER_HOME}/system.conf`.
  1. ifconfig로 IP 주소 찾아서 방화벽 열기
    터미널에 $ifconfig 혹은 $ifconfig | grep "inet "

// IP 주소 : 192.168.219.102

  1. local IP Address를 system.conf에 명시한다
    경로 이동 (system.conf는 /Users/.ngrinder 위치에 있다)
cd /users/seoyun/.ngrinder
vim system.conf

system.conf 파일에 ip주소 입력 후 저장 wq!

ngrinder.controller.ip=${LOCAL_IP_ADDRESS}


📌 발생한 에러
: agent에서 controller에 접근할때 주소가 기본적으로 log에 나와있는 localhost로 시도하는데, 나는 위에서 본 에러로 host 주소를 바꿔줬기 때문에 여기서도 동일하게 변경해주어야 한다.

2023-03-17 12:09:21,967 ERROR agent controller: Error while connecting to agent controller server at /127.0.0.1:16001

➡️ 해결
/Users/.ngrinder_agent/agent.conf 파일의 상단에 있는 host를 내 local IP address로 수정해주면 된다.

⭐️ host를 위 에러에서 수정해줬던 내 IP주소 변경


📌 발생한 에러

➡️ 해결 windows는 bat으로 실행


설치 참고 링크

profile
개발 일지

0개의 댓글