Problem using and running brew services start mongodb-community#4.2 - database

I have MacOs Catalina version 10.15.5 and I installed mongoDB following the steps indicated at their site https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ using Homebrew. When I check my mongoDB if its correctly installed I use which mongo command and I get /usr/local/bin/mongo response. When I use mongo --version and mongod --version I get:
MongoDB shell version v4.2.7
git version: 51d9fe12b5d19720e72dcd7db0f2f17dd9a19212
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
and
db version v4.2.7
git version: 51d9fe12b5d19720e72dcd7db0f2f17dd9a19212
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
respectevely which I think it means its correctly installed and should work.
But when I open terminal and run the command brew services start mongodb-community#4.2 as indicated on the site I get:
Error: undefined method `resolve_alias' for Formula:Class
/usr/local/bin/brew-services.rb:154:in `service'
/usr/local/bin/brew-services.rb:203:in `check'
/usr/local/bin/brew-services.rb:193:in `run!'
/usr/local/bin/brew-services.rb:397:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:81:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:112:in `<main>'
NOTE: my brew is updated and upgraded successfully!
I searched on the internet any solution but I cant find anything that solves the problem... If anyone had faced similar problem please explain step by step and with details how you had solved it?!?!
If I directly run command mongod I get:
2020-06-04T01:19:41.351+0200 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-06-04T01:19:41.355+0200 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] MongoDB starting : pid=24712 port=27017 dbpath=/data/db 64-bit host=Air-de-Ruslan.home
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] db version v4.2.7
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] git version: 51d9fe12b5d19720e72dcd7db0f2f17dd9a19212
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] allocator: system
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] modules: none
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] build environment:
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] distarch: x86_64
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] target_arch: x86_64
2020-06-04T01:19:41.355+0200 I CONTROL [initandlisten] options: {}
2020-06-04T01:19:41.355+0200 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Permission denied
2020-06-04T01:19:41.355+0200 F - [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 684
2020-06-04T01:19:41.355+0200 F - [initandlisten]
***aborting after fassert() failure
and if I run directly command mongo I get:
MongoDB shell version v4.2.7
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-06-04T01:21:20.317+0200 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:341:17
#(connect):2:6
2020-06-04T01:21:20.320+0200 F - [main] exception: connect failed
2020-06-04T01:21:20.320+0200 E - [main] exiting with code 1

SOLVED
I had to remove /usr/local/bin/brew-services.rb with the command
rm /usr/local/bin/brew-services.rb it could ask for permissions so add
sudo rm /usr/local/bin/brew-services.rb.
After that I tried running brew services start mongodb-community#4.2 and I got
Successfully started mongodb-community (label: homebrew.mxcl.mongodb-commu
but when I put mongo from different terminal to start the shell I got
Socket exception errorso I checked also the mongod.log file and I saw it was a socket issue so I tried
ls -ls /tmp/mongodb-27017.sock
and I got
0 srwx------ 1 root root 0 June 04 14:51 /tmp/mongodb-27017.sock
that means the owner is root and mongodb cant access it so I did
sudo rm -rf /tmp/mongodb-27017.sock
to delete the file and then start again mongodb with
brew services start mongodb-community#4.2 that created new .sock file whose owner is directly mongodb or the actual user whoami and when I checked again
ls -lsah /tmp/mongodb-27017.sock
I proved I am the owner and then I could open new terminal and run mongo and get in with enabled connection and use the shell!

Tested on macos Big Sur and mongodb-community#5.0.1
If you're using homebrew and upgraded to mongodb-community#5.0, you may encounter with error when starting the mongodb-community service.
Use rm -rf /usr/local/var/mongodb to remove previous dbpath folder if exists then create it again using cd /usr/local/var && mkdir mongodb.
Then brew services start mongodb-community should work fine.

On MacOS Big Sur (tested for mongodb-community#5.0), the following always returns an error (which means mongodb-community service will be loaded automatically) :
~ brew services start mongodb-community
mongodb-community error zaffer /Users/zaffer/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
By default mongodb-community configuration is stored in /usr/local/etc/mongod.conf
By default the dbpath parameter is set as /usr/local/var/mongodb
On analyzing the logs, I found that the problem is mostly related to permissions of this folder /usr/local/var/mongodb
The following worked for me :
~ cd /usr/local/var/mongodb
~ sudo chown -R $(whoami) .
~ cd ..
~ sudo chown -R $(whoami) mongodb
~ brew services restart mongodb-community
If you are still facing problems, I suggest changing file permissions of all files of this folder (/usr/local/var/mongodb) :
~ chmod -R 777 /usr/local/var/mongodb
~ brew services restart mongodb-community
or use sudo if permission is denied
~ sudo chmod -R 777 /usr/local/var/mongodb
~ brew services restart mongodb-community
If you are still facing issues, observe the errors when running mongod as a background process using one of the following :
~ mongod
~ mongod --dbpath /usr/local/var/mongodb
~ mongod --config /usr/local/etc/mongod.conf
You may also encounter problems when upgrading from a lower version of mongodb-community, for eg. upgrading from 3.6 to 5.0, in my case, I was inclined towards saving the existing databases, otherwise I could have created a new folder for mongodb data, and updated the dbpath in /usr/local/etc/mongod.conf configuration file.
The recommended way to do this is to do an incremental upgrade, i.e. upgrade from 3.6 to 4.0, then 4.0 to 4.4, then 4.4 to 5.0. What this does is it sets the recommended compatibility versions for migrating the data from one version to another. You can set the compatibility versions manually from mongodb shell using (for this, you need a working mongodb server):
> db.adminCommand( { setFeatureCompatibilityVersion: <version> } )
link to doc : https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/

Related

Zsh: Command Not found : mongo After trying to install mongodb 4.2 using brew

I have tried the following steps to install and setup mongodb in my mac from here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ but I got the following error when running the final "mongo" command in my terminal:
Error Message - Zsh: Command Not found : mongo
This error msg occurred after trying to install mongodb 4.2 using brew
sudo chown -R $(whoami) $(brew --prefix)/*
then
brew tap mongodb/brew
then
brew install mongodb-community#4.2
and
brew services start mongodb-community#4.2
or
mongod --config /usr/local/etc/mongod.conf
then
ps aux | grep -v grep | grep mongod
and
mongo
running brew services start mongodb-community#4.2 returns:
Successfully started `mongodb-community#4.2` (label: homebrew.mxcl.mongodb-community#4.2)
running ps aux | grep -v grep | grep mongod returns:
9081 0.2 0.5 5528024 41856 ?? S 3:01pm 0:01.48 /usr/local/opt/mongodb-community#4.2/bin/mongod --config /usr/local/etc/mongod.conf
7613 0.0 0.1 4298832 5600 s000 T 2:47pm 0:00.08 vim /usr/local/etc/mongod.conf
running mongod --config /usr/local/etc/mongod.conf returns:
zsh: command not found: mongod
There are also no mongo files in my /usr/local/bin directory after using these commands
I created a data/db folder in my /usr/local/bin directory using the following commands:
sudo mkdir -p /usr/local/bin/data/db
sudo chown -R `id -un` /usr/local/bin/data/db
Running "brew update" returns:
brew update
Updated 1 tap (homebrew/cask).
==> Updated Casks
brave-browser
brew install mongodb-community-shell
Fixed the problem for me.
Solved it by manually installing the mongodb community files and db tools using the website instead. Then copying them into /usr/local/bin. Then ignoring the app permissions whenever calling mongo or related commands in the terminal through System Preferences > Security & Privacy > General.
After googling I found out that mongoimport and the other features have to be installed separately: https://www.mongodb.com/try/download/database-tools
Followed by copying those bin files after extracting them into the same /usr/local/bin directory
Not sure why its' not working through homebrew though
This worked for me, I was having same issue on mongodb-community#4.4
brew reinstall mongodb-community#4.4
On terminal something like this will appear during reinstallation.
copy highlighted path with echo
echo 'export PATH="/opt/homebrew/opt/mongodb-community#4.4/bin:$PATH"' >> ~/.zshrc
Now open another terminal and start mongodb services
brew services restart mongodb/brew/mongodb-community#4.4
write mongo on terminal and here we fly
If you installed the mongodb via Homebrew. Need to add the mongo path in your bash_profile.
Edit the bash_profile vi ~/.bash_profile
Add the below line in EOF export PATH=$PATH:/usr/local/opt/mongodb-community#4.2/bin
After the edit bash_profile. Close all terminals and open them again. mongo command start works.
In addition to #ramesh-babu-t-b 's answer, https://stackoverflow.com/a/68407530/1279516, the issue could also be that your MongoDB installation did add mongod to your path, but the installation happened within the current shell session, and so your shell doesn't have the updates to the PATH variable yet.
In this case, only his last step is still necessary - Open a new console window and retry the mongod command.

