Discussion:
Unable to set up mongod.config file on Windows
(too old to reply)
Inner
2016-02-08 00:09:57 UTC
Permalink
I have read the documentation on the configuration files, but it is not
clear as to how I should create this file. I am unable to find the /etc
directory, and am stuck since I need to change some of the configs in order
to be able to remotely connect to my database from another computer. I have
read

https://groups.google.com/forum/#!searchin/mongodb-user/config/mongodb-user/nEE638lCwqw/9BNOqSQ2iAsJ

but i do not see how I can create the config file from those commands. All
help is appreciated, thank you.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/963aefa2-d72e-485e-8d56-9aaa2cdc3e89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stephen Steneker
2016-02-08 00:25:45 UTC
Permalink
On Monday, 8 February 2016 11:17:34 UTC+11, Inner wrote:

I have read the documentation on the configuration files, but it is not
clear as to how I should create this file. I am unable to find the /etc
directory, and am stuck since I need to change some of the configs in order
to be able to remotely connect to my database from another computer.

Hi,

As at MongoDB 3.2, the Windows installer does not have a default location
for a config file; you have to provide the path to a config file when
starting mongod.exe. The /etc directory sounds like a reference to a
location for a Linux package install.

Typically you will want to Configure a Windows Service for MongoDB
<https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#configure-a-windows-service-for-mongodb-community-edition>
rather than running mongod.exe from the command line. The tutorial for
configuring a Windows service also includes an example of creating a
configuration file
<https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#create-a-configuration-file>
.

Regards,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/ba93af0d-96d2-40c9-988a-0b6dd6f7c589%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Inner
2016-02-08 01:51:46 UTC
Permalink
I followed the instructions but when I called mongod --config

"C:\mongodb\mongod.cfg" --install, it said there is no such file or directory.
Is there a special way to create the .cfg file? Right now it is just a text file with the .cfg extension.
Post by Inner
I have read the documentation on the configuration files, but it is not
clear as to how I should create this file. I am unable to find the /etc
directory, and am stuck since I need to change some of the configs in order
to be able to remotely connect to my database from another computer.
Hi,
As at MongoDB 3.2, the Windows installer does not have a default location
for a config file; you have to provide the path to a config file when
starting mongod.exe. The /etc directory sounds like a reference to a
location for a Linux package install.
Typically you will want to Configure a Windows Service for MongoDB
<https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#configure-a-windows-service-for-mongodb-community-edition>
rather than running mongod.exe from the command line. The tutorial for
configuring a Windows service also includes an example of creating a
configuration file
<https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#create-a-configuration-file>
.
Regards,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/e7815371-6cc0-44d6-b6a8-123f4c2f0bf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stephen Steneker
2016-02-08 02:42:06 UTC
Permalink
On Monday, 8 February 2016 12:51:46 UTC+11, Inner wrote:

I followed the instructions but when I called mongod —config
“C:\mongodb\mongod.cfg” —install, it said there is no such file or
directory.

Is there a special way to create the .cfg file? Right now it is just a text
file with the .cfg extension.

Hi,

There is no special way to create the config file .. it is indeed just a
text file and the name/extension can be any valid filename.

Can you post the output of dir C:\mongodb\mongod.cfg and type
C:\mongodb\mongod.cfg if the file exists?

Also, what are your versions of MongoDB and Windows O/S?

Thanks,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/99c0945b-04bd-4584-b964-eb5278d1f22e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Inner
2016-02-08 03:06:02 UTC
Permalink
Thanks for the reply. I made the command "dir C:\mongodb\mongod.cfg.txt"
and it worked when I called the --config command. However I still do not
understand how I can add additional IP addresses to the bind_ip field, as
it is not specified within my cfg file. Also, I noticed that it is not
actually a .cfg file, but simply a .txt file named "config.cfg" which seems
strange to me.
Post by Stephen Steneker
I followed the instructions but when I called mongod —config
“C:\mongodb\mongod.cfg” —install, it said there is no such file or
directory.
Is there a special way to create the .cfg file? Right now it is just a
text file with the .cfg extension.
Hi,
There is no special way to create the config file .. it is indeed just a
text file and the name/extension can be any valid filename.
Can you post the output of dir C:\mongodb\mongod.cfg and type
C:\mongodb\mongod.cfg if the file exists?
Also, what are your versions of MongoDB and Windows O/S?
Thanks,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/a0129fbe-844c-4e38-aab4-854bd205d87a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stephen Steneker
2016-02-08 04:18:50 UTC
Permalink
On Monday, 8 February 2016 14:06:03 UTC+11, Inner wrote:

