Check mongo version linux

Какая версия MongoDB установлена на Ubuntu

Привет, я немного оболочка n00b.

может ли кто-нибудь сказать мне, как я проверю версию MongoDB, которая установлена на моей машине Linux Ubuntu?

Я вижу, что моя версия оболочки MongoDB: 1.2.2 поэтому я уверен, что сам MongoDB тоже устарел. И кто-нибудь знает о каких-либо документах «как обновить MongoDB»? Я нахожу mongodb.org чтобы немного запутаться.

пожалуйста, и спасибо.

Ok, если я использую db.версия () внутри оболочки mongo говорит 1.2.2

Если я $ mongod — version я получаю это:

Так почему же он не обновляется? Apt-get указывает на неправильное РЕПО / источник?

5 ответов

чтобы быть полным, краткое введение для «shell noobs»:

прежде всего, запустите свою оболочку — вы можете найти ее внутри общих сред рабочего стола под названием «Терминал» или «оболочка» где-то в меню приложения для настольных компьютеров.

вы также можете попробовать использовать комбинацию клавиш CTRL+F2, а затем одну из этих команд (в зависимости от используемой среды рабочего стола) и клавишу ENTER:

если все вышеперечисленное не удается, попробуйте использовать xterm — в большинстве случаев это сработает.

подсказка для следующих команд: выполните команды без $ — это просто маркер, идентифицирующий, что вы находитесь на оболочке.

после этого просто запустите mongod С —version флаг:

он показывает вам тогда что-то вроде

чтобы обновить его, просто выполните

ответ: прочитайте инструкцию #dua

Ok магия была в этой строке, которую я, по-видимому, пропустил при установке:

важно: убедитесь, что вы изменили 2.4.6 на последнюю версию (или все, что вы хотите установить). Найти номер последней версии здесь http://www.mongodb.org/downloads

когда вы вошли в оболочку mongo с помощью команды» mongo», на этот раз только вы заметите

также вы можете попробовать команду, в оболочке mongo , db.version()

в терминале просто введите стандартную команду:

Источник

MongoDB Versions

By Sulaksh More

Introduction to MongoDB Versions

MongoDB Version denotes the changes made and issues fixed from the previous release of the product. From 1.0 to the current version of 4.2, MongoDB has emerged as the most widely used NoSQL database Engine. MongoDB is one of the widely used NoSQL Database and has a JSON like Document. It stores everything as a key-value pair. Written in C++, Go, JavaScript, and Python, MongoDB is a cross-platform database program.

How to Read a MongoDB Versions?

The system used to denote versions in MongoDB is A.B.C. Now, with A.B it defines if the MongoDB version if of development or release series, while the C refers to the number of the revision or the patch number.

Hadoop, Data Science, Statistics & others

Odd-Even Labelling in Versions

We have understood how versions work in MongoDB. Out of the A.B, B can be even and at times odd.

When the B in A.B is even, then the version is of release series. For production use, the release versions are preferred as these are stable. And when the B in A.B is odd, it is clear that it’s a development series version and is not suitable for production use, better only for testing purposes.

Читайте также:  Mac os bootcamp drivers

Initial Release

11 years ago, in February 2009, an initial release was made. MongoDB 1.0.0 was the first suitable release. This 1.0.0 version supports a single master, environment for replica pairing, and master-slave architecture. While there was no major change between 0.9.10 and 1.0.0, the latter version was stable, and for over 18 months, the code was kept and tested in a production environment.

Compared to previous versions, 1.x has few new features. Along with adding more indexes per single collection, the index creation tasks were boosted and faster output. Being a JSON based database engine, JavaScript was an important programming language in connection, and with this version, and ability to implement and save JavaScript functions was added for better programmability, and few more minor changes were made.

MongoDB Features

Other than the above-mentioned features for a specific version, MongoDB has a lot of features. MongoDB is one of the most widely used NoSQL databases, offers a wide range of features, and is completely reliable. To index the documents stored using primary and secondary indices, Mongodb provided a high availability with the feature of Replication.