MongoDB Catalina: connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017

I just updated my mac to Catalina 10.15.2 and I can't running MongoDB.
When I send the command mongo I receive this message
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
and the only way to make Mongo work is to restart the Mac.
If I check the process with the command ps I don't see the process already on and the port 27017 is available.
I already tried to run the follow command:
brew tap mongodb/brew
brew reinstall mongodb-community
brew services restart mongodb-community
and if I run the follow command:
ps aux | grep -v grep | grep mongod
no results.
I tried to run mongod before mongo as well and the result is:
2019-12-18T12:17:45.916+0100 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] MongoDB starting : pid=9375 port=27017 dbpath=/data/db 64-bit host=Marcos-MacBook-Pro.local
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] db version v4.2.1
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] git version: edf6d45851c0b9ee15548f0f847df141764a317e
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] allocator: system
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] modules: none
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] build environment:
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] distarch: x86_64
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] target_arch: x86_64
2019-12-18T12:17:45.920+0100 I CONTROL [initandlisten] options: {}
2019-12-18T12:17:45.920+0100 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Permission denied
2019-12-18T12:17:45.920+0100 F - [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 693
2019-12-18T12:17:45.920+0100 F - [initandlisten]
***aborting after fassert() failure
Someone can help me please? I appreciate it
An alternative way to fix this Catalina Mac OS root & mongodb connection issue, do the following:
Install Homebrew, if you have it, reinstall it again
run the following commands in the terminal
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew untap mongodb/brew && brew tap mongodb/brew
brew install mongodb-community#4.2
The issue is mongo cannot find /db/data because there is no directory, so you have to create one:
cd ~ (this should take you to your Users folder)
from the Users folder make your own db/data folder by running the follow commands:
mkdir db & cd inside db folder
inside the db folder run: mkdir data & cd inside data folder
run this command: mongod --dbpath ~/data/db
(inside the Users/data/db/ folder you just created)
Now open a new terminal tab &
run: cd ~ (brings you back to Users) -> now run : cd .. & cd .. again (do this twice)
(now you should be in the folder before Users)
(now find tmp folder) cd into the /tmp folder
delete the sock file (this is giving you connection issues)
delete it by running: rm -rf mongodb-27017.sock
now run command: mongo (this should work now)
inside mongo shell run command: db.verion()
if you see a version, your connection works.
From now on to run mongodb database & connection you will have to have two separate tabs open at all times whenever you want to work on your projects
Example:
in one terminal tab run command -> mongod --dbpath ~/data/db
(this starts the connection)
in the other terminal tab run command: mongo
(this starts the shell)
These both have to be running..
Side Note:
you no longer need to start
the connection by running
brew services start mongo-community anymore.
remember mongod --dbpath ~/data/db is basically -> mongod command now.. The Mac OS Catalina Update created root permission problems, that is why mongod command alone never worked before.
Hope this helped you. Goodluck.
Faced a similar issue with macOS Big Sur. After trying all the approaches mentioned above including
updating homebrew
reinstalling MongoDB, MongoDB community and setting up a /System/Volumes/Data/data/dbfolder
This command worked for me mongod --dbpath=/System/Volumes/Data/data/db
reference: https://medium.com/codespace69/mongodb-troubleshooting-errors-for-beginners-and-macos-catalina-31befd99f6c8
This error is caused due to ownership issues.
Here we are changing the ownership to 'mongodb' user.
Command 1: deletes the /tmp/mongodb-27017.sock file
$sudo rm -rf /tmp/mongodb-27017.sock
Command 2: starts mongod service
$sudo service mongod start
Command 3: shows the file with its ownership details
ls -lsah /tmp/mongodb-27017.sock
output
0 srwx------ 1 mongodb mongodb 0 Aug 24 04:01 /tmp/mongodb-27017.sock
Got the same issue after upgrading to Catalina. Tried lots of ways to solve the issue, what eventually helped was reinstalling brew, and then following steps listed on official mongodb site.
So:
Uninstall brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)
Install it again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Follow steps to install and run monbo service:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