Thanks for the reply. I made the command “dir C:\mongodb\mongod.cfg.txt”
and it worked when I called the —config command.

Hi,

It sounds like your text editor may have automatically added a .txt
extension when you saved the file as mongod.cfg.

As I mentioned, the config file can be any valid filename 
 mongod.cfg,
mongod.cfg.txt, or mongod.txt would all work. There is no specific file
type or extension required, but you may find it convenient to choose an
extension that can be associated with your favourite text editor (eg. .txt).

However I still do not understand how I can add additional IP addresses to
the bind_ip field, as it is not specified within my cfg file.

By default MongoDB listens to all local network interfaces. You can use the
bindIp config option
<https://docs.mongodb.org/manual/reference/configuration-options/#net.bindIp>
to specify a comma-separated list of IP addresses which are more
restrictive than the default setting.

Note that the bind IP restriction only limits the network interfaces that
the MongoDB server listens for connections on, and is not a substitute for
configuring a firewall
<https://docs.mongodb.org/manual/tutorial/configure-windows-netsh-firewall/>
or role-based access control
<https://docs.mongodb.org/manual/core/authorization/>.

What are you trying to achieve with multiple bind IP addresses? Are you
having issues connecting to your MongoDB server, or trying to restrict
remote connections?

If you are trying to configure additional security for your MongoDB
deployment please review the MongoDB Security Checklist
<https://docs.mongodb.org/manual/administration/security-checklist/>.

Also, if you have any further questions on configuration please include the
specific version of MongoDB server you are using. Relevant configuration
options may vary depending on your version of MongoDB.

Regards,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/0d85ac82-3c4d-4aa4-82e9-73e3af1cbc81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Inner
2016-02-08 04:41:57 UTC
Permalink
Hi,

I was trying to remotely access my mongod instance from another computer.
Thankfully, I have successfully made that happen. I am doing this since I
want to host the database on a different machine than my application. I am
using the intellij IDEA shell to connect remotely, which specifies an
optional field for authentication. I am assuming this is the role-based
access control you were referring to?
Post by Stephen Steneker
Thanks for the reply. I made the command “dir C:\mongodb\mongod.cfg.txt”
and it worked when I called the —config command.
Hi,
It sounds like your text editor may have automatically added a .txt
extension when you saved the file as mongod.cfg.
As I mentioned, the config file can be any valid filename 
 mongod.cfg,
mongod.cfg.txt, or mongod.txt would all work. There is no specific file
type or extension required, but you may find it convenient to choose an
extension that can be associated with your favourite text editor (eg. .txt
).
However I still do not understand how I can add additional IP addresses to
the bind_ip field, as it is not specified within my cfg file.
By default MongoDB listens to all local network interfaces. You can use
the bindIp config option
<https://docs.mongodb.org/manual/reference/configuration-options/#net.bindIp>
to specify a comma-separated list of IP addresses which are more
restrictive than the default setting.
Note that the bind IP restriction only limits the network interfaces that
the MongoDB server listens for connections on, and is not a substitute for
configuring a firewall
<https://docs.mongodb.org/manual/tutorial/configure-windows-netsh-firewall/>
or role-based access control
<https://docs.mongodb.org/manual/core/authorization/>.
What are you trying to achieve with multiple bind IP addresses? Are you
having issues connecting to your MongoDB server, or trying to restrict
remote connections?
If you are trying to configure additional security for your MongoDB
deployment please review the MongoDB Security Checklist
<https://docs.mongodb.org/manual/administration/security-checklist/>.
Also, if you have any further questions on configuration please include
the specific version of MongoDB server you are using. Relevant
configuration options may vary depending on your version of MongoDB.
Regards,
Stephen
​
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/1b4df6db-db37-4f0e-b0f4-bca84f998c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...