Hi Folks,
Today we are going for yum installation of CDH4. its pretty easy one.
Requirement
1. Downloading the CDH4 Repo file
NOTE: Please comment you have any problem in it.
Today we are going for yum installation of CDH4. its pretty easy one.
Requirement
- Oracle JDK 1.6
- CentOS 6.4
1. Downloading the CDH4 Repo file
2. Download cloudera cdh4sudo wget -O /etc/yum.repos.d/cloudera-cdh4.repo http://archive.cloudera.com/cdh4/redhat/6/x86_64/cdh/cloudera-cdh4.repo
3. Formatting the namenodesudo yum install hadoop-0.20-conf-pseudo
4.Starting HDFS Services on respective nodessudo -u hdfs hdfs namenode -format
- Namenode Services on Master Node
sudo service hadoop-hdfs-namenode start
sudo service hadoop-hdfs-secondarynamenode start
- Datanode Services on Master Node(becoz its pseudo mode)
5. Creating Hdfs Directories on Mastersudo service hadoop-hdfs-datanode start
sudo -u hdfs hadoop fs -mkdir /tmp6. Creating Map-reduce Directories on Master node
sudo -u hdfs hadoop fs -chmod -R 1777 /tmp
sudo -u hdfs hadoop fs -mkdir /user
sudo -u hdfs hadoop fs -mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging7. Starting Mapreduce Services on master and on Slaves
sudo -u hdfs hadoop fs -chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs hadoop fs -chown -R mapred /var/lib/hadoop-hdfs/cache/mapred
sudo -u hdfs mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs chown hdfs:hadoop /var/lib/hadoop-hdfs/cache/mapred
sudo -u hdfs chown -R mapred /var/lib/hadoop-hdfs/cache/mapred
- JobTracker Services on Master Node
sudo service hadoop-0.20-mapreduce-jobtracker start
- TaskTracker Service on master Node
sudo service hadoop-0.20-mapreduce-tasktracker start
sudo -u hdfs hadoop fs -mkdir /user/$USER9. Update export in .profile
sudo -u hdfs hadoop fs -chown $USER /user/$USER
export HADOOP_HOME=/usr/lib/hadoop10. You can check hdfs directory by
sudo -u hdfs hadoop fs -ls /Try running any sample job by cmd below.
sudo -u hdfs hadoop jar /usr/lib/hadoop-0.20-mapreduce/hadoop-examples.jar pi 5 10
NOTE: Please comment you have any problem in it.
Sir, Please help me regarding following questions. I am in trouble in middle. Thanks in advance.
ReplyDelete1. Why these commands are not running; showing message permission denied. What purpose these sovle.
sudo -u hdfs mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs chown hdfs:hadoop /var/lib/hadoop-hdfs/cache/mapred
sudo -u hdfs chown -R mapred /var/lib/hadoop-hdfs/cache/mapred
2. what is hadoop-env.sh ?
3. Why this command generates message 'testfile.txt':no such file or directory?
sudo -u hdfs hadoop fs -copyFromLocal testfile.txt /user/hdfs/input/
4. Why /user/mapred directory is not shown by this command?
[root@localhost conf]# sudo -u mapred hadoop fs -ls /user/
Found 2 items
drwxr-xr-x - hdfs supergroup 0 2014-04-13 22:58 /user/hdfs
drwxr-xr-x - sudhakar supergroup 0 2014-04-12 13:19 /user/sudhakar
5. These commands are not working; showing message - no such file or directory.
bin/start-all.sh
Also other starting with bin/hadoop.
6. Is it necessary to install any IDE for programming? Can we compile the 3 java files and add the 3 .class files into single jar file and execute it. Compiling javac Mapper.java generates so many errors regarding import hadoop library. Why?
Hi Sudhakar,
Deleteif you have installed everything with root, it should be working check if
$sudo -u hdfs hadoop fs -ls /
showing directories owned by hdfs and superuser. if not then you need to provide your user to sudo access.
2. hadoop-env is used for setting global parameter for hadoop environment.
3. you can try by login into hdfs and copy command with same user like
su - hdfs
$hadoop_home/bin/hadoop fs -copyFromLocal abc.txt /user/hdfs/
4. Check if you have completed step 8 correctly
sudo -u hdfs hadoop fs -mkdir /user/mapred
sudo -u hdfs hadoop fs -chown $USER /user/mapred
5. export HADOOP_HOME=/usr/lib/hadoop
1. Sir, I have tried these commands and results are follows.
ReplyDeletebin/start-all.sh command was not running. Whats the correct way to run this command.
[root@localhost /]# sudo -u hdfs hadoop fs -ls /
Found 3 items
drwxrwxrwt - hdfs supergroup 0 2014-04-12 12:58 /tmp
drwxr-xr-x - hdfs supergroup 0 2014-04-17 11:28 /user
drwxr-xr-x - hdfs supergroup 0 2014-04-12 13:07 /var
[root@localhost /]# sudo -u hdfs hadoop fs -ls /user/
Found 3 items
drwxr-xr-x - hdfs supergroup 0 2014-04-17 02:02 /user/hdfs
drwxr-xr-x - sudhakar supergroup 0 2014-04-17 11:28 /user/mapred
drwxr-xr-x - sudhakar supergroup 0 2014-04-12 13:19 /user/sudhakar
[root@localhost /]# export HADOOP_HOME=/usr/lib/hadoop
[root@localhost /]# bin/start-all.sh
bash: bin/start-all.sh: No such file or directory
[root@localhost /]#
2. Sir, please also see these commands. It generates hadoop packages does not exits.
# Javac Mapper.java
Is it necessary to install eclipse ? How can we communicate eclipse with Hadoop.
Hi Sudhakar,
ReplyDeleteYou need to make mapred owned by mapred user
drwxr-xr-x - sudhakar supergroup 0 2014-04-17 11:28 /user/mapred
after exporting you need to add into
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
Then only you are able to run start-all.sh
Thanks you sir so much.
ReplyDeleteSir, how many jar file should be added when compiling Mapper.java etc.
and what is the correct command if i have to compile Mapper.java