虚拟机镜像安装
- 下载
https://downloads.cloudera.com/demo_vm/vmware/cloudera-quickstart-vm-5.8.0-0-vmware.zip
https://downloads.cloudera.com/demo_vm/vmware/cloudera-quickstart-vm-5.12.0-0-vmware.zip
https://downloads.cloudera.com/demo_vm/vmware/cloudera-quickstart-vm-5.13.0-0-vmware.zip
- 将虚拟机镜像文件压缩包解压得到cloudera-quickstart-vm-5.8.0-0-vmware文件夹
- 打开VMware,File -> Open,选择刚才解压的文件夹,选择cloudera-quickstart-vm-5.8.0-0-vmware.vmx
- 设置虚拟机内存为2cores、8G内存以上
- 启动虚拟机
cloudera-quickstart-vm的使用
1.1 用户说明
Ø 该镜像的OS用户包括root/cloudera和cloudera/cloudera。
Ø Hue UI的用户名和密码是cloudera/cloudera。
Ø 如果还有其它用户,那么用户名和密码都应该是cloudera/cloudera,比如Cloudera Manager。
1.2 运行环境
启动后的VM截图如下所示:
点击Launch Cloudera Express,开始启动。
启动完成后,控制台会打印访问地址和账号密码
CDH manager地址
quickstart.cloudera:7180/cmf/login
账号和密码均为:cloudera
进来后即可看到服务页面。
默认各个组件都是未启动的,需要选择需要的组件启动。
Hive相关使用
启动 Zookeeper、HDFS、YARN、Hive
如下图所示
hive jdbc连接:
url:jdbc:hive2://192.168.110.132:10000/default
用户:hdfs
POM依赖
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>1.1.0</version>
<!--<version>1.1.0</version>-->
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<artifactId>hadoop-hdfs</artifactId>
<groupId>org.apache.hadoop</groupId>
</exclusion>
<exclusion>
<artifactId>*</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.6.0</version>
<exclusions>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
hive命令行连接:
注意:要指定hdfs用户,否则没有写入权限
beeline -n hdfs -u jdbc:hive2://localhost:10000