hive版本:1.2.1
执行过程:登录hive,执行查询语句:
hive> use test01
> ;
OK
Time taken: 0.894 seconds
hive> select * from employee a left join employee b on a.eud=b.eud;
之后报错信息如下:
登录提示URL查看详情:
看样子问题是这个了:
Diagnostics: Application application_1578127231878_0001 initialization failed (exitCode=255) with output: User hive not found
百度一圈后,啥也没查出来,但是分析看样子是缺少hive用户,我hive是在单节点上部署的,分析是否需要在集群上都存在hive用户呢?毕竟执行MR是需要hdfs和yarn的,因此在集群上其他各个节点新建hive用户并赋予密码,外加集群节点之间免密:
[root@test-02 ~]# useradd hive
[root@test-02 ~]# passwd hive
Changing password for user hive.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@test-02 ~]# su hive
[hive@test-02 /root]$ cd
[hive@test-02 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hive/.ssh/id_rsa):
Created directory '/home/hive/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hive/.ssh/id_rsa.
Your public key has been saved in /home/hive/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:5shXukgc1V01bzx3A+bPzAMAIwlyuVcyKAV+xm7HJUw hive@yc-test-02
The key's randomart image is:
+---[RSA 2048]----+
| oo++E.o.. o.o.|
| ..+oo+.o..+...o|
| ..+.o=.. .o o*|
| +..oo *.=|
| oooS . * |
| .o.= o .|
| = + |
| . o . |
| . . |
+----[SHA256]-----+
[hive@test-02 ~]$ ssh-copy-id -i /home/hive/.ssh/id_rsa.pub 172.18.0.3
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/hive/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
hive@172.18.0.3's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '172.18.0.3'"
and check to make sure that only the key(s) you wanted were added.
[hive@test-02 ~]$ ssh-copy-id -i /home/hive/.ssh/id_rsa.pub 172.18.0.2
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/hive/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
hive@172.18.0.2's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '172.18.0.2'"
and check to make sure that only the key(s) you wanted were added.
其他节点类似操作。
用户创建好之后再次尝试查询语句:
看样子问题是解决了!这个问题居然困扰了我近一个小时,看来以后分析问题还得从问题本身出发,不能太过依赖百度!