centos6.9安装hive
时间: 2024-12-20 20:13:30 浏览: 7
centos 6.9安装opencv 3.4
CentOS 6.9安装Hive(Hadoop Hive)通常需要几个步骤:
1. **更新包管理器**:
```sh
sudo yum update -y
```
2. **安装Java Development Kit (JDK)**:因为Hive依赖于Java。你可以从Oracle官网下载并设置环境变量,例如:
```sh
sudo mkdir /opt/jdk
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u40-b25/jdk-8u40-linux-x64.rpm -P /opt/jdk
sudo rpm -Uvh /opt/jdk/jdk-*.rpm
export JAVA_HOME=/opt/jdk/jdk1.8.0_*
export PATH=$JAVA_HOME/bin:$PATH
```
3. **添加Hive仓库**:
```sh
wget http://public-repo-1.hortonworks.com/HDP Hortonworks Repository/releases/2.x/yum/hdp.repo -O /etc/yum.repos.d/hdp.repo
```
4. **安装Hive**:
```sh
sudo yum install hive hadoop-hdfs.hadoop-client -y
```
5. **启动服务**:
```sh
sudo service hdfs namenode start
sudo service hdfs datanode start
sudo service yarn resourcemanager start
sudo service hive-server2 start
```
6. **配置环境变量**:
需要在`~/.bashrc`或其他启动文件中添加Hive的环境变量。
7. **初始化Hive Metastore**:
```sh
hive --service metastore
```
8. **验证安装**:
运行命令 `beeline` 或者 `hive` 来连接到Hive shell并测试是否能正常工作。
阅读全文