Support Questions

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

How to delete smartsense registered agents in hst list-agents?

avatar
Rising Star

HDP 2.4.3

SmartSense 1.3.1.0-136

For example,

I got 5 nodes and setup like this cluster firstly.

Hadoop Cluster

/etc/hosts

10.10.x.x MASTER1.hadoop.com master1

10.10.x.x MASTER2.hadoop.com master2

10.10.x.x SLAVE1.hadoop.com slave1

10.10.x.x SLAVE2.hadoop.com slave2

10.10.x.x SLAVE3.hadoop.com slave3

/etc/sysconfig/network

hostname=FQDN for all servers

And installed ambari and hdp with smartsense.

And then changed every node's FQDN name in "/etc/hosts and /etc/sysconfig/network" Uppercase to Lowercase.

ex. MASTER1.hadoop.com -> master1.hadoop.com

But I got these issues from smartsense view.

Hosts registered in Ambari and SmartSense do not match

........ command hostname -f ........

Also returned these results after executed command "hst list-agents"

MASTER1.hadoop.com

master1.hadoop.com

MASTER2.hadoop.com

master2.hadoop.com

SLAVE1.hadoop.com

slave3.hadoop.com

SLAVE2.hadoop.com

slave2.hadoop.com

SLAVE3.hadoop.com

slvae3.hadoop.com

How to delete all upppercase fqdn lists?

1 ACCEPTED SOLUTION

avatar
Rising Star

@Peter Kim

The issue is caused by mismatch in hostnames in Ambari and Smartsense. You can use below doc to update the name in Ambari

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.0.3/bk_ambari-administration/content/ch_changin...

You can also try to deregister and register agent again with below steps

If the host is no more accessible, use CURL command to unregister the host from SmartSense For example,

curl -u admin:admin -X PUT -d "{\"status\":\"UNREGISTERED\"}" http://HST_SERVER:9000/api/v1/agents/<AGENT_HOSTNAME> 

In case a node in the HDP cluster is not listed by hst list-agents command, then it can be added to SmartSense using the following command or using Ambari Host UI add Service option:

# hst setup-agent 
Enter SmartSense Tool Server hostname: HST_SERVER

View solution in original post

6 REPLIES 6

avatar
Master Guru

You will need to tell Ambari about hostname changes. Try "ambari-server update-host-names", details here. Without the update other services don't work well either, for example HBase most likely lists 2 times more Region servers etc.

avatar
Rising Star

Is there a nicely way to clean up old fqdns only from hst? Cause' originally, as I know, hadoop achitecture is handling Uppercase and Lowercase FQDN names well without any issues.

avatar
Rising Star

Hm,,It's not working.

I run that procedures, and I got same issues.

Duplicated fqdn's Uppercase and Lowercase names still exist.

Backup ambari-db server.

Stop all services

Stop ambari-server

Stop all amabri-agent

ambari-server update-host-names new_hosts.json

After update-host-names completed successfully, I got same return values from hst list-agents

avatar
Rising Star

@Peter Kim

The issue is caused by mismatch in hostnames in Ambari and Smartsense. You can use below doc to update the name in Ambari

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.0.3/bk_ambari-administration/content/ch_changin...

You can also try to deregister and register agent again with below steps

If the host is no more accessible, use CURL command to unregister the host from SmartSense For example,

curl -u admin:admin -X PUT -d "{\"status\":\"UNREGISTERED\"}" http://HST_SERVER:9000/api/v1/agents/<AGENT_HOSTNAME> 

In case a node in the HDP cluster is not listed by hst list-agents command, then it can be added to SmartSense using the following command or using Ambari Host UI add Service option:

# hst setup-agent 
Enter SmartSense Tool Server hostname: HST_SERVER

avatar
Rising Star

Thanks, prsingh. I think, CURL command is the correct way to clean delete old fqdn list in HST.

And it works clearly.

avatar
Rising Star

If the agent node is registered and is available, you can login into that node and use "hst unregister-agent"