标签:style http color io os 使用 java ar for
最新的hadoop2.5 安装目录做了一定修改,安装变得稍微简单一点
首先安装准备工具
$ sudo apt-get install ssh $ sudo apt-get install rsync
配置ssh
$ ssh localhostIf you cannot ssh to localhost without a passphrase, execute the following commands:
$ ssh-keygen -t dsa -P ‘‘ -f ~/.ssh/id_dsa $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
进入etc/hadoop/hadoop-env.sh 配置运行环境
# set to the root of your Java installation export JAVA_HOME=/usr/java/latest # Assuming your installation directory is /usr/local/hadoop export HADOOP_PREFIX=/usr/local/hadoop
配置hdfs端口和备份数
etc/hadoop/core-site.xml:
<configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property>
<property>#ClientDatanodeProtocol 调用getBlockLocalPathInfo的时候 <name>dfs.block.local-path-access.user</name> <value>infomorrow</value> </property> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/home/infomorrow/hadoop-tmp</value> </property></configuration>
etc/hadoop/hdfs-site.xml:
<configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
配置使用yarn
etc/hadoop/mapred-site.xml:
<configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration>
etc/hadoop/yarn-site.xml:
NodeManager 在 启 动 时 加 载shuffle server,shuffle server 实 际 上 是 Jetty/Netty Server,Reduce Task 通 过 该 server 从 各 个NodeManager 上远程复制 Map Task 产生的中间结果
<configuration> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration>
启动过程:
hdfs
$ bin/hdfs namenode -format (初次使用时)
$ sbin/start-dfs.sh
进入监控页查看 - http://localhost:50070/
$ bin/hdfs dfs -mkdir /user $ bin/hdfs dfs -mkdir /user/<username>
查看hdfs上创建的文件夹 bin/hadoop fs -ls /
关闭:
$ sbin/start-yarn.sh 进入监控页查看 - http://localhost:8088/
$ sbin/stop-dfs.sh$ sbin/stop-yarn.sh
标签:style http color io os 使用 java ar for
原文地址:http://blog.csdn.net/larrylgq/article/details/39184301