配置hadoop集群问题
(2013-06-11 15:58:48)分类: Hadoop/Spark技术 |
1、linux下jps command not found
hadoop启动,使用命令jps,可是却提示找不到命令,
hadoop执行jps 报
jps -bash: jps: command not found
这条命令是在jdk下的bin目录下的一个可执行文件,我查看了一下我的jdk目录,发现有jps可执行文件,但是只是没有放在环境变量里面而已,环境变量可以通过etho $PATH命令查看。
所以就要自己加上去,以root身份vi /etc/profile,然后在下面加一行export PATH="usr/java/jdk160_05/bin:$PATH",其中橘色的部分是你把jdk安装在哪的路径和jdk文件夹名称。保存退出。
然后source /etc/profile就可以,没报错就说明是成功了,再执行jps就看到了。
2、配置环境变量错误,导致输入命令报错
ls
解决方案:
重新配置/etc/profile
3、hadoop集群搭建问题Permission denied
[grid@HD1 bin]$ start-all.sh
Warning: $HADOOP_HOME is deprecated.
starting namenode, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-namenode-HD1.out
/opt/hadoop-1.2.0/bin/hadoop-daemon.sh: line 138: /tmp/hadoop-grid-namenode.pid: Permission denied
192.168.100.37: starting datanode, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-datanode-HD3.out
192.168.100.36: starting datanode, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-datanode-HD2.out
192.168.100.36: /opt/hadoop-1.2.0/bin/hadoop-daemon.sh: line 138: /tmp/hadoop-grid-datanode.pid: Permission denied
192.168.100.35: starting secondarynamenode, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-secondarynamenode-HD1.out
192.168.100.35: /opt/hadoop-1.2.0/bin/hadoop-daemon.sh: line 138: /tmp/hadoop-grid-secondarynamenode.pid: Permission denied
starting jobtracker, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-jobtracker-HD1.out
/opt/hadoop-1.2.0/bin/hadoop-daemon.sh: line 138: /tmp/hadoop-grid-jobtracker.pid: Permission denied
192.168.100.36: starting tasktracker, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-tasktracker-HD2.out
192.168.100.36: /opt/hadoop-1.2.0/bin/hadoop-daemon.sh: line 138: /tmp/hadoop-grid-tasktracker.pid: Permission denied
192.168.100.37: starting tasktracker, logging to /opt/hadoop-1.2.0/libexec/../logs/hadoop-grid-tasktracker-HD3.ou
解决办法:
1.)在hadoop-config中修改hadoop-env.sh,添加:export HADOOP_PID_DIR=$HADOOP_HOME/run/tmp。改变pid的路径。3台机子一块改。
2.)在/etc中修改profile,添加:export HADOOP_PID_DIR=$HADOOP_HOME/run/tmp,同样,改3台机子。