JavaScript can be used on the server-side to execute queries. It also supports multi-document ACID transactions from the 4.0 release. Aggregation pipeline is one of the most effective execution pipelines, which can be executed in three ways: the Aggregation Pipeline, Single Purpose Aggregation, and Map Reduce Function. GridFS is a file system supported in MongoDB, with load balancing and data replication features.

Latest Release

Currently, 4.2 is the latest version of MongoDB and is stable for production use. It was released in August 2019. One of the highlighted features with the latest release is distributed transactions. Here, distributed transaction points to transactions between multiple documents on a shared cluster and with replica sets.

Then the limit of 16MB for a transaction was removed in the latest version. MongoDB’s latest version 4.2 also removed the storage engine, deprecated MMAPv1. With the 4.2 version, the document’s shard key value can be updated, which was immutable but can be updated now unless the key value is immutable. New TLS options have been added for Mongod, Mongos, and the MongoDB shell. TLS provides functionality identical to SSL.

Multiple commands have been removed. The Mexican for find and cursor.maxScan() for MongoDB shell has been removed. Now, we can use maxTimeMS and cursor.maxTimeMS() commands instead.

The group command, which has a method like “db.collection.group()” has been dropped, and now to produce the result similar to that query, we have to use the aggregate method. In the aggregate pipeline, adding a $group stage will return the same results as of group command. The commands of copied and clone are also being removed. As an alternative, mongodump can be used instead of copy, or we can write a script using the drivers. The mongodump and mongorestore can be used instead of clone command. Most of the commands listed above, which have been removed in 4.2 latest version, can be used in earlier versions.

How to Check Version of MongoDB?

Now that we have understood how different versions have different impacts on the working and functioning of the Database. To check what version of MongoDB you are using, there are command-line queries for cross-platform operating systems. Linux based Ubuntu is widely used and below is how you can check your version of MongoDB:

Output:

  • Executing the above command, you will get details of the current MongoDB on your system. As you can see in the above screenshot, my current version of MongoDB is 3.4. other than that, you can check the Github version for the same and OpenSSL version, which works as a security meta point for computers and is used to generate various private keys and install security certificates.
  • Interpreting the output: as we have understood earlier, the versions denote various factors of the release. Likewise, my current version is 3.4.17, which was released on Sep 7, 2018.
  • Issues fixed with 3.4.17: error() or severe() function can be used for windows stack traces instead of log(). Now, SSL_version can be added to the metadata logging of the client. When terminated MongoDB client runs the buffered command. Concerning Security, Missing Log Redaction caused due to confusion with redactForLogging() command has been solved.
  • Now, 4.2.4 is expected to be the next release with issues fixed and improved functions.
Читайте также:  Miracast windows 10 через lan

Conclusion

MongoDB’s latest version is 4.2 released in August 2019, and the initial production-compatible version was 1.0. Over the period, various changes have been made and issues fixed. Using the “mongod –version” command, you can check the installed MongoDB release version. Understanding what version you have, you can check for issues fixed and can also report an issue. MongoDB is available in English Language, it is a Document oriented Database engine and is Developed and Managed by MongoDB Inc.

This is a guide to MongoDB Versions. Here we discuss how to read MongoDB versions, initial release, and oldest release and how to check versions. You can also go through our other related articles to learn more –

All in One Data Science Bundle (360+ Courses, 50+ projects)

Источник

Is mongodb running?

I have installed mongodb and the php drivers on my unix server.

My question is how can I tell if mongodb is running? Is there a simple command line query to check status? If I start it once from the shell will it keep running if I exit the shell (this doesn’t seem to be the case). How can I make the mongodb connection persistent and auto start on server reboot?

-bash-3.2$ su
Password:
[root@xxx]# cd /var/lib
[root@xxx]# ./mongodb-linux-i686-1.6.5/bin/mongod
./mongodb-linux-i686-1.6.5/bin/mongod —help for help and startup options
Wed Feb 23 08:06:54 MongoDB starting : pid=7271 port=27017 dbpath=/data/db/ 32-bit

** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations

** WARNING: You are running in OpenVZ. This is known to be broken.

