nGrinder 성능 테스트 도중 만난 에러들

bagt13·2023년 2월 26일
4

Project

목록 보기
5/17
post-thumbnail

❌ Please set 'java.io.tmpdir' property

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`

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

java -Djava.io.tmpdir=/Users/${username}/${생성할 파일명} -jar 
ngrinder-controller-3.5.8.war --port=8300

또는 system.conf 파일에 아래와 같이 명시해주고, 실행하면 된다고 한다. (시도해보진 않음)

controller.java_options=-Djava.io.tmpdir=/Users/${username}/${생성할 임시파일명}
java -jar ngrinder-controller-3.5.8.war --port=8300

❌ file is locked (ngrinder db)

Caused by: java.lang.IllegalStateException:
The file is locked: nio:/Users/.ngrinder/db/h2.mv.db

nGrinder의 h2를 다른 프로세스에서 사용중이기 때문에 나는 에러라고 한다.

ps aux | grep java
kill -9 ${첫번째 process}
rm -f h2.lock.db

참고 자료

https://stackoverflow.com/questions/8158969/h2-database-error-database-may-be-already-in-use-locked-by-another-process


❌ Please check /etc/hosts or specify IP address

'Please check the `/etc/hosts` file or manually specify the local IP address
in `${NGRINDER_HOME}/system.conf`.
  1. 방화벽 열기

  2. local IP Address를 system.conf에 명시한다

ngrinder.controller.ip=${LOCAL_IP_ADDRESS}
  • system.conf/Users/.ngrinder 위치에 있다

  • 이때 local ip addressifconfig 또는 ifconfig | grep "inet " 하면 나옴


❌ ngrinder-agent 실행 중 에러

ERROR agent controller: Error while connecting to agent controller server at /127.0.0.1:16001

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

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

또한 nGrinder를 사용하려면 12000 ~ 16001 port를 열어주어야 한다.

port 오픈 여부 확인

$ nc -vz ${CONTROLLER_IP_ADDR} 16001
profile
주니어 백엔드 개발자입니다😄

2개의 댓글

comment-user-thumbnail
2023년 9월 1일

감사합니다 도움 많이 됐어요 !!

1개의 답글