Where can i find the mongoexport command in suse os? - mongoexport

When i install the mongodb with the command zypper in mongo, then i got mongodb 4.2 installed in my os.
Few days after, i am gonner to backup the data in db. But i can not find the command mongoexport.
When i try to install it with the comand zypper se mongoexport, i got nothing
The version of mongodb is 3.4.10
host1:/usr/bin # mongo -host 127.0.0.1 -port 2222
MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:2222/
MongoDB server version: 3.4.10
I will appriciate it so much if anyone provide some method to install the command.

The version of mongodb is too old, when i upgrade to mongodb 4.2, it contains the mongoexport/mongoimport tools in it.

Related

Server at (localhost:27017) reports wire version (4), but this version of the Ruby driver requires at least (6)

Server at (localhost:27017) reports wire version (4), but this version of the Ruby driver requires at least (6).
i am using ubuntu 16.04
and ruby -v 3.0.2
rails 6.1.4.1
it not insert and fetch data from data base
I faced the same issue. This error is raised by Mongo-Ruby-Driver from line 71.
The error states that Mongo-Ruby-Driver is not compatible with the MongoDB you are running.
I was running MongoDB with version 3.2, and updated it to 5.0.5, which works like a charm.
Here are the steps I took:
ps ax | grep mongo
Change processID with your Mongo process id:
kill -9 processID
Install latest Mongodb and unlink the old version:
brew install mongodb-community
brew unlink mongodb-community#3.2
Update LaunchAgent:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
Update .zshrc if required:
echo 'export PATH="/usr/local/opt/mongodb-community/bin:$PATH"' >> ~/.zshrc
Link & start MongoDB:
brew link mongodb-community
brew services restart mongodb-community
Start MongoDB:
mongod --dbpath ~/data/db
# Make sure you have access rights to ~/data/db directory.
If you get this error:
Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Permission denied"}}
You can fix it by removing this file:
sudo rm -rf /tmp/mongodb-27017.sock

Install Mysql 5.7 on High Sierra

I want to install mysql 5.7 on my Mac OS 10.13.5. However, brew install mysql installs version 8.0 which is not suited for my project. Forgive me if this question was asked before but I could not find a solution.
Now it's bit differently
brew install mysql#5.7
$ brew install mysql55
This installs a specific version 5.5 which exists along with 8.0
Also mysql entry should be added to .bash_profile to make sure it load and then server start should be done.
$ brew services start mysql#5.5
Below command gives the sequence of how the files are loaded in sequence.
$ mysql --verbose --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
While installing first mysql server instance works perfectly, installing a different version of mysql instance should be configured properly and the paths of installation, log files and other components have different path.
Installation paths be found here, for eg.
mysql -> ../Cellar/mysql/8.0.11/bin/mysql

How to install Grails on Linux Ubuntu LTS?

I have Linux Ubuntu 14.04 LTS. I wanted to install Grails and I have found informations on how to install it on Ubuntu 14.04 VPS here. So I am a little confused.
What are the difference between the two versions, LTS and VPS?
Does it matter if I do not have VPS version?
Can I install Grails on my Ubuntu? If yes, how?
A very simple way on Linux/Unix OS is to use the GVM Tool.
After installing the GVM tools you simply run
$ gvm install grails 2.4.3
in order to install Grails 2.4.3
UPDATE: Meanwhile gvm was renamed to sdkman.
Install sdkman
$ curl -s "https://get.sdkman.io" | bash
In order you want to continue working in the same terminal window execute
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
To install the latest version of Grails simply run
$ sdk install grails
or if need a specific version you can run
$ sdk install grails 2.4.3
You may try these steps. But this is just a guess, am not much sure about LTS and VPS
download grails-{desired version} zip file
extract it into any folder.
edit .bashrc in home folder such that
JAVA_HOME=/path/to/java/jdk1.6.0_25-64/
export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH
export GRAILS_HOME=/path/to/grails/grails-2.4.2/
export PATH="$PATH:$GRAILS_HOME/bin"
try to run grails command in terminal
VPS stands for Virtual Private Server in general (no special Ubuntu version) and LTS for Long Time Support added to a version number of Ubuntu to annotate a longer livetime (e.g. making this versions more suitable for servers). So these letters have not much influence on your way of installing Grails. The instructions there (installing JDK from OS and using sdkman (formerly GVM)) are sound advice to run Grails.

Setup Rails 3.1 and Postgresql on Snow Leopard

