Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive : Not able to delete mysqlserver from amari

avatar
Contributor

73396-mysqlserver.jpg

Hi,

I moved "mysqlserver" to node2 from node1 in hive using ambari. In between mysqlserver install got failed.

Mysqlserver moved to node2 but existing node1 mysqlserver has not been deleted. I tried to delete using ambari. But delete option is disable. Please check the attached screenshot.

Looking for your reply.

1 ACCEPTED SOLUTION

avatar
Contributor

We can check any client/service for the node using the below url.

 http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components

The below commands will be used for deleting client/service.

Here PANDA is cluster name. ambari_host is ambari_server_host. host_name is fqdn of host name.

export AMBARI_USER=rambabu 
export AMBARI_PASSWD=password 

curl -u $AMBARI_USER:$AMBARI_PASSWD -H 'X-Requested-By: ambari' -X GET "http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components/MYSQL_SERVER" 

curl -u $AMBARI_USER:$AMBARI_PASSWD -H 'X-Requested-By: ambari' -X DELETE "http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components/MYSQL_SERVER"

View solution in original post

8 REPLIES 8

avatar
Explorer

Hi, your MySQL Service is part of your Hive Service. You can't only delete the MySQL Service.

avatar
Contributor

We can delete kevin han. If you want you can check my solution. It worked for me.

avatar
Expert Contributor

As mentioned before, make sure your Hive Service is connected to the new location of MySQL. Removing MySQL without will result in losing all you metadata.

You can use Ambari REST API to remove services manually:

curl -u admin:admin -H "X-Requested-By: ambari"-X DELETE http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICENAME

https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+compon...

avatar
Contributor

Thanks Umair Khan. I got the solution.

avatar
Contributor

We can check any client/service for the node using the below url.

 http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components

The below commands will be used for deleting client/service.

Here PANDA is cluster name. ambari_host is ambari_server_host. host_name is fqdn of host name.

export AMBARI_USER=rambabu 
export AMBARI_PASSWD=password 

curl -u $AMBARI_USER:$AMBARI_PASSWD -H 'X-Requested-By: ambari' -X GET "http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components/MYSQL_SERVER" 

curl -u $AMBARI_USER:$AMBARI_PASSWD -H 'X-Requested-By: ambari' -X DELETE "http://ambari_host:8080/api/v1/clusters/PANDA/hosts/host_name/host_components/MYSQL_SERVER"

avatar
Explorer

Good to know. Thanks for sharing! I will give a try.

avatar
Master Mentor

Not sure that solutio will work 🙂

avatar
Contributor

I tried and verified in my 10 node cluster. It worked perfectly.