mac上安装hadoop,
官网:https://dtflaneur.wordpress.com/2015/10/02/installing-hadoop-on-mac-osx-el-capitan/
https://amodernstory.com/2014/09/23/installing-hadoop-on-mac-osx-yosemite/#hadoop
运行到这一步 我使用的
sudo vim ~/profile 在后面的hstart 、hstop找不到??? 要加的语句里没有<>这个,去除之后就正常了,
另外vim ~/.profile 和vim ~/etc/profile 有什么区别,,还有vim ~/.bash_profile
To simplify life edit a ~/.profile and add the following commands. By default ~/.profile might not exist.
| 1 2 |
aliashstart=<"/usr/local/Cellar/hadoop/2.6.0/sbin/start-dfs.sh;/usr/local/Cellar/hadoop/2.6.0/sbin/start-yarn.sh">
aliashstop=<"/usr/local/Cellar/hadoop/2.6.0/sbin/stop-yarn.sh;/usr/local/Cellar/hadoop/2.6.0/sbin/stop-dfs.sh">
|
and source it
| 1 |
$source~/.profile
|
方法一:http://blog.csdn.net/deryliu/article/details/50716288
这里介绍Hadoop在mac下的安装与配置。
安装及配置Hadoop
首先安装Hadoop
$ brew install Hadoop
配置ssh免密码登录
用dsa密钥认证来生成一对公钥和私钥:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
将生成的公钥加入到用于认证的公钥文件中:
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
接下来测试一下是否配置成功
$ ssh localhost
如果遇到connection refused之类的错误,检查一下mac是否开启远程登录功能,在系统偏好设置中可以设置。
配置Hadoop文件
core-site.xml文件配置如下:<configuration>
<property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property> </configuration>
hdfs-site.xml配置如下;<configuration>
<property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
mapred-site.xml配置如下:<configuration>
<property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration>
yarn-site.xml配置如下:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
以上过程需要注意的是如果mapred-site.xml文件不存在,需要自己创建(可以复制一下mapred-site.xml.template文件再进行修改)
运行Hadoop样例程序
此部分内容主要参考自Setting up Hadoop 2.6 on Mac OS X Yosemite
分类: Mac OSX,分布式