I have spent countless number of hours trying to setup PostgreSql on my Intel Mac.
I am able to install Rails and all but PostgreSql would not get installed on my Mac.
Anybody has any solution or any tutorial which I can follow to install it ??
P.S. I just started using Mac as my development machine. I have been using Windows before that !
Ok I had to do a little more research with a fresh mind and I am now able to solve the problem myself. Here is the solution :
Install Homebrew using this command :
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
Once installed write this in your terminal :
brew install postgres
If this is your first install ( which was the case with me ) than type this in terminal after the above step:
$ initdb /usr/local/var/postgres
To start the postgresql type this in terminal:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
After the above step type this :
ps auxwww | grep postgres
If the result of the above command in terminal looks like this than that means the postgresql is installed correctly :
26000 0.0 0.1 2445860 1556 ?? Ss 1:59AM 0:00.05 postgres: autovacuum launcher process
25999 0.0 0.0 2445728 512 ?? Ss 1:59AM 0:00.15 postgres: wal writer process
25998 0.0 0.0 2445728 912 ?? Ss 1:59AM 0:00.21 postgres: writer process
25996 0.0 0.1 2445728 2508 ?? S 1:59AM 0:00.15 /usr/local/Cellar/postgresql/9.0.4/bin/postgres -D /usr/local/var/postgres
26257 0.0 0.0 2435548 0 s000 R+ 2:19AM 0:00.00 grep postgres
Create a user and database:
createuser username
createdb -Ousername -Eutf8 databasename
To login to postgresql use this command:
psql -U username databasename
If you are using it with rails you can install the gem like this :
sudo env ARCHFLAGS="-arch x86_64" gem install --no-ri --no-rdoc pg
If you would like to stop the PostgreSQL service use this command :
pg_ctl -D /usr/local/var/postgres stop -s -m fast
Hope this will help others in saving the time of going through different resources to come with the solution like I did :)
Try using Cinderella. That will give you the whole stack (including MongoDB, Redis, and a whole bunch of other stuff) in one nice neat bundle in ~/Developer. You're better off using custom builds of all your development tools so that you don't have to worry about what version of anything comes with the system and what an upgrade might to do your OS.
References:
Cinderella on Github
Cinderella Homepage
A few other notes to add to your instructions:
There is a good post at Russ Brooks Blog on installation which validates much of what you have above.
There are a set of admin tools available at pgadmin.org which will allow you to browse your database through a simple GUI on the Mac
If you use the admin tools you should install the instrumentation pack with the following:
psql -d postgres < /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/adminpack.sql
where the exact command obviously depends on the version of postgresql you are using.
If you are using postgres with rails and bundler then make sure the "pg" gem is in your gem file and run bundler with the following command immediately after you add it:
env ARCHFLAGS="-arch x86_64" bundle install
This will do the same as your 'gem install' command above. After you run it for the first time you no longer need to use the 'env ARCHFLAGS="-arch x86_64"' when you run bundler.
I had luck downloading and installing it straight from the site:
http://www.postgresql.org/download/macosx
I have used MacPorts for most of my server/low level program installations (PostgreSQL, MySQL, etc.). If you choose to go that route, you can then follow this blog post/tutorial on installing PostgreSQL via MacPorts onto your Mac. One thing to note on the PostgreSQL link: when following along, change the instances of 83 to 90. For example, you will see this in his steps:
sudo port install postgresql83 postgresql83-server
You can instead, type this to get the newest version of PostgreSQL
sudo port install postgresql90 postgresql90-server
I would also recommend grabbing a program such as Navicat for PostgreSQL Lite. It's free and nice to have to manage your local PostgreSQL DBs.
If you don't want to go with MacPorts, there's a similar alternative called HomeBrew that's quite popular ... I'm just too lazy to switch from MacPorts :).

Problem with Mongo DB using Mongoid Gem

I'm developing on Ubuntu, I have installed the mongoid gem, and when I run the rails server, I get this error
/home/username/.rvm/gems/ruby-1.9.2-p180/gems/mongo-1.3.1/lib/mongo/connection.rb:518:in `connect': Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)
I remembered using a command like brew install but I am pretty clueless. Am I missing something? Thanks in advance!
You need to have MongoDB installed, too. Since you're on Ubuntu, try this:
sudo apt-get install mongodb
If you saw any brew commands in any instructions you were reading, those were likely for Homebrew on Mac OS X, not for Ubuntu.
other possibility
you didnt start the server(which should auto-start usually)
mongod also has this weirdness
try to run sudo mongod in a foreground process
and the messages should tell you how to recover

Resources