Mongodb on Mavericks - mongodb

I just updated to Mavericks and trying to get all my required tools and software in place.
My mongodb is not working after installing mongodb through brew.
I did: brew install mongodb --devel
Then, I ran mongod& on terminal. This gives me:
ERROR: dbpath (/data/db) does not exist.
Create this directory or give existing directory in --dbpath.
I tried creating a directory: mkdir -p /data/db and I got permission denied as the error.
I am referring to this website "http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/" and installing Mongo using Homebrew.
Has anyone faced this issue before? Where do I actually find /data/db directory to give permissions to it? I tried ls -la in my home folder, but couldn't find this directory.
Please ignore. Here is what helped me to solve the problem:
$ sudo mkdir -p /data/db/
$ sudo chown `id -u` /data/db

Related

Flutter commands are not running

I'm trying to run the flutter commands but it gives me this error
Flutter failed to write to a file at
"/usr/local/Caskroom/flutter/3.0.3/flutter/bin/cache/flutter_version_check.sta
mp".
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
Try running:
sudo chown -R $(whoami)
/usr/local/Caskroom/flutter/3.0.3/flutter/bin/cache/flutter_version_check.st
amp
please help how to fix this issue.
You have to give permission to your username to access that folder
sudo chown -R <your_username> /flutter_sdk_path/
Check permission for the mentioned directory via:
ls -l /usr/local/Caskroom/flutter
Then run this command:
sudo chown -R [user]:root /opt/flutter

Installing MongoDB 2022

I downloaded mongoDB and I try to use brew, it didn't work.
I try bunch of commands such as:
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.6.tgz
$ tar -zxvf mongodb-osx-x86_64-3.4.6.tgz
$ mkdir -p mongodb
$ cp -R -n mongodb-osx-x86_64-3.4.6/ mongodb
$ sudo mv mongodb /usr/local
Didn't work
Step 5: it says the directory is not empty or is not exist. I try to empty the directory didn't work and I try to create a different one, it didn't work.
I can't find any solution. Can someone help me, please?
I think your /usr/local folder already contains a non-empty folder named mongodb.
Refer this for details.
You can confirm it by listing out the files in it
ls /usr/local/mongodb
Maybe, you can try removing that directory as a superuser if it doesn't have any important files and continue with the installation

MongoDB config error

Pretext: this has been asked before and i've tried implementing several solutions from previous posters. The only thing i can seem to get working is running mongo as sudo.
I'm not exactly sure what i'm doing wrong. I'm trying to do a tutorial using mongodb and every time i try to run the software i get back an error that its in a read-only directory. I'm on a mac running OS Sierra, i can force run it with sudo but i know thats wrong. I've been searching for an answer for awhile and i have already adjusted the folder permissions to 775 and nothing, then 777, still nothing.
Any help pointing me in the right direction would be greatly appreciated!
to resolve the "warning soft rlimits to low" check out this link - https://gist.github.com/tamitutor/6a1e41eec0ce021a9718
Lets start over as you are bouncing around on what you are trying.
Open activity monitor and kill any mongod process.
Go to your terminal and type which mongo - lets say it shows you download directory
cd to that directory and you should be in the bin directory
cd /mongo download directory/bin
sudo bash
mkdir -p /data/db
chmod 777 /data
chmod 777 /data/db
ls -ld /data/db this will validate you see the data/db directory as 777
exit
You're back in your mongo bin directory - if you are in /usr/local/bin skip this part.
If you are not in /usr/local/bin you will need to copy the mongo files to /usr/local/bin
sudo bash
ls - make sure you are in the correct directory
cp * /usr/local/bin
exit
which mongo should now show /usr/local/bin
type mongod to start it
open a new terminal and type mongo to connect to the instance
I recommend downloading Robo 3T (formally RoboMongo) to quickly check that you can connect.
If you do those steps, you should have no issues connecting to your local Mongo instance.
Your mongod.conf files should be in /usr/local/etc - check there to confirm you have your local host set.
Should be like net:
bindIp:127.0.0.1

issues in changing the dbpath in mongodb

i was having problem in starting up my mogodb server..(in ubuntu 16.04 LTS)
i type in the command "monogod" in the terminal and this is what i get.....
ERROR: dbpath (/data/db) does not exist.
Create this directory or give existing directory in --dbpath.
i understand that this means that the directory /data/db/ does not exist so to resolve it i type in .... mongod --dbpath /data/db/
but once again i get the same error. i've googled the error many times but to no avail
can someone please help.. i am entirely new to this whole thing...
Thank You
"ERROR: dbpath (/data/db) does not exist" means that the directory does not exist.
You need to make the directory.
Try:
mkdir -p /data/db
If you get a "permission denied" error, run:
sudo mkdir -p /data/db
and then type in your administrator/root password.
Read more about creating directories.

Postgresql server will not start after OS X Yosemite upgrade, homebrew

Steps to recreate error:
brew uninstall postgresql
brew prune
brew install postgresql
run postgresql start commands
psql
yields:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Suggested fixes I have tried that don't work:
create missing symbolic link:
sudo mkdir /var/pgsql_socket/
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
remove postmaster.pid file (same link as above):
rm /usr/local/var/postgres/postmaster.pid
create potentially "cleaned up" directories from upgrade:
mkdir -p /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/
touch /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/.keep
Related GitHub issue
Edit 1:
This article correctly speculates that there are multiple versions of postgres in use, and which pg_ctl must be specified (below). Strangely, there are two directories in /usr/local/var: postgre & postgres. If anybody knows which settings to update to use the proper pg_ctl command directly, I would appreciate it!
/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_ctl -D /usr/local/var/postgre start
I ran into the same issue and after looking at the log file I found one directory was missing:
$ tail /usr/local/var/postgres/server.log
FATAL: could not open directory "pg_tblspc": No such file or directory
Then I did $ mkdir /usr/local/var/postgres/pg_tblspc, restarted PostgreSQL and got:
$ tail /usr/local/var/postgres/server.log
FATAL: could not open directory "pg_replslot": No such file or directory
After redoing the process may times I eneded up creating the following directories and then successfully started PostgreSQL:
/usr/local/var/postgres/pg_tblspc
/usr/local/var/postgres/pg_replslot
/usr/local/var/postgres/pg_twophase
/usr/local/var/postgres/pg_logical
/usr/local/var/postgres/pg_logical/mappings
I hope this helps.