Wed Feb 23 08:06:54 db version v1.6.5, pdfile version 4.5
Wed Feb 23 08:06:54 git version: 0eb017e9b2828155a67c5612183337b89e12e291
Wed Feb 23 08:06:54 sys info: Linux domU-12-31-39-01-70-B4 2.6.21.7-2.fc8xen #1 SMP Fri
Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_37
Wed Feb 23 08:06:54 [initandlisten] waiting for connections on port 27017
Wed Feb 23 08:06:54 [websvr] web admin interface listening on port 28017

If I open a seperate shell I can then then connect to mongodb:

-bash-3.2$ cd /var/lib
-bash-3.2$ ./mongodb-linux-i686-1.6.5/bin/mongo
MongoDB shell version: 1.6.5
connecting to: test
db.foo.find()

However if I close the initial shell I can’t connect:

-bash-3.2$ cd /var/lib
-bash-3.2$ ./mongodb-linux-i686-1.6.5/bin/mongo
MongoDB shell version: 1.6.5
connecting to: test
Wed Feb 23 08:25:10 Error: couldn’t connect to server 127.0.0.1 (anon):1154
exception: connect failed

Источник

Database.Guide

Categories

7 Ways to Check your MongoDB Version

If you’re wondering what version of MongoDB you’re running, here are 7 ways you can use to check.

Actually, some of these check your MongoDB server version, and some check your mongo shell version. In any case, let’s take a look.

Читайте также:  Как создать свою графическую оболочку для linux

The db.version() Method

If you’re already connected to MongoDB, you can use the db.version() method to check the version.

This method returns the version of the mongod or mongos instance.

The mongod —version Command

If you’re not connected to MongoDB, you can open a Terminal window or Command Prompt and run mongod —version .

If you’re on Windows and you haven’t added MongoDB to your PATH, you’ll need to use the full path.

Ironically, you’ll need to know the version before you can write the path! (You’ll need to replace 4.4 with the your MongoDB version).

You could alternatively navigate to the folder via the file explorer – a process which will also reveal the version number.

The mongo —version Command

If you need the mongo shell version, you can run the mongo —version command from a Terminal window or Command Prompt.

Windows non-PATH example:

The mongo —help Command

Another way to get the mongo shell version is to run mongo —help from a Terminal window or Command Prompt.

The help list is quite long, so I won’t output it all here. The MongoDB shell version is listed at the top.

Windows non-PATH example:

The mongo Command

Simply connecting to MongoDB via the mongo shell will result in both the mongo shell version and the MongoDB server version being displayed.

For example, opening a Terminal window or Command Prompt, and entering the following command, connects to MongoDB:

Once it connects, you should see something like this:

The message usually continues on, but the mongo shell version and the MongoDB server version are listed near the top (as shown here).

The buildInfo Command

The buildInfo command is an administrative command which returns a build summary for the current mongod .

It provides a lot more than the version info, but version information is included in two fields: the version field and the versionArray field.

Via the MongoDB Compass GUI

If you use MongoDB Compass, you can find the MongoDB edition listed in the sidebar (at least, that’s where it’s located at the time this article was written).

Источник

How to run the mongo shell on Ubuntu

I just installed MongoDB version 3.2.4 on Ubuntu 15.10 and I want to run the mongo shell. All docs are suggesting to execute first the command cd

My question is where is that mongodb installation dir ? How I can find it?

Apparently it may be something wrong with the mongod . Could not find /usr/bin/mongod Details below.

However that files seems to be there:

# mongo —version MongoDB shell version: 3.2.4 root@levilinode:

# mongod —version db version v3.2.4

# mongo MongoDB shell version: 3.2.4 connecting to: test 2016-04-12T15:50:06.520-0400 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2016-04-12T15:50:06.520-0400 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:224:14 @(connect):1:6

3 Answers 3

Multiple options:

  1. Using the system’s files reference database:

$ sudo updatedb; locate mongo

  1. Restart your shell after install and try:

Both mongo and mongod commands are in the same dir, so if this dir has been added in your $PATH by the installer, this should tell you where they are.

  1. check manually in /var/lib or /usr/local or /usr/bin (must be a symlink though)
  2. check the daemon process line which usually give a hint about the path as it show the path of the config file

Источник

Оцените статью