Not able to run Mongodb on ubuntu

While trying to access the mongodb I am getting error that connection is failed
while running mongod command I am getting
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] MongoDB
starting : pid=2580 port=27017 dbpath=/data/db 64-bit host=gten
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] db version
v3.6.3
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] git
version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] OpenSSL
version: OpenSSL 1.1.0g 2 Nov 2017
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] allocator:
tcmalloc
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] modules:
none
2019-02-25T11:05:05.870+0530 I CONTROL [initandlisten] build
environment:
2019-02-25T11:05:05.871+0530 I CONTROL [initandlisten]
distarch: x86_64
2019-02-25T11:05:05.871+0530 I CONTROL [initandlisten]
target_arch: x86_64
2019-02-25T11:05:05.871+0530 I CONTROL [initandlisten] options:
{}
2019-02-25T11:05:05.962+0530 I STORAGE [initandlisten] exception
in initAndListen: IllegalOperation: Attempted to create a lock
file on a read-only directory: /data/db, terminating
2019-02-25T11:05:05.962+0530 I CONTROL [initandlisten] now
exiting
2019-02-25T11:05:05.962+0530 I CONTROL [initandlisten] shutting
down with code:100
and while I run mongo command, I am getting
MongoDB shell version v4.0.6
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
2019-02-25T11:16:44.802+0530 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:343:13
#(connect):1:6
exception: connect failed
I dont know what's the issue I have follwe the [https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/] and [https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu-16.04/]
to install the mongo.
Config:
I am using UBUNTU 18.04.
Any help is appreciated i have gone through many answers and tried all but still facing the same issue.Thanks in advance
After doing a lot of stuff I am getting
2019-02-25T18:52:27.197+0530 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] MongoDB starting : pid=27390 port=27017 dbpath=/data/db 64-bit host=gten
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] db version v4.0.6
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] git version: caa42a1f75a56c7643d0b68d3880444375ec42e3
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] allocator: tcmalloc
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] modules: none
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] build environment:
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] distmod: ubuntu1804
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] distarch: x86_64
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] target_arch: x86_64
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] options: {}
2019-02-25T18:52:27.200+0530 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] now exiting
2019-02-25T18:52:27.200+0530 I CONTROL [initandlisten] shutting down with code:48
If you face this issue It means you are trying to connect mongo shall without
running server on local which give this problem
Some system are not run mongo service automatically on start of machine.
So you need to start it manually.
Run this command to run service on every time when you start your machine or whenever you want to use mongo
sudo service mongod start
// or
sudo systemctl start mongod
Run sudo service mongod status and see what it returns.
If it is stopped,
run sudo service mongod start to start the mongodb and try connecting to it.
If sudo service mongod start is giving a error then
Create the file /lib/systemd/system/mongod.service with the following content:
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
If you still persist error please share console error. On start, we may help you better.
As per the error, message the user trying to start the mongod process don't have write access to /data/db folder.
Run the following command to enable the user to write to /data/db folder
sudo chown -R $USER:$USER /data/db
or create a new folder with current users permission and start mongod with --dbpath option
mkdir mydata/db
mongod --dbpath mydata/db
Try this one. This may help.
sudo chmod 777 /data/db

