• Get Ubuntu Docker

    – docker pull ubuntu

  • Start Container
docker run -i -p 22 -p 8000:80 -m /data:/data -t <ubuntu> /bin/bash
  • Install Jdk
    sudo add-apt-repository ppa:openjdk-r/ppa  
    sudo apt-get update   
    sudo apt-get install openjdk-7-jre
  • .bashrc
    export JAVA_HOME=/usr/lib/jvm/...
    export CLASSPATH=$JAVA_HOME/lib/*:.
    export PATH=$PATH:$JAVA_HOME/bin
  • HADOOP 1.2.1 install

    download hadoop and unpack

    root@4aa2cda88fcc:/home/kim# wget http://apache.mirror.cdnetworks.com/hadoop/common/hadoop-1.2.1/hadoop-1.2.1.tar.gz
    root@4aa2cda88fcc:/home/kim# mv ./hadoop-1.2.1.tar.gz /home/user
    root@4aa2cda88fcc:/home/kim# tar xvzf hadoop-1.2.1.tar.gz
  • SET Configuration

    set configuration on ~/.bashrc

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export CLASSPATH=$JAVA_HOME/lib/*:.
export PATH=$PATH:$JAVA_HOME/bin
export HADOOP_HOME=/home/kim/hadoop-1.2.1
  • set HADOOP conf
vi  /home/hadoop-1.2.1/conf/hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
vi mapred-site.xml

vi hdfs-site.xml

vi core-site.xml

# apt-get install openssh-server
# ssh-keygen -t dsa -P "" -f ~/.ssh/id_dsa
# cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
# vi /etc/ssh/sshd_config 
# ==> PermitRootLogin yes
service ssh restart
# ssh localhost
  • Format namenode
hadoop namenode -format
  •  start & stop Shell script
start-all.sh  (start-dfs.sh + start-mapred.sh) 

# check java apllication is running 

  • search hadoop files
hadoop fs -ls /
  • upload local file to hadoop
hadoop fs -copyFromLocal README.txt /
  • Execute word count
hadoop jar hadoop-examples-1.2.1.jar wordcount /README.txt /output_wordcount

working on find way to use “docker exec -ti containername sh"

Categories: Hadoop

Leave a Reply

Your email address will not be published. Required fields are marked *