Restart hive service on AWS EMR
Solution 1
Just for those who are gonna come from Google
To restart any EMR service
In order to restart a service in EMR, perform the following actions:
-
Find the name of the service by running the following command:
initctl list
For example, the YARN Resource Manager service is named “hadoop-yarn-resourcemanager”.
-
Stop the service by running the following command:
sudo stop hadoop-yarn-resourcemanager
-
Wait a few seconds, then start the service by running the following command:
sudo start hadoop-yarn-resourcemanager
Note: Stop/start is required; do not use the restart command.
-
Verify that the process is running by running the following command:
sudo status hadoop-yarn-resourcemanager
Check for the process using ps, and then check the log file for any errors in the log directory /var/log/.
Source : https://aws.amazon.com/premiumsupport/knowledge-center/restart-service-emr/
Solution 2
sudo stop hive-metastore
sudo start hive-metastore
Solution 3
On EMR 5.x I have found this to work:
hive --service metastore --stop
hive --service metastore --start
Solution 4
For me this approach worked:
- Get the pid
- Kill the process
- Process restarts by itself
Commands for 1 & 2:
ps aux | grep MetaStore
sudo -u hive kill <pid from above>
Here if you are not familiar with ps
you can use the following command which will show the headers for PID
and only one line of the hive Metastore command:
ps aux | egrep "MetaStore|PID" | grep -v grep
Hive Server restarted by itself. Validate again by ps
the pig would have changed.
ps aux | grep MetaStore
code1234
Updated on June 28, 2022Comments
-
code1234 almost 2 years
I am very new to HIVE as well AWS-EMR. As per my requirement, i need to create Hive Metastore Outside the Cluster (from AWS EMR to AWS RDS). I followed the instruction given in
I made changes in hive-site.xml and able to setup hive metaStore to Amazon RDS mysql server. To bring the changes in action, currently i am rebooting the complete cluster so hive start storing metastore to AWS-RDS. This way it is working.
But i want to avoid rebooting the cluster, is there any way i can restart the service?
-
code1234 over 8 yearsI have stored hive-site.xml in AWS s3 but unable to create new cluster. it gets terminated after some seconds. i followed AWS documentation. link.
-
user3294904 almost 8 years@hadron sudo stop hive-metastore sudo start hive-metastore