hadoop 单点配置


实验环境:

vmware9+ubuntu12+jdk7(master:192.168.0.128 )

vmware9+ubuntu12+jdk7(salve:192.168.0.129 )

首先去http://www.apache.org/dyn/closer.cgi/hadoop/common/下载hadoop,我下载的是1.2.1版本的,稳定版的

配置ubuntu的IP为固定IP,分别是192.168.0.128、192.168.0.129 参考的博客,虚拟机下ubuntu上网

解压到/opt目录下,并重命名为hadoop,赋予读写权限,省得麻烦,sudo chmod -R 777 /opt/hadoop(-R代表目录下所有文件和目录)。

1、安装ssh

sudo apt-get install ssh
sudo apt-get install rsync 

2、设置ssh无密码登录

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

测试是否可以无密码登录:ssh localhost

3、我也不知道干啥的,照着官网弄吧

The following example copies the unpacked conf directory to use as input and then finds and displays every match of the given regular expression. Output is written to the given output directory.
mkdir input
cp conf/*.xml input
bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
cat output/*

4、配置hadoop

配置JAVA_HOME:

在conf/hadoop-env.sh

# The java implementation to use.
export JAVA_HOME=/usr/local/jdk1.7/jdk1.7.0_25
Use the following:

conf/core-site.xml:

<configuration>
     <property>
         <name>fs.default.name</name>
         <value>hdfs://localhost:9000</value>
     </property>
</configuration>


conf/hdfs-site.xml:

<configuration>
     <property>
         <name>dfs.replication</name>
         <value>1</value>
     </property>
</configuration>


conf/mapred-site.xml:

<configuration>
     <property>
         <name>mapred.job.tracker</name>
         <value>localhost:9001</value>
     </property>
</configuration>
5、格式化&启动hadood

Format a new distributed-filesystem:
$ bin/hadoop namenode -format

Start the hadoop daemons:
$ bin/start-all.sh 
日志在 ${HADOOP_HOME}/logs
6、查看hadoop运行状态(至此hadoop的单点配置已经大功告成)

Browse the web interface for the NameNode and the JobTracker; by default they are available at:

    NameNode - http://localhost:50070/
    JobTracker - http://localhost:50030/ 

7、停止hadoop

When you're done, stop the daemons with:
$ bin/stop-all.sh


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值