하이브: 설치

하이브 설치

hadoop 관련 파라미터 수정
1) core-site.xml 수정

<!-- 配置该atguigu(superUser)允许通过代理访问的主机节点 -->
    <property>
        <name>hadoop.proxyuser.atguigu.hosts</name>
        <value>*</value>
    </property>
<!-- 配置该atguigu(superUser)允许通过代理用户所属组 -->
    <property>
        <name>hadoop.proxyuser.atguigu.groups</name>
        <value>*</value>
    </property>
<!-- 配置该atguigu(superUser)允许通过代理的用户-->
    <property>
        <name>hadoop.proxyuser.atguigu.users</name>
        <value>*</value>
</property>

2) Yarn-site.xml 구성

<!-- NodeManager使用内存数,默认8G,修改为4G内存 -->(16g物理内存的改为2g或者是3g)
<property>
	<description>Amount of physical memory, in MB, that can be allocated 
	for containers. If set to -1 and
	yarn.nodemanager.resource.detect-hardware-capabilities is true, it is
	automatically calculated(in case of Windows and Linux).
	In other cases, the default is 8192MB.
	</description>
	<name>yarn.nodemanager.resource.memory-mb</name>
	<value>4096</value>
</property>
<!-- 容器最小内存,默认512M -->
<property>
	<description>The minimum allocation for every container request at the RM	in MBs. 
            Memory requests lower than this will be set to the value of this	property. 
            Additionally, a node manager that is configured to have less memory	than this value
	</description>
	<name>yarn.scheduler.minimum-allocation-mb</name>
	<value>512</value>
</property>

<!-- 容器最大内存,默认8G,修改为4G -->
<property>
	<description>The maximum allocation for every container request at the RM	in MBs. 
            Memory requests higher than this will throw an	InvalidResourceRequestException.
	</description>
	<name>yarn.scheduler.maximum-allocation-mb</name>
	<value>4096</value>
</property>

<!-- 虚拟内存检查,默认打开,修改为关闭 -->(使用虚拟内存)
<property>
	<description>Whether virtual memory limits will be enforced for containers.</description>
	<name>yarn.nodemanager.vmem-check-enabled</name>
	<value>false</value>
</property>

참고: 구성 파일을 수정한 후 배포한 다음 클러스터를 다시 시작해야 합니다.
2.2 Hive 압축해제 및 설치
1) Linux의 /opt/software 디렉터리에 apache-hive-3.1.2-bin.tar.gz를 업로드합니다.

2) /opt/software/ 디렉터리에 있는 apache-hive-3.1.2-bin.tar.gz를 /opt/module/ 디렉터리로 이동합니다. [
atguigu@hadoop102 소프트웨어]$ tar -zxvf apache-hive-3.1.2- bin.tar.gz -C /opt/모듈/

3) 압축이 풀린 디렉터리 이름을 hive
[atguigu@hadoop102 모듈]$ mv apache-hive-3.1.2-bin/ /opt/module/hive로 수정합니다.

4) /etc/profile.d/my_env.sh 파일을 수정하고 환경 변수
[atguigu@hadoop102 hive]$ sudo vim /etc/profile.d/my_env.sh
……
#HIVE_HOME
내보내기 HIVE_HOME 에 하이브의 /bin 디렉터리를 추가합니다. =/opt/module/hive
내보내기 PATH= PATH : PATH:경로 _ _ _: HIVE_HOME/빈

[atguigu@hadoop102 hive]$ 소스 /etc/profile

추천

출처blog.csdn.net/weixin_45427648/article/details/131819199