brew install hbase tries to install hadoop though already present - macos

Hadoop is already present (and has been working fine for better part of a year)
07:48:30/~:177 $which hadoop
/usr/local/Cellar/hadoop/1.2.1/libexec/bin/hadoop
But attempting to install hbase results in a hadoop dependency error:
07:48:28/~:176 $brew install hbase
==> Installing hbase dependency: hadoop
Warning: Could not link hadoop. Unlinking...
Error: Permission denied - /usr/local/bin/task-controller

Try the following
$ brew upgrade hadoop
$ brew install hbase

After I uninstalled hbase this particular error did not recur: instead the following happened:
https://stackoverflow.com/questions/24288842/running-hbase-on-mac-connection-reset-by-peer

Related

Problems installing ruby with rvm install 2.6.1

Whenever I try to install Ruby 2.6.1 on Ubuntu this error keeps coming up. Does anyone have any solutions?
$ rvm install 2.6.1
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
mkdir: cannot create directory ‘/usr/share/rvm/log/1624238816_ruby-2.6.1’: Permission denied
tee: /usr/share/rvm/log/1624238816_ruby-2.6.1/update_system.log: No such file or directory
Updating systemddsmith password required for 'apt-get --quiet --yes update': ..-
..
Error running 'requirements_debian_update_system ruby-2.6.1',
please read /usr/share/rvm/log/1624238816_ruby-2.6.1/update_system.log
Requirements installation failed with status: 1.`

Ranger is not installing in Kerberos Hadoop cluster

I have installed the Kerberos Hadoop cluster from Ambari V2.7.3 and HDP 3.1.1 Now I am installing Apache ranger from Ambari In the same Hadoop cluster. But I am facing below errors while installing Ranger.
RuntimeError: Failed to execute command '/usr/bin/apt-get -o Dpkg::Options::=--force-confdef --allow-unauthenticated --assume-yes install ranger-3-1-0-0-78-admin', exited with code '100', message: 'E: Failed to fetch http://public-repo-1.hortonworks.com/HDP/ubuntu16/3.x/updates/3.1.0.0/pool/main/r/ranger/ranger-3-1-0-0-78-admin_1.2.0.3.1.0.0-78_all.deb 403 Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Alias yarn to yarnpkg to avoid conflict with Hadoop Yarn

I have Yarn (package manager) already installed on my machine, but I now have to install Apache Hadoop. When I tried doing that with brew install hadoop, I got the error -
Error: Cannot install hadoop because conflicting formulae are installed.
yarn: because both install `yarn` binaries
Please `brew unlink yarn` before continuing.
Unlinking removes a formula's symlinks from /usr/local. You can
link the formula again after the install finishes. You can --force this
install, but the build may fail or cause obscure side-effects in the
resulting software.
This seems to be because Hadoop's Yarn conflicts with yarn from yarnpkg.
As mentioned here, they have no intention of renaming yarnpkg's yarn, but they have added yarnpkg as an alias to yarn.
This SO answer just mentions using yarnpkg instead of yarn to avoid the conflict, but there's no steps on how to do so.
I'd appreciate any help on how to setup yarnpkg alias so that I can install Hadoop alongside yarn.
I just solved it with unlinking and linking yarn again.
brew unlink yarn && brew link yarn
You can add an alias in .bashrc or .zshrc as follows
alias yarn='command yarnpkg'
I found that brew link yarn as mentioned in the answer above won't work.
I speculated whether that might link only the non-conflicting yarnpkg, but turns out it refused to link either, which seems quite fair.
Conceptually, (with yarn package manager unlinked) what you can do is add an alias to your .bash_profile like alias yarnpkg /usr/local/Cellar/yarn/1.22.0/bin/yarnpkg
Note that won't be robust to when you brew upgrade yarn to a new version.
Also, adding that directory to your path is not a good idea, because that makes ambiguous the fact you have two separate programs called yarn installed.
An alternative to adding the bash alias is to just add the single, non-conflicting symlink manually in the same way brew link would do if it didn't refuse, as mentioned above:
ln -s /usr/local/Cellar/yarn/1.22.0/bin/yarnpkg /usr/local/bin/yarnpkg
It remains to be seen what happens when yarnpkg is updated, so keep an eye out for that. Since yarnpkg is not, apparently, symlinked by brew (except we sneakily added one), if brew doesn't update that symlink to point to the new version, then yarnpkg will stop working when you brew upgrade yarn, unless you repeat the manual ln as above pointing to the new version.
Update
Just tried it. Brew actually refuses to upgrade yarn, giving the reason that it conflicts with hadoop. So, we can brew unlink hadoop, as it suggests, then brew upgrade yarn.
Then, brew unlink yarn, brew link hadoop (hadoop has far more needed links than yarnpkg), then, finally, recreate the yarnpkg symlink with new version like so: /usr/local/Cellar/yarn/1.22.1/bin/yarnpkg
Quite long winded, but works fine.
Here is an easier way to solve this issue:
install hadoop using HomeBrew
manually install yarn using tarball
Step by step guide if already installed conflicting yarn and hadoop using Homebrew:
Clean up conflict in Homebrew and Install Hadoop
brew uninstall yarn
brew uninstall hadoop
brew install hadoop
brew link hadoop(optional if hadoop is already installed by HomeBrew but not linked)
Instal yarn using tarball
brew install wget (if does not have wget)
cd /opt
wget https://yarnpkg.com/latest.tar.gz (use sudo if permission denied)
tar zvxf latest.tar.gz (use sudo if permission denied)
open any of the following files ~/.profile, ~/.bash_profile, ~/.bashrc, ~/.zshrc in the code editor to add yarn to the path
Add these two lines
export PATH="$PATH:/opt/yarn-[version]/bin"
export PATH="$PATH:`yarn global bin`"
see more on the yarn official doc

Brew Hadoop Hbase install older versions

If I install Hadoop and Hbase:
brew install hadoop hbase
I get the following versions:
hadoop: 2.6.0
hbase: 0.98.8
But need the versions:
hadoop: 1.1.2
hbase: 0.94.8
How can I install older versions through the Brew?
If you already have hadoop & hbase installed using brew unlink them using:
brew unlink hadoop
brew unlink hbase
Now try and search for a specific version of hadoop and hbase using versions subcommand:
$ brew versions hadoop | grep 1.1.2
1.1.2 git checkout d133e18 /usr/local/Library/Formula/hadoop.rb
$ brew versions hadoop | grep 0.94.8
0.94.8 git checkout 33fdb3e /usr/local/Library/Formula/hbase.rb
Now go to /usr/local/Library and check out (git checkout) the versions you need:
git checkout d133e18 /usr/local/Library/Formula/hadoop.rb
git checkout 33fdb3e /usr/local/Library/Formula/hbase.rb
Finally perform a brew install hadoop hbase to get the versions you want.

Error installing hadoop with homebrew

I'm trying to get hadoop setup locally on my Mac, but am getting the following error when trying to brew install hadoop:
$ brew install hadoop
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz
==> Best Mirror http://apache.mirrors.pair.com/hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz
curl: (22) The requested URL returned error: 404
Error: Download failed: http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz
Any ideas what I should do?
You have to do a brew update first. It was pointing to the wrong version, but that seems to be fixed now.
It seems that Homebrew formula for Hadoop is outdated, it points to 1.1.2 instead of 1.2.1. Until the guys from Homebrew fix the bug you can do the following steps in order to install Hadoop 1.1.2:
Download manually version 1.1.2 from http://archive.apache.org/dist/hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz to any folder in your computer
Then move the file hadoop-1.1.2.tar.gz to homebrew's temporary folder, if you have not changed it before, it should be located in /Library/Caches/Homebrew
Finally you can install Hadoop using Homebrew, now brew will find that the file has already been downloaded and will proceed with installation as follows:
$ brew install hadoop
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.
Already downloaded: /Library/Caches/Homebrew/hadoop-1.1.2.tar.gz
==> Caveats
In Hadoop's config file:
/usr/local/Cellar/hadoop/1.1.2/libexec/conf/hadoop-env.sh
$JAVA_HOME has been set to be the output of:
/usr/libexec/java_home
==> Summary
/usr/local/Cellar/hadoop/1.1.2: 271 files, 78M, built in 2 seconds

Resources