企业实训笔记(一)安装配置Zeppelin 【前】
首先启动三台虚拟机,打开后,打开MobaXterm,;
先后打开:
- 开启集群 /export/server/hadoop-3.1.4/sbin/start-all.sh
- 启动 metastore 服务器
nohup /export/server/hive-3.1.2/bin/hive --service metastore > ./metastore.log 2>&1 &
nohup /export/server/hive-3.1.2/bin/hive --service hiveserver2 > ./hiveserver2 2>&1 &
3. jps -m 查看是否全部启动 出现两个runjar 以及 namenode \secondnode等都已存在即可。
4. 查看端口号是否开启10000
netstat -anp | grep 10000
![在这里插入图片描述](https://img-blog.csdnimg.cn/610e049f9af44eb6a0b37abbfa715ac2.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bCx5oOz5YGa5LiA5p2h6Zey6bG8,size_20,color_FFFFFF,t_70,g_se,x_16)
9-15视频(六)
一、
首先先进入beeline
/export/server/hive-3.1.2/bin/beeline
其次连接jdbc
!connect jdbc:hive2://node1:10000
Next:
#建立一个外部表
- create external table hive_array(name string, work_location array<string>)
row format delimited fields terminated by '\t'
collection items terminated by ',';
访问hadoop browser
192.168.88.100:9870
在此网页上上传文件array_data.txt
- 查找数据表第一个数据(如何查找数组中的元素)
select name,work_location[0] from hive_array;
- 请找出表中曾经在天津工作过的人来;
(用where 语句查询包含关系)
select * from hive_array where array_contains(work_location,'tianjin')
二、
- 打开另一个node3,上传hive
先新建一个文件夹 注意地址!!!
mkdir -p /export/software
mkdir -p /export/server
cd /export/software/ll
查看已存在~
- 解压
tar zxvf apache-hive-3.1.2-bin.tar.gz -C /export/server/