

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Hive Live Long and Process(LLAP) 사용
<a name="emr-hive-llap"></a>

Amazon EMR 6.0.0은 Hive용 LLAP(Live Long and Process) 기능을 지원합니다. LLAP는 지능형 인 메모리 캐싱을 통해 영구 대몬을 사용하여 이전의 기본 Tez 컨테이너 실행 모드에 비해 쿼리 성능을 향상시킵니다.

Hive LLAP 대몬은 YARN 서비스로 관리되고 실행됩니다. YARN 서비스는 장기 실행 YARN 애플리케이션으로 간주될 수 있으므로 일부 클러스터 리소스가 Hive LLAP 전용으로 할당되고 다른 워크로드에 사용될 수 없습니다. 자세한 내용은 [LLAP](https://cwiki.apache.org/confluence/display/Hive/LLAP) 및 [YARN 서비스 API](https://hadoop.apache.org/docs/r3.2.1/hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html)를 참조하세요.

## Amazon EMR에서 Hive LLAP 활성화
<a name="emr-llap-enable"></a>

Amazon EMR에서 Hive LLAP를 활성화하려면 클러스터를 시작할 때 다음 구성을 제공합니다.

```
[
  {
    "Classification": "hive",
    "Properties": {
      "hive.llap.enabled": "true"
    }
  }
]
```

자세한 내용은 [애플리케이션 구성](https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html)을 참조하세요.

기본적으로 Amazon EMR은 클러스터 YARN 리소스의 약 60%를 Hive LLAP 대몬(daemon)에 할당합니다. Hive LLAP에 할당되는 클러스터 YARN 리소스의 비율과 Hive LLAP 할당에 고려할 작업 및 코어 노드의 수를 구성할 수 있습니다.

예를 들어, 다음 구성은 3개의 작업 또는 코어 노드에서 3개의 대몬으로 Hive LLAP를 시작하고 3개의 코어 또는 작업 노드의 YARN 리소스 중 40%를 Hive LLAP 대몬에 할당합니다.

```
[
  {
    "Classification": "hive",
    "Properties": {
      "hive.llap.enabled": "true",
      "hive.llap.percent-allocation": "0.4",
      "hive.llap.num-instances": "3"
    }
  }
]
```

분류 API에서 다음 `hive-site` 구성을 사용하여 기본 LLAP 리소스 설정을 재정의할 수 있습니다.


| 속성 | 설명 | 
| --- | --- | 
| hive.llap.daemon.yarn.container.mb | 총 LLAP 대몬 컨테이너 크기(MB) | 
| hive.llap.daemon.memory.per.instance.mb |  LLAP 대몬 컨테이너의 실행 프로그램이 사용하는 총 메모리(MB)  | 
| hive.llap.io.memory.size |  LLAP 입력/출력의 캐시 크기  | 
| hive.llap.daemon.num.executors |  LLAP 대몬당 실행 프로그램 수  | 

## 클러스터에서 Hive LLAP 수동으로 시작
<a name="emr-llap-manually"></a>

LLAP에서 사용하는 모든 종속 항목 및 구성은 클러스터 시작 과정에서 LLAP tar 아카이브로 패키징됩니다. `"hive.llap.enabled": "true"`를 사용하여 LLAP를 활성화한 경우 Amazon EMR 재구성을 사용하여 LLAP의 구성을 변경하는 것이 좋습니다.

이렇게 하지 않고 `hive-site.xml`을 수동으로 변경하려면, 다음 예제와 같이 `hive --service llap` 명령을 사용하여 LLAP tar 아카이브를 다시 빌드해야 합니다.

```
# Define how many resources you want to allocate to Hive LLAP

LLAP_INSTANCES=<how many llap daemons to run on cluster>
LLAP_SIZE=<total container size per llap daemon>
LLAP_EXECUTORS=<number of executors per daemon>
LLAP_XMX=<Memory used by executors>
LLAP_CACHE=<Max cache size for IO allocator>

yarn app -enableFastLaunch

hive --service llap \
--instances $LLAP_INSTANCES \
--size ${LLAP_SIZE}m \
--executors $LLAP_EXECUTORS \
--xmx ${LLAP_XMX}m \
--cache ${LLAP_CACHE}m \
--name llap0 \
--auxhbase=false \
--startImmediately
```

## Hive LLAP 상태 확인
<a name="emr-llap-check"></a>

Hive를 통해 Hive LLAP의 상태를 확인하려면 다음 명령을 사용합니다.

```
hive --service llapstatus
```

YARN을 사용하여 Hive LLAP의 상태를 확인하려면 다음 명령을 사용합니다.

```
yarn app -status (name-of-llap-service)

# example: 
yarn app -status llap0 | jq
```

## Hive LLAP 시작 또는 중지
<a name="emr-llap-start"></a>

Hive LLAP는 영구 YARN 서비스로 실행되므로 YARN 서비스를 중지하거나 다시 시작하여 Hive LLAP를 중지하거나 다시 시작합니다. 다음 명령은 이를 보여줍니다.

```
yarn app -stop llap0
yarn app -start llap0
```

## Hive LLAP 대몬(daemon) 수 조정
<a name="emr-llap-resize"></a>

LLAP 인스턴스 수를 줄이려면 다음 명령을 사용합니다.

```
yarn app -flex llap0 -component llap -1
```

자세한 내용은 [서비스 구성 요소 Flex](https://hadoop.apache.org/docs/r3.2.1/hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html#Flex_a_component_of_a_service)를 참조하세요.