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

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

PHPz
PHPzforward
2024-02-09 13:24:09805browse

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

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

When I run

  whereis hadoop

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

But when I run the command

  start-all.sh

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

  start-dfs.sh

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

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

I have to use find to search for it.

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

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

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

PATH=$PATH:/usr/local/sbin/

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:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete