Bash语言:
sudo apt-get install -y openjdk-7-jdk openssh-server
sudo addgroup hadoop
sudo adduser —ingroup hadoop hadoop # create password
sudo visudo
hadoop ALL=(ALL) ALL # hadoop user can use sudo
su - hadoop # need password
ssh-keygen -t rsa -P "" # Enter file (/home/hadoop/.ssh/id_rsa)
cat /home/hadoop/.ssh/id_rsa.pub >> /home/hadoop/.ssh/authorized_keys
wget http://apache.fayea.com/apache-mirror/hadoop/common/hadoop-2.3.0/hadoop-2.3.0.tar.gz
tar zxvf hadoop-2.3.0.tar.gz
sudo cp -r hadoop-2.3.0/ /opt
cd /opt
sudo ln -s hadoop-2.3.0 hadoop
sudo chown -R hadoop:hadoop hadoop-2.3.0
sed -i '$a \\nexport JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64' hadoop/etc/hadoop/hadoop-env.sh