Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D14B010BA0 for ; Wed, 17 Dec 2014 22:58:26 +0000 (UTC) Received: (qmail 96213 invoked by uid 500); 17 Dec 2014 22:58:19 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 96107 invoked by uid 500); 17 Dec 2014 22:58:19 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 96096 invoked by uid 99); 17 Dec 2014 22:58:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2014 22:58:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of wilm.schumacher@gmail.com designates 209.85.212.169 as permitted sender) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2014 22:58:12 +0000 Received: by mail-wi0-f169.google.com with SMTP id r20so18566020wiv.2 for ; Wed, 17 Dec 2014 14:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=KmdGzDyChb/znaVY+8a7tgJFjst6ARyt7vPXUlnPXjM=; b=IKnXDoPJBjMOOLZkka3tqWQBmcCxbEnsInOqyrAEGseZ6k7/5wd3Q8qtaqxeLoK5DN PKkl889z9oXHRe9PZCDdizxsn5Dil7G0gjdZm3sgNZ5X8byLYVnBA41VsSjTtDYhGTVc Vaj4vPSdm0y6KmN/2ndpg5NEbDVUyxokPDIOI2b+xse73NY1Jdf/IpKZv23Wb3c1Fpox 8LnCu9IXCfLBtZMOeC2Usx7b/2m0wQkRP8kGg9S3gWbjkDKE709HeGURkyB4BE2ChLmt L7N+mdC7j9gjqNTMg6z8rdy3SuNt3iXgo/em/GvBImp7gkVZW8NR7HB0ckep6hStXdYx 1YgQ== X-Received: by 10.180.24.167 with SMTP id v7mr19152316wif.5.1418856936194; Wed, 17 Dec 2014 14:55:36 -0800 (PST) Received: from [192.168.1.2] (i5E86DF67.versanet.de. [94.134.223.103]) by mx.google.com with ESMTPSA id b10sm7801053wiw.9.2014.12.17.14.55.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Dec 2014 14:55:35 -0800 (PST) Message-ID: <54920A07.1030304@gmail.com> Date: Wed, 17 Dec 2014 23:56:07 +0100 From: Wilm Schumacher User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: user@hadoop.apache.org Subject: Re: Copying files to hadoop. References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Am 17.12.2014 um 23:29 schrieb Anil Jagtap: > Dear All, > > I'm pretty new to Hadoop technology and Linux environment hence > struggling even to find solutions for the basic stuff. > > For now, Hortonworks Sandbox is working fine for me and i managed to > connect to it thru SSH. > > Now i have some csv files in my mac os folders which i want to copy > onto Hadoop. As per my knowledge i can copy those files first to Linux > and then put to Hadoop. But is there a way in which just in one > command it will copy to Hadoop directly from mac os folder? yes, there is. cat /path/to/your/local/file.csv | ssh hadoopuser@namenode "/remote/server/path/to/hadoop fs -put - /hadoop/folder/name/file.csv" As you wrote, that you are also new to linux/unix, this above means: * cat => concanate the files (only one file given) and print to standard output * pipe | => means, write the standard output from the left hand to the standard input of the right hand side * ssh reads from standard input and writes its to the standard input on the remote server command, which is hadoop fs put command, which is told to read from stdin Thus you are actually piping the content of the file through 3 services. And that's actually a little bit of a hack and in my opinion there is no reason to do this if your file is reasonable small to fit on the remote server. It's like asking "is it possible to reach my destination only using left turns". Well ... it's possible, but not always a good idea ;). Best Wilm