In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to specify a log directory for the Hive CLI runtime". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to specify a log directory for the Hive CLI runtime.
1. Purpose of document writing
When using the Hive CLI client to execute the SQL statement, the default log output is under the / tmp/$ {user} / directory. Due to the limited space of the tmp directory, you need to specify a log output directory for the Hive CLI client, but configuring the log output directory for the Hive CLI client is not supported on Cloudera Manager. This article, Fayson, focuses on how to specify a log output directory for the Hive CLI runtime.
Content Overview
1. Specify log output directory
two。 Summary
Test environment
1.RedHat7.3
Version 5.15 for 2.CM and CDH
two。 Specify log output directory
1. Create a directory for storing Hive CLI client logs
[root@cdh03 conf] # mkdir-p / data/disk1/hive-log/
[root@cdh03 conf] # chmod 777 / data/disk1/hive-log
[root@cdh03 conf] #
(can slide left and right)
two。 Add the-- hiveconf parameter to the hive command to specify the log output directory
[root@cdh03 ~] $hive--hiveconf hive.log.dir=/data/disk1/hive-log/$USER
(can slide left and right)
After the command runs successfully, the hive.log log file is generated in the / data/disk1/hive-log/$USER directory.
3. To facilitate the need not to specify the log output directory each time with the hive command, create an alias for the hive command in Shell
Edit the / etc/profile file and add the following at the end of the file:
Alias hive= "hive--hiveconf hive.log.dir=/data/disk1/hive-log/$USER"
(can slide left and right)
Execute the source / etc/profile command to make the environment variable take effect immediately, and execute the hive command to verify whether it is valid.
3. Summary
1. You cannot configure the log output directory for the Hive CLI client through Cloudera Manager, you can only add parameters to the command line to specify the log output directory.
two。 When specifying the log output directory, you need to consider the permissions of the log output directory (for example: / data/disk1/hive-log). Considering different user runs, the $USER variable is added to the specified log output directory.
3. In order not to specify the log output directory every time you run the hive command, the log output directory is solidified in the environment variable by adding the alias of hive to the environment variable of OS.
At this point, I believe you have a deeper understanding of "how to specify a log directory for the Hive CLI runtime". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.