apache-zeppelin 0.8.0 installation while using home brew on mac OS

i have installed java version "1.8.0_181", scala, apache-spark, apache-zeppelin using home brew, and there is no error showed up while these installations.
If i ran $ spark-shell in the terminal, it shows warn but still called up scala as below:
However, while i opened http://localhost:8080/#/ and ran sc.version, it shows error as bellow:
scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:432)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:855)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:813)
at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:675)
at scala.tools.nsc.interpreter.IMain.bind(IMain.scala:712)
at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:711)
at scala.tools.nsc.interpreter.IMain$$anonfun$quietBind$1.apply(IMain.scala:711)
at scala.tools.nsc.interpreter.IMain.beQuietDuring(IMain.scala:214)
at scala.tools.nsc.interpreter.IMain.quietBind(IMain.scala:711)
at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$loopPostInit(ILoop.scala:891)
at jdk.internal.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.zeppelin.spark.BaseSparkScalaInterpreter.callMethod(BaseSparkScalaInterpreter.scala:270)
at org.apache.zeppelin.spark.BaseSparkScalaInterpreter.callMethod(BaseSparkScalaInterpreter.scala:262)
at org.apache.zeppelin.spark.SparkScala211Interpreter.open(SparkScala211Interpreter.scala:84)
at org.apache.zeppelin.spark.NewSparkInterpreter.open(NewSparkInterpreter.java:102)
at org.apache.zeppelin.spark.SparkInterpreter.open(SparkInterpreter.java:62)
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:69)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:617)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:140)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
how could i figure this problem?
I had multiple issues with home brew installation, but running with docker worked for me(http://zeppelin.apache.org/download.html#using-the-official-docker-image
):
"Use this command to launch Apache Zeppelin in a container.
docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.8.0
To persist logs and notebook directories, use the volume option for docker container.
docker run -p 8080:8080 --rm -v $PWD/logs:/logs -v $PWD/notebook:/notebook -e ZEPPELIN_LOG_DIR='/logs' -e ZEPPELIN_NOTEBOOK_DIR='/notebook' --name zeppelin apache/zeppelin:0.8.0
If you have trouble accessing localhost:8080 in the browser, Please clear browser cache."
In my case it was the problem of having a Java10 installed prior to Java8. Apparently, Java version above 8.0 are not yet supported by Spark. The problem is fixable by setting the JAVA_HOME environment variable to your Java8 installation.
If you don't have it:
brew cask install java8
and the default location for MacOs should be:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home"
If you launch your zeppelin server via the zeppelin-deamon.sh, then just add the export above at the beginning of the file.
You should find the zepplin-deamon.sh true file location and if you installed zeppelin via homebrew, it should be in:
/usr/local/Cellar/apache-zeppelin/0.8.1/libexec/bin/zeppelin-daemon.sh

