/images/profile/profile.png

Se Hyeon Kim

Mock Test 1

1. Question Deploy a pod named nginx-pod using the nginx-alpine image Answer 1 k run nginx-pod --image=nginx:alpine 2. Question Deploy a messagine pod using the redis:alpine image with the labels set to tier=msg Answer 1 k run messaging --image=redis:alpine -l tier=msg 3. Question Create a namespace named apx-x9984574 Answer 1 k create namespace apx-x9984574 4. Question Get the list of nodes in JSON format and store it in a file at /opt/outputs/nodes-z3444kd9.

Ui

Introduction Jobs: 스파크 애플리케이션의 모든 job에 대한 요약 정보 Stages: 모든 jobs의 모든 stages의 현재 상태 요약 정보 Storage: persisted RDD와 DataFrame 정보 제공 Environment: 다양한 환경 변수 값 Executors: 애플리케이션을 위해 생성된 Executer 정보 제공. 메모리와 디스크 사용량과 task, shuffle 정보 등 SQL: 애플리케이션이 Spark SQL 쿼리 실행 시 정보 제공 Streaming: Streaming jobs 실행 시 정보 제공 애플리케이션 실행 1 2 3 4 5 df = spark.read.format("csv") \ .

Rdd

RDD Resilient Distributed Datasets(RDDs) distrubuted collections of objects that can be cached in memory across cluster manipulated through pararrel operators automatically recomputed on failure immutable(read-only) RDD 연산 RDD 연산은 트랜스포메이션과 액션이 있습니다. 트랜스포메이션은 RDD를 이용해서 새로운 RDD를 생성하고, 액션은 RDD를 이용해서 작업을 처리하여 결과를 드라이버에 반환하거나, 파일시스템에 결과를 쓰는 연산입니다. 스파크는 트랜스포메이션을 호출할 때는 작업을 구성하고, 액션이 호출 될 때 실제 계산을 실행합니다. 다음의 예제에서 csv파일의 데이터를 읽어서 lines라는 RDD 객체를 생성하고, 각 라인의 글자의 개수를 세는 map 트랜스포메이션 함수를 호출하고, 글자 수의 총합을 구하는 reduce 액션 함수를 호출합니다.

Partition

What is Partition? Partition은 RDDs나 Dataset을 구성하고 있는 최소 단위 객체이다. 각 Partition은 서로 다른 노드에서 분산 처리된다. Spark에서는 하나의 최소 연산을 Task라고 표현하는데, 이 하나의 Task에서 하나의 Partition이 처리된다. 또한, 하나의 Task는 하나의 Core가 연산 처리한다. 즉, 1 Core = 1 Task = 1 Partition이다. 예를 들어, 다음과 같다면 전체 Core 수를 300개로 세팅한 상태이고, 이 300개가 현재 실행 중인 Task 수이자, 현재 처리 중인 Partition 수에 해당한다. 또한, 전체 Partition 수는 1800개로 세팅했으며, 이는 전체 Task 수이기도 하다.

Hierarchy

Introduction Spark’s execution hierarchy, from top to bottom is Job, Stage, Task. Slots are part of executors. A task is executed in a slot. But slots are rather a tool to execute tasks, not part of the execution hierarchy itself. Executors are a component of a Spark cluter, but not of the execution hierarchy. Hardware Hierarchy Cluster Driver Executor Cores / Slots: Each executor can be considered as servers and they have cores.