카이도스의 Tech Blog
Hadoop 클러스터 - HA 테스트, Datanode 추가/삭제 본문
728x90
반응형
2023.09.01 - [Hadoop] - Hadoop 클러스터 설치1
HA 테스트 : Namenode, Yarn
더보기
1. 네임노드
# 상태확인
hdfs haadmin -getServiceState namenode1
active
hdfs haadmin -getServiceState namenode2
standby
jps
51777 NameNode
52802 DFSZKFailoverController
51492 JournalNode
53847 ResourceManager
54313 JobHistoryServer
45996 QuorumPeerMain
55598 Jps
# kill
kill -9 51777
jps
52802 DFSZKFailoverController
51492 JournalNode
53847 ResourceManager
54313 JobHistoryServer
45996 QuorumPeerMain
55678 Jps
# 확인
hdfs haadmin -getServiceState namenode1
2023-08-04 13:14:38,991 INFO ipc.Client: Retrying connect to server: hadoop-master1/IP:8020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=1, sleepTime=1000 MILLISECONDS)
Operation failed: Call From hadoop-master1/IP to hadoop-master1:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
hdfs haadmin -getServiceState namenode2
active
# 재시작
$HADOOP_HOME/bin/hdfs --daemon start namenode
jps
55936 NameNode
52802 DFSZKFailoverController
56066 Jps
51492 JournalNode
53847 ResourceManager
54313 JobHistoryServer
45996 QuorumPeerMain
hdfs haadmin -getServiceState namenode1
standby
hdfs haadmin -getServiceState namenode2
active
2. yarn
# 상태확인
yarn rmadmin -getServiceState rm1
active
yarn rmadmin -getServiceState rm2
standby
jps
13475 QuorumPeerMain
21783 ResourceManager
22906 Jps
20410 DFSZKFailoverController
22188 JobHistoryServer
19516 NameNode
19278 JournalNode
# kill
kill -9 21783
jps
13475 QuorumPeerMain
22980 Jps
20410 DFSZKFailoverController
22188 JobHistoryServer
19516 NameNode
19278 JournalNode
# 확인
yarn rmadmin -getServiceState rm1
2023-08-07 03:05:23,641 INFO ipc.Client: Retrying connect to server: hadoop-master1/IP:8033. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=1, sleepTime=1000 MILLISECONDS)
Operation failed: Call From hadoop-master1/IP to hadoop-master1:8033 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
yarn rmadmin -getServiceState rm2
active
# 재시작
start-yarn.sh
yarn rmadmin -getServiceState rm1
standby
yarn rmadmin -getServiceState rm2
active
Datanode 삭제
더보기
# 데이터 노드 삭제
vi /data/hadoop/conf/exclude_server
IP:PORT
## 명령어
# 삭제 후 완료까지 시간 소요
$HADOOP_HOME/bin/hadoop dfsadmin -refreshNodes
Datanode 추가
더보기
# 데이터 노드 추가
vi /data/hadoop/conf/include_server
hadoop-slave1
hadoop-slave2
hadoop-slave3
hadoop-slave4
## 명령어
$HADOOP_HOME/bin/hadoop dfsadmin -refreshNodes
$HADOOP_HOME/sbin/hadoop-daemon.sh start datanode
$HADOOP_HOME/sbin/yarn-daemon.sh start nodemanager
$HADOOP_HOME/bin/hadoop balancer -threshold 5 ##노드간 저장량 차이를 5%이내로 함.
**
diskbalancer : 하나의 데이터 노드(in a single datanode)에 여러개의 disks 가 있는 경우, disk 간 데이터 불균형이 일어났을 때 불균형을 해소시켜줌.
balancer : 여러 데이터노드 간(inter nodes in multiple datanodes) 데이터 불균형이 일어났을 때 불균형을 해소시켜줌.
728x90
반응형
'Hadoop' 카테고리의 다른 글
Hadoop 구성도 설명 (0) | 2024.02.09 |
---|---|
Hadoop 클러스터 - 스터디 (0) | 2024.01.15 |
Hadoop 클러스터 - 하둡/스파크 명령어 테스트 (0) | 2024.01.15 |
Hadoop 클러스터 설치 (0) | 2023.09.01 |
Comments