vincent@ubuntu:~$ tar -xf jdk-7u25-linux-i586.tar.gz
vincent@ubuntu:~$ ls
Desktop examples.desktop Music Templates
Documents jdk1.7.0_25 Pictures Videos
Downloads jdk-7u25-linux-i586.tar.gz Public
vincent@ubuntu:~$ cd jdk1.7.0_25/
vincent@ubuntu:~/jdk1.7.0_25$ cd bin
vincent@ubuntu:~/jdk1.7.0_25/bin$ ./java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)
配置JDK variables
12345678910111213
vincent@ubuntu:~$ vi .bashrc
# export my own variables
JAVA_HOME=/home/vincent/jdk1.7.0_25
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
vincent@ubuntu:~$ source .bashrc
vincent@ubuntu:~$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)
The main goal of this tutorial is to get a simple Hadoop installation up and running so that you can play around with the software and learn more about it.
9.3 添加Hadoop专用user
1234567891011121314151617181920212223242526
vincent@ubuntu:~$ sudo addgroup hadoop
[sudo] password for vincent:
Adding group `hadoop' (GID 1001) ...
Done.
vincent@ubuntu:~$ sudo adduser --ingroup hadoop hduser
Adding user `hduser' ...
Adding new user `hduser' (1001) with group `hadoop' ...
Creating home directory `/home/hduser' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
Sorry, passwords do not match
passwd: Authentication token manipulation error
passwd: password unchanged
Try again? [y/N] y
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for hduser
Enter the new value, or press ENTER for the default
Full Name []: hadoop user
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
hduser@ubuntu:~$ ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hduser/.ssh/id_rsa):
Created directory '/home/hduser/.ssh'.
Your identification has been saved in /home/hduser/.ssh/id_rsa.
Your public key has been saved in /home/hduser/.ssh/id_rsa.pub.
The key fingerprint is:
9f:28:f3:80:ae:6c:64:d6:78:74:74:67:fa:21:91:f3 hduser@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| . |
| . = o |
| . . B |
| . . o E |
| + . So . |
| = o. o.. |
| + .. + . o |
| ... = |
| .o.. . |
+-----------------+
hduser@ubuntu:~$ ll
hduser@ubuntu:~$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
//测试是否可以无密码登录
hduser@ubuntu:~/.ssh$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is 47:6b:7b:a6:e4:80:38:96:f9:9c:a3:58:48:f4:51:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Last login: Wed Jul 31 01:38:45 2013 from gjia2d.ptcnet.ptc.com
hduser@ubuntu:~$
// vj, add Hadoop Variables
hduser@ubuntu:~$ vi .bashrc
HADOOP_HOME=/home/hduser/hadoop-2.0.5-alpha
export HADOOP_HOME
JAVA_HOME=/home/vincent/jdk1.7.0_25
export JAVA_HOME
//Some convenient aliases and functions for running Hadoop-related commands
unalias fs &> /dev/null
alias fs="hadoop fs"
unalias hls &> /dev/null
alias hls="fs -ls"
PATH=$PATH:$HADOOP_HOME/bin
export PATH
hduser@ubuntu:~$ hadoop version
Hadoop 2.0.5-alpha
Subversion http://svn.apache.org/repos/asf/hadoop/common -r 1488459
Compiled by jenkins on 2013-06-01T04:05Z
From source with checksum c8f4bd45ac25c31b815f311b32ef17
This command was run using /home/hduser/hadoop-2.0.5-alpha/share/hadoop/common/hadoop-common-2.0.5-alpha.jar
The Hadoop Distributed File System (HDFS) is a distributed file system designed to run on commodity hardware. It has many similarities with existing distributed file systems. However, the differences from other distributed file systems are significant. HDFS is highly fault-tolerant and is designed to be deployed on low-cost hardware. HDFS provides high throughput access to application data and is suitable for applications that have large data sets. HDFS relaxes a few POSIX requirements to enable streaming access to file system data. HDFS was originally built as infrastructure for the Apache Nutch web search engine project. HDFS is part of the Apache Hadoop project, which is part of the Apache Lucene project.