Uninstall MongoDB on Mac OS X

When I try to run mongod from the terminal, I get the following error:
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: addr already in use
I recently realize that I have two versions of MongoDB on my Mac, and think this may be the source for the above error. (Plus, I do not need two version.) I tried Googling, but was not able to find clear directions on how I can uninstall. I have development version 2.7.0 AND 2.6.3.
Thanks so much in advance for the help!
Run the following commands to remove mongodb from the launch/startup and to uninstall it using Homebrew:
# See if mongo is in the launch/startup list
launchctl list | grep mongo
# Remove mongodb from the launch/startup
launchctl remove homebrew.mxcl.mongodb
# Kill the mongod process just in case it's running
pkill -f mongod
# Now you can safely remove mongodb using Homebrew
brew uninstall mongodb
Just double-check in /usr/local/bin/ to make sure that the mongodb commands are removed.
For uninstalling the community version, i found that the command brew uninstall mongodb-community worked for me
Nitin Jadhav version worked for me, brew uninstall mongodb kept given me Error: No such keg: /usr/local/Cellar/mongodb. I was removing a mongodb-community.
use cd /usr/local/Cellar then run ls -a and then run rm -rf mongodb-community to remove it
I would suggest navigating into your /usr/local/Cellar and run an ls -a, I had a community version of mongo installed that wasn't being picked up by the command given above. If you find any mongo versions there just rm -rf each instance
For those having this error in osx:
brew uninstall mongodb Error: No such keg: /usr/local/Cellar/mongodb
execute brew list | grep mongo
for example, it could show something like:
mongodb-community#4.2
mongodb-database-tools
mongosh
remove them with brew uninstall mongodb-community#4.2 mongodb-database-tools mongosh
Also execute launchctl remove homebrew.mxcl.mongodb as #anuvrat-tiku says in his answer.

Resources