hadoop 安装

yum --nogpgcheck localinstall cloudera-cdh-4-0.i386.rpm
rpm --import http://archive.cloudera.com/cdh4/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera
yum install hadoop-0.20-mapreduce-jobtracker
yum install hadoop-hdfs-namenode
yum install hadoop-hdfs-secondarynamenode

yum install hadoop-0.20-mapreduce-tasktracker hadoop-hdfs-datanode

yum install hadoop-client




cp -r /etc/hadoop/conf.dist /etc/hadoop/conf.my_cluster

alternatives --verbose --install /etc/hadoop/conf hadoop-conf /etc/hadoop/conf.my_cluster 50
alternatives --set hadoop-conf /etc/hadoop/conf.my_cluster

mkdir /home/hadoop-hdfs
chmod 777 /home/hadoop-hdfs
mkdir -p /home/1/dfs/nn /home/dfs/nn
mkdir -p /home/1/dfs/dn /home/2/dfs/dn /home/3/dfs/dn /home/4/dfs/dn
chown -R hdfs:hdfs /home/1/dfs/nn /home/dfs/nn /home/1/dfs/dn /home/2/dfs/dn /home/3/dfs/dn /home/4/dfs/dn
chmod 700 /home/1/dfs/nn /home/dfs/nn

mkdir -p /home/1/mapred/local /home/2/mapred/local /home/3/mapred/local /home/4/mapred/local
chown -R mapred:hadoop /home/1/mapred/local /home/2/mapred/local /home/3/mapred/local /home/4/mapred/local

hadoop fs -chmod 777 -R /home/hadoop-hdfs/mapred/
hadoop fs -mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
hadoop fs -chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
hadoop fs -chown -R mapred /var/lib/hadoop-hdfs/cache/mapred

sudo -u hdfs hadoop namenode -format

你可能感兴趣的:(hadoop)