I'm a new to linux platform. I need to establish mongodb as a start-up service. In fedora, I was able to run following commands and successfully did the task.
chkconfig —add mongodb
chkconfig mongodb on
But in ubuntu 13.10, this chkconfig command is not available. I found the update-rc.dcommand is an alternative for that. But I'm still unable to execute those cammands. How can I achieve this task in ubuntu ?
Contrary to Fedora the services that are installed on an Ubuntu system are enabled by default, so you don't need to add or enable them to the init system.
You can check the service status with:
$ service mongodb status
On 12.04 LTS the 10gen mongodb package provides integration into the upstart init system provided in Ubuntu, you can find the job file in /etc/init/mongodb.conf
Related
I am new to MongoDB. I already read the docs and MongoDB Community Edition.
It is working
but, I tried to run the "mongo" command: It is not working!!
...So i did:
sudo apt install mongodb-clients
(I saw after that this command uninstalled the mongodb server, which i had to install again)
When it finished, i tried again the "mongo" command. It is not working !!
How do I solve this?
You may want to try "mongosh" command.
As specified on documentation you provided.
Start a mongosh session on the same host machine as the mongod. You
can run mongosh without any command-line options to connect to a
mongod that is running on your localhost with default port 27017.
You need a client in order to interact with mongoDB deployment such as mongosh or Compass.
The MongoDB Shell, mongosh, is a fully functional JavaScript and
Node.js 16.x REPL environment for interacting with MongoDB
deployments. You can use the MongoDB Shell to test queries and
operations directly with your database.
Hope It helps.
The mongodb-server and the mongodb-clients debian packages were for MongoDB 3.x, maintained by Ubuntu.
Since MongoDB 4.x, MongoDB provide their own debian packages, but they named them mongodb-org-server, mongodb-mongosh and mongodb-cli. The client command mongo is split into two different commands mongocli and mongosh.
I have installed mongoDB in my Ubuntu system but unable to start it.while i am running this service mongod start it throwing the following message.
start: Unknown job: mongod
Here i need to start the MongoDB. Please help me.
Looks like the mongod is not installed properly. Verify this by checking the presence of System V init script in location /etc/init.d/mongod. If not present, try installing the mongod again.
I would like to ask on how to start mongodb in linux mint. I tried sudo service mongod start but it shows the error mongod: unrecognized service. Why is this happen. When I run the sudo service in ubuntu Linux there is no problem like this. BUt why its not work in Linux mint? Is there a solution for this?
I just installed Mongo DB in LinuxMint Sarah (18) and for me, the following command worked:
sudo service mongodb start.
Checking that it works can be done either by executing 'top' command or checking the log file in mongodb folder (instructions in the following link ---> https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition)
For stopping mongodb, the same command but typing stop 'sudo service mongodb stop'
In the previous link, both commands are included but without the 'b', maybe they just made a typing mistake :)
I followed this Almost idiot's guide to install postgresql and postgis on Centos 7 and got stuck starting the database itself with the following command:
[root#localhost cmaps]# service postgresql-9.3 initdb
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
If I install the postgresql package from Centos repository (version 9.2) the command works, but then I they don't have postgis, and there is no official posgresql-92 repository for Centos 7.
Any idea on what's happening?
Thank you!
I had the same problem and solve it by changing the path
/usr/pgsql-9.3/bin/postgresql93-setup initdb
Note that the path is different
CentOS 7 is based on systemd. PostgreSQL packages use a different command for initdb there:
/usr/lib/pgsql-9.3/bin/postgresql93-setup initdb
On older versions, call the initscript directly.
/etc/init.d/postgresql-9.3 initdb
For Centos 7.3 installed on MS Azure platform the script is located at
/usr/bin/postgresql-setup initdb
the version number is absent from the name of these as well:
db data & config location: /var/lib/pgsql/data/
service name /sbin/service postgresql status or systemctl status postgresql.service
I'm on a Red Hat Enterprise Linux Client release 5.4 (Tikanga) machine
I created my /etc/yum.repos.d/10gen.repo like this:
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
I installed MongoDB with: sudo yum install mongo-10gen mongo-10gen-server
but when I run: sudo service mongod start
I get: Missing SERVICE_URI environment variable
help! :)
You have an executable in PATH called service that is not the standard utility that starts services. Use /sbin/service instead of service.
Does /etc/init.d/mongod start work?
If so, something has overloaded the service command - in which case, the simplest thing to do is just use /etc/init.d/mongod start