Home > Java > start-all.sh, start-dfs.sh commands not found

start-all.sh, start-dfs.sh commands not found

PHPz
Release: 2024-02-09 13:24:09
forward
880 people have browsed it

php editor Apple may encounter a common problem when using Hadoop: "start-all.sh, start-dfs.sh commands not found". This problem usually occurs when starting a Hadoop cluster and may be caused by incorrect path configuration or non-existent script file. To solve this problem, we need to check the Hadoop installation path and environment variable configuration to ensure they are set correctly, and ensure that the relevant script files exist in the corresponding paths. The following will introduce in detail how to solve this problem, let's take a look together!

Question content

I am using ubuntu 16.04 lts and installed hadoop 2.7.2.

Output
  hadoop version
Copy after login

yes

  hadoop 2.7.2
  subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r b165c4fe8a74265c792ce23f546c64604acf0e41
  compiled by jenkins on 2016-01-26t00:08z
  compiled with protoc 2.5.0
  from source with checksum d0fda26633fa762bff87ec759ebe689c
  this command was run using /usr/local/hadoop-2.7.2/share/hadoop/common/hadoop-common-2.7.2.jar
Copy after login

When I run

  whereis hadoop
Copy after login

The output it gives is

  hadoop: /usr/local/hadoop /usr/local/hadoop-2.7.2/bin/hadoop.cmd /usr/local/hadoop-2.7.2/bin/hadoop
Copy after login

But when I run the command

  start-all.sh
Copy after login

It says the command cannot be found. Same thing when I run

  start-dfs.sh
Copy after login

The output it gives is command not found.

I am able to run these commands when I navigate to the hadoop directory, but I want to run these commands without navigating to the hadoop directory.

Solution

Your problem is that bash doesn’t know where to look for ./start-all.sh.

You can resolve this issue by opening $home/.bashrc and adding the lines shown below:

path=$path:/usr/local/hadoop/sbin
Copy after login

This tells bash that it should look start-all.sh in "/usr/local/hadoop/sbin".

Notice:

Changes to $home/.bashrc will not take effect in any currently open terminal.

If you need the changes to take effect in the currently open terminal, run

source $home/.bashrc
Copy after login

I have to use find to search for it.

find / -iname start-all.sh 2>  /dev/null
Copy after login

Discover:

/usr/local/sbin/start-all.sh
/usr/local/cellar/hadoop/3.3.4/libexec/sbin/start-all.sh
/usr/local/cellar/hadoop/3.3.4/sbin/start-all.sh
Copy after login

So in addition to the previous answers, the variables in $home/.bashrc look like this:

PATH=$PATH:/usr/local/sbin/
Copy after login

Note: I'm not sure which one should be set to path

The above is the detailed content of start-all.sh, start-dfs.sh commands not found. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template