티스토리 뷰
[FLINK] Yarn Session 클러스터를 띄울때 Deployment took more than 60 seconds 대기하는 문제 해결방법 (3가지 케이스)
정선생 2022. 12. 1. 00:00Flink 를 Yarn 에서 동작할때 다음과 같은 메시지를 출력하며 무한 대기하는 상황이 있다.
이런 이유는 보통 컨테이너에서 리소스를 받아서 데몬을 기동해야하는데 받지 못하는 상황이다. 이때 몇가지 상황에 따라 해결방법이 다르다.
2022-11-30 11:31:33,275 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deploying cluster, current state ACCEPTED
2022-11-30 11:32:33,422 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2022-11-30 11:32:33,673 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2022-11-30 11:32:33,924 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2022-11-30 11:32:34,174 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2022-11-30 11:32:34,425 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
2022-11-30 11:32:34,675 INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Deployment took more than 60 seconds. Please check if the requested resources are available in the YARN cluster
1. 디폴트 큐가 너무 작게 세팅된 경우
다음과 같이 실행할 경우, yarn 에서 default 큐를 사용하게 되는데, 큐의 리소스가 너무 작게 책정되거나 혹은 딴 작업이 리소스를 점유하고 있는 경우 발생된다. 이럴때는 Flink 전용 작업큐를 분리하는게 좋고, 이럴땐 별도의 큐를 지정해서 실행하면 해결할 수 있다.
아래 예시는 --queue 옵션을 이용해서 "batch" 큐로 지정해서 실행하는 예제이다.
./bin/yarn-session.sh --detached -z yarn-flink-sql-server-001 -nm Flink-SQL-Server --queue batch
2. resourcemanager.scheduler.address 미지정 문제
위와 같이 yarn 의 리소스 문제도 아니라면, yarn 에서 리소스배정을하는 스케쥴러를 못찾는 문제일 수 있다.
이럴땐, flink-conf.yaml 설정에 flink.hadoop.yarn.resourcemanager.scheduler.address 설정값을 지정하면 해결될 수 있다.
# flink-conf.yaml
flink.hadoop.yarn.resourcemanager.scheduler.address: hadoop.my-home.com:8030
참고로 리소스 매니저 스케쥴러의 설정값은 하둡설정의 yarn-site.xml 을 참고하면 알수 있다.
<!-- yarn-site.xml -->
...
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>hadoop.my-home.com:8030</value>
</property>
...
3. Flink 용 주키퍼가 죽은경우
1,2 번에서 보통 해결이 되는데, 안되서 한참 헤맸다.
YARN 에서 ACCEPTED 상태로 존재하는, 컨테이너의 로그를 살펴보니 다음과 같은 오류가 나고 있었다.
Flink 1.15 에서 1.16 으로 넘어가면서 주키퍼 버전이 높은버전을 써야해서 별도의 주키퍼 서버를 띄워서 사용하고 있었는데 확인해보니 연결이 안되고 있었다 -_-;;;
2022-11-30 12:10:15,966 ERROR org.apache.flink.shaded.curator5.org.apache.curator.ConnectionState [] - Authentication failed
2022-11-30 12:10:15,967 INFO org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - Socket error occurred: myhome-etl01.myhome.com/10.10.10.1:2181: Connection refused
2022-11-30 12:10:17,067 WARN org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - SASL configuration failed: javax.security.auth.login.LoginException: No JAAS configuration section named 'Client' was found in specified JAAS configuration file: '/hadoop/yarn/local/usercache/gildong/appcache/application_1669352886689_2592/jaas-4994872061039689189.conf'. Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
2022-11-30 12:10:17,068 INFO org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - Opening socket connection to server dev1.myhome.com/10.10.10.1:2181
2022-11-30 12:10:17,068 ERROR org.apache.flink.shaded.curator5.org.apache.curator.ConnectionState [] - Authentication failed
2022-11-30 12:10:17,068 INFO org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - Socket error occurred: myhome-etl02.myhome.com/10.10.10.2:2181: Connection refused
2022-11-30 12:10:17,168 WARN org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - SASL configuration failed: javax.security.auth.login.LoginException: No JAAS configuration section named 'Client' was found in specified JAAS configuration file: '/hadoop/yarn/local/usercache/gildong/appcache/application_1669352886689_2592/jaas-4994872061039689189.conf'. Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
2022-11-30 12:10:17,169 INFO org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.ClientCnxn [] - Opening socket connection to server myhome-etl02.myhome.com/10.10.10.2:2181
2022-11-30 12:10:17,169 ERROR org.apache.flink.shaded.curator5.org.apache.curator.ConnectionState [] - Authentication failed
주키퍼를 재기동후 실행해보니 정상 기동완료되었다.