Return-Path: Delivered-To: apmail-lucene-hadoop-user-archive@locus.apache.org Received: (qmail 5822 invoked from network); 30 Nov 2007 14:49:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2007 14:49:03 -0000 Received: (qmail 7556 invoked by uid 500); 30 Nov 2007 14:48:50 -0000 Delivered-To: apmail-lucene-hadoop-user-archive@lucene.apache.org Received: (qmail 7138 invoked by uid 500); 30 Nov 2007 14:48:49 -0000 Mailing-List: contact hadoop-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-user@lucene.apache.org Delivered-To: mailing list hadoop-user@lucene.apache.org Received: (qmail 7129 invoked by uid 99); 30 Nov 2007 14:48:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2007 06:48:49 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ryanwang.email@gmail.com designates 66.249.92.175 as permitted sender) Received: from [66.249.92.175] (HELO ug-out-1314.google.com) (66.249.92.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2007 14:48:30 +0000 Received: by ug-out-1314.google.com with SMTP id m3so932916ugc for ; Fri, 30 Nov 2007 06:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=TlwanhJvdjSS8DD+rnpFOoQC86WEE9H074FwQPyAkJ0=; b=uez5c25ojMFzKrbPOcgBClkNrFnd4g2i2F92jX9wLnMg+PwJwyWk8ylVI/AXNfdbpjk0zOVQdwUx6+EAvyGSuvc6S+BsYLJoyw5f9fsMGImllIlgTpHVHkw9f6MGGF90omUeATA9lhTbZrFwf85RmxR9hUBw3wydiFofsupqbZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:mime-version:content-type; b=kP900FY7RuexEdQX115byECsIi7i2y4CJhEzmr7Mi/HHjyVtZ9YnPl6sfx1Ar+p+PMkbyg7G9LwZFHivH5wRGKPj3foTCytyADwvWJWidYp+Du/L80MjTQK9Qpw0Z8I7E4UepM3LDwU3sZSAPKRwfjZwIbVJs1YB8Y5XYHX7X1s= Received: by 10.151.9.1 with SMTP id m1mr376923ybi.1196434111004; Fri, 30 Nov 2007 06:48:31 -0800 (PST) Received: by 10.150.190.4 with HTTP; Fri, 30 Nov 2007 06:48:30 -0800 (PST) Message-ID: <69c373560711300648y48b17b01j293d5dfb0fa8c0dd@mail.gmail.com> Date: Fri, 30 Nov 2007 22:48:30 +0800 From: "Ryan Wang" To: hadoop-user@lucene.apache.org Subject: Any one can tell me about how to write to HDFS? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3206_19530005.1196434110946" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_3206_19530005.1196434110946 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I can communicate with the file system via shell command, and it worked corretly. But when I try to write program to write file to the file system, it failed. public class HadoopDFSFileReadWrite { public static void main(String[] argv) throws IOException { Configuration dfsconf = new Configuration(); FileSystem dfs = FileSystem.get(dfsconf); Path inFile = new Path(argv[0]); Path outFile = new Path(argv[1]); dfs.copyFromLocalFile(inFile, outFile); } } argv[0]=nutch/search/bin/javalibTest.tar.gz argv[1]=ryan/test.tar.gz The program write the javalibTest.tar.gz to the Project's Dir/ryan/test.tar.gz I also placed the file modified hadoop-site.xml to the Project 's Path? I don't know why? anyone could help me out ? Thanks Ryan ------=_Part_3206_19530005.1196434110946--