Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How can I get fsimage with curl command?

avatar
Contributor

I authenticated with hadoop-admin user.

 

hdfs dfsadmin -fetchImage ./output

 

command works well.

 

However, when I try to do this with curl command, 

 

curl https://{namenode_address}:9470/imagetransfer?getimage=1&txid=latest

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 Authentication required</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /imagetransfer. Reason:
<pre> Authentication required</pre></p>
</body>
</html>

 

Which authentication is needed additionally?

2 REPLIES 2

avatar
Expert Contributor

Hi @sipocootap2 ,

 

AFAIK "/getimage" is deprecated in CDH and we suggest this not to be used. Instead you can use the command "hdfs dfsadmin -fetchImage <dir>" to download & save the latest fsimage.

 

Based on research, in earlier versions of CDH, the getImage method was available after which a need was realized to provide a proper command/utility to download the FSimage and as a result of which "hdfs dfsadmin -fetchImage" was born. Once that was put in place, the getImage was removed.

 

Does that answers your questions ? If yes, feel free to mark this post as "accept as solution"

 

Regards,

 

 

avatar
Contributor

Hi @kingpin.

Thanks for the reply.

Is there an official document that "/getimage" is deprecated? Cause I couldn't find it.

When I run "hdfs dfsadmin -fetchImage" command, it also calls the same curl command.

I could get fsimage with hdfs command, but I want to figure out the reason why curl fails.