Why hive-0.13.1 is slow to start
The discovery time is mainly consumed in the following three places:
1. When hadoopjar is used, upload the relevant jar package to HDFS (which consumes about 5 s and is similar to hive0.11, which is not well optimized)
2. When hive CLI is started and hivemetastore is initialized, the following three methods are called during init to create default dB, role, and Admin.
Code:
Synchronized (hmshandler. Class ){
Createdefaultdb ();
Createdefaultroles ();
Addadminusers ();
} Synchronized (hmshandler. Class ){
Createdefaultdb ();
Createdefaultroles ();
Addadminusers ();
}
The generate environment is available and does not need to be created every time. You can comment it out directly here.
3. Another 5 S is caused by loading the. hiverc file.
When performing analyze of the create function, metadata is operated through the addentities method of the functionsemanticanalyzer class. This method is not available in hive0.11.
This method is related to the function permission, which is not required currently.
Add writeentities to the semantic analyzer to restrict function creation to priviligedusers.
In the test environment, no impact is found after you directly comment out.
The specific implementation is analyzed later.
Solution:
14/09/0116:06:12 info configuration. deprecation: mapred. Reduce. tasks is deprecated. Instead, use mapreduce. Job. CES
14/09/0116:06:12 info configuration. deprecation: mapred. Min. Split. size is deprecated. Instead, use mapreduce. Input. fileinputformat. Split. minsize
14/09/0116:06:12 info configuration. deprecation: mapred.performance.tasks.speculative.exe cution is deprecated. Instead, usemapreduce. Reduce. Speculative
14/09/0116:06:12 info configuration. deprecation: mapred. Min. Split. Size. Per. node isdeprecated. Instead, use mapreduce. Input. fileinputformat. Split. minsize. Per. Node
14/09/0116:06:12 info configuration. deprecation: mapred. Input. dir. Recursive isdeprecated. Instead, use mapreduce. Input. fileinputformat. Input. dir. Recursive
14/09/0116:06:12 info configuration. deprecation: mapred. Min. Split. Size. Per. Rack isdeprecated. Instead, use mapreduce. Input. fileinputformat. Split. minsize. Per. Rack
14/09/0116:06:12 info configuration. deprecation: mapred. Max. Split. size is deprecated. Instead, use mapreduce. Input. fileinputformat. Split. maxsize
14/09/0116:06:12 info configuration. deprecation: mapred. Committer. Job. setup. Cleanup. needed is deprecated. Instead, usemapreduce. Job. Committer. setup. Cleanup. Needed
Logginginitialized using configuration infile:/usr/local/hive-0.13.0/CONF/hive-log4j.properties
Hive>
The preceding startup information is:
MySQL initialization information,
You need to set MySQL service to start automatically
Slow startup of hive CLI