storing and retrieving images in/from HDFS

1,171 views
Skip to first unread message

Rajasri

unread,
Jan 2, 2013, 11:55:18 PM1/2/13
to chenn...@googlegroups.com
hi all...I am using hadoop 0.20.1. I successfully stored image into hdfs. But while retrieving, an image file is created in the local file system. But when i try to open that image file i am getting an error stating "Could not load image. Image loading failed". I have attached the code's screenshot below for further reference.Thanks in advance!!

screensht.png

Rajasri

unread,
Jan 3, 2013, 12:40:21 AM1/3/13
to chenn...@googlegroups.com
 The problem here is, only the file is getting created in both hdfs and in local file system..I have created only the objects to input n output stream...what function should i use to write image contents into hdfs? Thanks in advance!
Regards,
Rajasri
hdfscontents.png

Vallarasu S

unread,
Jan 3, 2013, 1:20:20 AM1/3/13
to chenn...@googlegroups.com
Hello there,

Greetings, Can some one please point me to any resource on how to install and configuring Eclipse on ubutu to work with Hadoop?

forgive me if it sounds silly.

Thanks,
Vasu


Ashwanth Kumar

unread,
Jan 3, 2013, 1:24:14 AM1/3/13
to chenn...@googlegroups.com
When you create the file you get an instance of FSDataOutputStream,
this extends java's Outputstream. You can use the traditional write()
method. Same is with the FSDataInputStream.

_Sample Example_ can be found at http://pastebin.com/tTQvwmEN

Sai Sivam

unread,
Jan 3, 2013, 12:41:29 AM1/3/13
to chenn...@googlegroups.com
HDFS is different from Ext FS you use.

$ hadoop dfs -copyFromLocal local-image.jpg dfs-image.jpg
$ gimp dfs-image.jpg # will not work
> --
>
>

Sai Sivam

unread,
Jan 3, 2013, 12:43:58 AM1/3/13
to chenn...@googlegroups.com

Srinivasan Ramalingam

unread,
Jan 3, 2013, 2:07:06 AM1/3/13
to chenn...@googlegroups.com
Hai valla,
     i will try to help you.please follow the below steps
1.Download the eclipse helios for linux version(http://www.eclipse.org/downloads/packages/release/helios/sr2)
2.install the eclipse from ubuntu
3.Download the hadoop plugin(http://code.google.com/p/hadoop-eclipse-plugin/downloads/detail?name=hadoop-0.20.1-eclipse-plugin.jar&can=2&q=)
4.copy the hadoop plugin adn paste it in eclipse/plugin folder.
5.that is it


--
 
 

Srinivasan Ramalingam

unread,
Jan 3, 2013, 2:15:09 AM1/3/13
to chenn...@googlegroups.com
install the eclipse from ubuntu{http://colinrrobinson.com/technology/install-eclipse-ubuntu/}

On Thu, Jan 3, 2013 at 12:37 PM, Srinivasan Ramalingam <eceseen...@gmail.com> wrote:
install the eclipse from ubuntu

Rajasri janakiraman

unread,
Jan 3, 2013, 8:39:52 AM1/3/13
to chenn...@googlegroups.com
u needn't strain much...just go to built in ubuntu software center...From there select Eclipse / search for eclipse there. It will  get downloaded and installed and to access hadoop from eclipse, download "org.apache.hadoop" jar and add that as external jar to the required program (in eclipse) from which u wish to access hadoop /hdfs..This is my suggestion...let me know if there is any error in this method..



--
 
 

Nagarajan B

unread,
Jan 3, 2013, 11:47:16 AM1/3/13
to chenn...@googlegroups.com
You can simply type the command sudo apt-get install eclipse.... This is how i installed eclipse in my machine.


Thanks
Nagu.

Vallarasu S

unread,
Jan 3, 2013, 12:32:17 PM1/3/13
to chenn...@googlegroups.com
Thank everyone for your time and patience.

Since I'm completely new to ubuntu I've followed Srinivasan Ramalingam links which had step by step guides.

Everything went well but finally throws this error when invoking eclipse

vasu@ubuntu:~$ /opt/eclipse/eclipse -clean &
[1] 3758
vasu@ubuntu:~$ bash: /opt/eclipse/eclipse: cannot execute binary file

How should I rollback if I wish to follow other instructions?

Thanks,
 - Vasu

Date: Thu, 3 Jan 2013 22:17:16 +0530
Subject: Re: Eclipse installation and configuration
From: naguh...@gmail.com
To: chenn...@googlegroups.com


You can simply type the command sudo apt-get install eclipse.... This is how i installed eclipse in my machine.


Thanks
Nagu.

--
 
 

Rajasri janakiraman

unread,
Jan 3, 2013, 11:52:09 PM1/3/13
to chenn...@googlegroups.com
Thanks u sir...Its working..:)



--



Rajasri

unread,
Jan 21, 2013, 9:28:35 AM1/21/13
to chenn...@googlegroups.com, ashwan...@googlemail.com
 I tried the coding which u gave me about a month back (in the below link).It worked fine. But now if i run, a copy(image) is created in the local system. But when i access my HDFS using localhost, i cannot see the file. What should i do now?

Ashwanth Kumar

unread,
Jan 22, 2013, 1:20:08 AM1/22/13
to Rajasri, chenn...@googlegroups.com
Check the "destinationPath"on the local filesystem, to see if the File is created on the local FS instead of HDFS. Then may be your configuration is not loaded properly to have NN address. This typically happens if you don't add the config resources / run it directly from an IDE.
--

Ashwanth Kumar / ashwanthkumar.in

Reply all
Reply to author
Forward
0 new messages