$ sudo gedit /etc/profile
#set Hadoop environment export HADOOP_INSTALL=/opt/hadoop-0.20.203.0 export PATH=$PATH:$HADOOP_INSTALL/bin
<!--core-site.xml --> <configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost/</value> </property> </configuration>
<!--hdfs-site.xml --> <configuration> <property> <name>dfs.replication</name> <value>1</value><!--设置副本为1,程序就不会试图复制的其余的机器上,就不会产生副本没法复制的警告--> </property> </configuration>
<!--mapred-site.xml--> <configuration> <property> <name>mapred.job.tracker</name> <value>localhost:8021</value> </property> </configuration>
%sudo apt-get install ssh
%ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa %cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh-keygen #而后一直回车到结束 $ ssh-copy-id -i ~/.ssh/id_rsa.pub 你的用户名@localhost
% ssh localhost
#解決方式使用 ssh-add 指令将私钥 加进来 根据我的的密匙命名不一样更改 id_rsa % ssh-add ~/.ssh/id_rsa
$ sudo /etc/init.d/sshd start
来启动ssh服务,以后照着上面作就能够了。
%hadoop namenode -format
%start-dfs.sh %start-mapred.sh
%stop-dfs.sh %stop-mapred.sh