리눅스 서버에 nGrinder 설치하기

2022. 5. 17. 16:44 성능테스트/nGrinder

서버 선택

기본적으로 nGrinder와 같은 오픈소스를 이용한 성능테스트를 할때는 높은 성능의 서버를 이용하는 것이 좋다. 그래야 성능 테스트의 결과를 비교적 정확히 파악할 수 있다.

또한 Controller , Agent  그리고 테스트할 서버를 모두 각각 구축하는 것이 좋다. 만약 세 가지 요소들을 하나의 서버로 구동한다면 서버가 온전히 성능 테스트만을 위해 자원을 사용할 수 없게 된다. 따라서 정확한 수치를 산출해내기 어렵다.

1. jdk 설치

nGrinder는 기본적으로 jdk가 설치되어있어야 동작한다.

1. 자바 설치여부 확인

# java -version

2. jdk 1.8 설치

# sudo yum install java-1.8.0-openjdk-devel

3. 환경변수 설정

# readlink -f /usr/bin/javac

# vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64

vim 편집기로 profile 실행 후 아래 그림과 같이 위 내용을 추가

변경 내용 저장

# source /etc/profile

 

2. 리눅스 서버에 controller 설치

ngrinder 최신 릴리즈 파일 다운로드

(2021-05-23기준 최신버전 링크 : https://github.com/naver/ngrinder/releases/download/ngrinder-3.5.5-20210430/ngrinder-controller-3.5.5.war )

controller 설치할 리눅스 서버 접속

wget https://github.com/naver/ngrinder/releases/download/ngrinder-3.5.5-20210430/ngrinder-controller-3.5.5.war

설치가 완료되면 아래 명령어로 ngrinder 실행

java -XX:MaxPermSize=200m -jar ngrinder-controller-3.5.5.war

공인IP:8080 포트로 ngrinder 접속(초기 ID/PW : admin)

3. 리눅스 서버에 Agent 설치

Controller 서버의 ngrinder 접속 후 Agent 다운로드 ( ADMIN- 에이전트 관리)

다운로드 링크 복사 후 Agent 서버에 위 파일 설치

wget http://......../agent/download/ngrinder-agent-3.5.5.tar

다운로드한 tar 파일 압축 해제

sudo tar xvf ngrinder-agent-*.tar 

압축 해제한 폴더로 이동

cd ngrinder-agent

 

주의사항

Agent 파일을 UI에서 바로 다운로드하면 __agent.conf라는 파일이 함께 생성되는 반면에 위 예시처럼 링크를 통해 다운로드 진행시 해당 파일이 생성되지 않는다. 따라서 직접 작성해줘야 한다.

 

해당 폴더에 agent.conf 파일 생성후 아래 내용을 입력한다. 

vim agent_conf
common.start_mode=agent
agent.controller_host= Controller IP주소
agent.controller_port=16001
agent.subregion=
agent.owner=
#agent.host_id=
#agent.server_mode=true

# provide more agent java execution option if necessary.
#agent.java_opt=
# provide more agent jvm classpath if necessary.
#agent.jvm.classpath=
# set following false if you want to use more than 1G Xmx memory per a agent process.
#agent.limit_xmx=true
# please uncomment the following option if you want to send all logs to the controller.
#agent.all_logs=true
# some jvm is not compatible with DNSJava. If so, set this false.
#agent.enable_local_dns=false
# please uncomment the following option if you want to run controller_to_agent connection mode agent.
#agent.connection_mode=controller_to_agent
#agent.connection_port=14000
# set following with the ip you want to broadcast yourself. Set this option if the agent needs to be discovered as public ip.
#agent.broadcast_ip=

agent.controller_host에 controller가 설치된 IP주소를 입력하고 추가적으로 16001 포트 사용시 ec2또는 ncp 설정에서 반드시 해당 포트를 열어야한다.

설정이 완료되면 아래 명령어로 Agent를 실행한다.

./run_agent.sh

정상적으로 실행되면 위와 같이 출력된다.

4. 연결 확인

ngrinder 접속 후 admin - 에이전트 관리로 이동하면 방금 등록한 서버가 목록에 나타난다.

 

출처 : https://1-7171771.tistory.com/154