GithubHelp home page GithubHelp logo

mongoctl's People

Contributors

akung0324 avatar bitprophet avatar dampier avatar enzolamzo avatar gregbanks avatar mat-loz avatar willshulman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongoctl's Issues

How start mongod using --httpinterface --rest with mongoctl?

I tried starting MongoDb using mongoctl start --httpinterface --rest REST MyServer but I got this error:

unrecognized arguments: --httpinterface
Usage: start [<options>] SERVER_ID
see 'mongoctl start --help' for detailed options

Taking a look at the mongoctl command reference did not help.

pip install mongoctl fails on OS X

On OS X 10.9.1 (w/ Python 2.7.5), installation of mongoctl fails with pip:

sudo pip install mongoctl
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.3.1

Error when removing a node that is no longer dns-mapped

Make it possible to remove a node that is no longer DNS-mapped when the node is no longer in the cluster config.

  File "/usr/local/lib/python2.7/dist-packages/mongoctl/utils.py", line 275, in is_same_address

    return (is_same_host(hostport1[0], hostport2[0]) and

  File "/usr/local/lib/python2.7/dist-packages/mongoctl/utils.py", line 263, in is_same_host

    ips2 = get_host_ips(host2)

  File "/usr/local/lib/python2.7/dist-packages/mongoctl/utils.py", line 298, in get_host_ips

    raise MongoctlException("Invalid host '%s'. Cause: %s" % (host, e))

MongoctlException: Invalid host 'foo.bar.com'. Cause: [Errno -2] Name or service not known


easy_install mongoctl doesn't generate default config

Since pip install failed on my OS X machine (see #12) I tried sudo easy_install mongoctl - which succeeds. However, it doesn't seem to generate a default ~/.mongoctl/mongoctl.config file:

mongoctl connect mongodb://URL
ERROR: Config file /Users/niallo/.mongoctl/mongoctl.config does not exist.

My suggestion would be to have mongoctl generate or use the default config at runtime, instead of relying on the presence of on-disk file.

Use SSL Connection with configured clusters

mongoctl does not use community_ssl with configured clusters as there does not appear to be a way to specify that a clusters should use ssl.

A cluster is configured as preferSSL, when using mongoctl connect cluster-name, an error is returned:

Unable to find a compatible 'mongo' executable for version 3.0.8 (edition community). You may need to run 'mongoctl install-mongodb 3.0.8 ' to install it.

The installed versions were:

$ ./mongoctl list-versions

--------------------------------------------------------------------------------
VERSION              EDITION              LOCATION
--------------------------------------------------------------------------------
3.0.8                community_ssl        /usr

Considering that the server is configured with preferSSL and community_ssl was available, the community_ssl shell should have been used.

Mongo URI AuthSource Not Supported with dump or restore

Mongo URI option authSource is not supported with mongoctl dump or mongoctl restore. The work around is to use the --authenticationDatabase command line option.

While the work around is functional, support for authSource would make scripting and automation much.

brew install mongoctl

Please publish a brew recipe, it's pretty crazy that I need to sudo install this.

mongoctl does not install with pip-3.2

# pip-3.2 install mongoctl
Downloading/unpacking mongoctl
  Downloading mongoctl-0.9.0.tar.gz (78Kb): 78Kb downloaded
  Running setup.py egg_info for package mongoctl
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/build/mongoctl/setup.py", line 74
        os.chmod(dot_mongoctl_dir, 00755)
                                       ^
    SyntaxError: invalid token
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/build/mongoctl/setup.py", line 74

    os.chmod(dot_mongoctl_dir, 00755)

                                   ^

SyntaxError: invalid token

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /build/mongoctl

Configure server connections by URI

I think this is an enhancement request, or else I just can't figure out your docs.

The reason I started using mongoctl was so that I could connect to my mongo servers using the mongodb:// uri instead of parsing it into {host, port, username, password, database} every time. But when setting up .mongoctl/servers.config I can't use the URI but need to parse it manually.

configure-cluster command is prompting for local and admin password even though server is configured without password

When we run configure cluster option, utility is prompting for local and admin password even though server is configured without password. But cluster seems to configure right. It only happens first time, re-running the same command for reconfiguring the cluster works fine, i.e. passwords are not prompted.

mongoctl --config-root /mnt/mongodb/mongoctl configure-cluster mongodb-insights

Validating cluster 'mongodb-insights'...
Initializing replica set cluster 'mongodb-insights' ...
Determining which server should be primary...
Selected server 'xxxxxxxx' as primary.
Executing db command {
"replSetInitiate": {
"_id": "mongodb-insights",
"members": [
{
"host": "",
"_id": 0
}
]
}
}
WARNING: Command {
"replSetInitiate": {
"_id": "mongodb-insights",
"members": [
{
"host": "",
"_id": 0
}
]
}
} is taking a while to complete. This is not necessarily bad.
Will now wait for the replica set to initialize.
Enter username for database 'local':
Enter password for user 'local'
Password:
ERROR: Invalid login!
Enter username for database 'local':
Enter password for user 'local'
Password:
ERROR: Invalid login!
Enter username for database 'local':
Enter password for user 'local'
Password:
ERROR: Invalid login!
Enter username for database 'admin':
Enter password for user 'admin'
Password:
ERROR: Invalid login!
Enter username for database 'admin':
Enter password for user 'admin'
Password:
ERROR: Invalid login!
Enter username for database 'admin':
Enter password for user 'admin'
Password:
ERROR: Invalid login!
ERROR: Unable to initialize replica set cluster 'mongodb-insights'. Cause: Failed to authenticate to admin db

Re-running same command works fine

mongoctl --config-root /mnt/mongodb/mongoctl configure-cluster mongodb-insights

Validating cluster 'mongodb-insights'...
Re-configuring replica set cluster 'mongodb-insights'...
Current replica set configuration:
{
"_id": "mongodb-insights",
"version": 3,
"members": [
{
"host": "",
"_id": 0
}
]
}
Executing the following command on server 'xxxxxxx':
{
"replSetReconfig": {
"_id": "mongodb-insights",
"version": 4,
"members": [
{
"host": "",
"_id": 0
}
]
},
"force": false
}
Re-configuration for replica set cluster 'mongodb-insights' ran successfully!
New replica set configuration:
{
"_id": "mongodb-insights",
"version": 4,
"members": [
{
"host": "",
"_id": 0
}
]
}

BaseException.message has been deprecated as of Python 2.6

I just followed the installation instructions but get this errors when running restore:

mongoctl restore mongodb://localhost:37017/db_development mydumpdir/

/Library/Python/2.6/site-packages/mongoctl/mongoctl.py:5257: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message  = message
/Library/Python/2.6/site-packages/mongoctl/mongoctl.py:5261: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return self.message

How can I check which version of mongoctl I have? I couldn't find an option for that...

Thanks.

Can't install mongo 3.6.3 version

Trying to install the latest mongo mongoctl install-mongodb 3.6.3

Looking for a download for MongoDB ('3.6.3', 'community')
Failed to install MongoDB '3.6.3 (community)'. Cause: No mongodb binary (version: '3.6.3', edition: 'community')

Can mongoctl run mongod as a nologin user?

For security reason, I'd like to run mongod as a nologin user, '_mongo' for example.

I used to start mongod using command: sudo -u _mongo mongod ...

Now I want to switch to mongoctl, but I don't how to achieve this with mongoctl.

New Database

How does one initialize a new database with mongoctl from a script?

I would like to create a new database instance on an existing server from a script.

Creating a new database requires using "use dbname", however, if I put "use dbname" in an eval script or direct to the eval option, I receive a syntax error.

uninstall-mongodb fails when there is another partial version running

There is a 3.2.11 mongod running on that box and uninstalling 3.2.1 fails

mongoctl error: ERROR: Cannot uninstall '/home/madmin/deploy/lib/src/mongodb-linux-x86_64-community_ssl-3.2.1' because its currently being used. Please terminate all running processes then try again.

How to make it work with IPs instead of DNS names?

Hi all,

My configuration for the server look as follow:

{
"_id": "MyClusterServer2",

    "description" : "My cluster member",

    "address": "192.168.23.232:37027",
    "cmdOptions":{
        "port": 37027,
        "dbpath": "~/mongodb-data/my-cluster-server2",
        "directoryperdb": true
    }
},

for other server (closter node which is aimed to be run locally) I define "localhost" as the host.

But during run (server/cluster start) "mongoctl" produces number of errors as follow:

Unable to resolve address '192.168.132.236' for server 'MyClusterServer1'. Cause: Invalid host 'ip-192-168-132-112'. Cause: [Errno -2] Name or service not known
Unable to resolve address '192.168.132.112' for server 'MyClusterArbiter'. Cause: Invalid host 'ip-192-168-132-112'. Cause: [Errno -2] Name or service not known
Unable to determine primary server for replica set cluster 'MyCluster'

Even more complicated is that despite of that, it starts mongo instance.
But then I can't delete it:

mongoctl stop MyClusterServer1

Checking to see if server 'MyClusterServer1' is actually running before stopping it...
Unable to determine pid for server 'MyClusterServer1'. pid file '/home/ubuntu/mongodb-data/my-cluster-server1/pid.txt' does not exist
Stopping server 'MyClusterServer1' (pid=[Cannot be determined])...

Sending the following command to localhost:27017:
{
"shutdown": 1,
"force": false
}

Failed to gracefully stop server 'MyClusterServer1'. Cause: shutdown must run from localhost when running db without auth
Issue the shutdown with force command? [y/n] y

Sending the following command to localhost:27017:
{
"shutdown": 1,
"force": true
}

Failed to gracefully stop server 'MyClusterServer1'. Cause: shutdown must run from localhost when running db without auth
Cannot forcibly stop the server because the server's process ID cannot be determined; pid file '/home/ubuntu/mongodb-data/my-cluster-server1/pid.txt' does not exist.
Unable to stop server 'MyClusterServer1'.

Though server is up and running:

mongoctl status MyClusterServer1

Status for server 'MyClusterServer1':
{
"connection": true,
"serverStatusSummary": {
"connections": {
"current": 3,
"available": 419427
},
"host": "894c34d3b089",
"version": "3.2.6"
},
"selfReplicaSetStatusSummary": {
"stateStr": "SECONDARY",
"name": "192.168.132.236:27017"
}
}

Hence, everything is messed up. It somehow works, though telling me that it can't connect and actually even find other nodes.
I can't stop it at all.

Regards,
Taras.

How to run a specific version of MongoDB?

I have just come across this tool and it looks really great!

I have installed a multiple versions of MongoDB:

$ mongoctl list-versions

--------------------------------------------------------------------------------
VERSION              EDITION              LOCATION
--------------------------------------------------------------------------------
2.4.12               community            /Users/ytakeda/mongodb/mongodb-osx-x86_64-community-2.4.12
2.6.10               community            /Users/ytakeda/mongodb/mongodb-osx-x86_64-community-2.6.10
3.0.8                community            /Users/ytakeda/mongodb/mongodb-osx-x86_64-community-3.0.8
3.2.0                community            /Users/ytakeda/mongodb/mongodb-osx-x86_64-community-3.2.0

Now, I would like to pick and choose one of these versions for our testing, then later switch over to the other, etc. How do I start the specific version with $ mongoctl start command?

pymongo==3.0.3: no module named Connection

I just installed pymongo 3.0.3 via pip install --upgrade pymongo and it reported no module named Connection:

In [2]: pymongo.version
Out[2]: '3.0.3'

In [3]: from pymongo import Connection
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-dd44bc3249d3> in <module>()
----> 1 from pymongo import Connection

ImportError: cannot import name Connection

In [4]: from pymongo import connection
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-71c9e4ec1bcd> in <module>()
----> 1 from pymongo import connection

ImportError: cannot import name connection

In [5]: import pymongo.connection.Connection
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-5-282b89157c85> in <module>()
----> 1 import pymongo.connection.Connection

ImportError: No module named connection.Connection

ImportError: No module named connection

Apologies if this a total python newb issue rather than a mongoctl issue.
I'm seeing the following behavior, any ideas on how to resolve?

After uninstalling and reinstalling python (2.7.9) via Homebrew on OS X 10.10 and trying pip installs with sudo and without, I keep getting this error:

Traceback (most recent call last):
  File "/usr/local/bin/mongoctl", line 48, in <module>
    from mongoctl import mongoctl
  File "/usr/local/lib/python2.7/site-packages/mongoctl/mongoctl.py", line 38, in <module>
    import objects.server
  File "/usr/local/lib/python2.7/site-packages/mongoctl/objects/server.py", line 21, in <module>
    from pymongo.connection import Connection
ImportError: No module named connection

--edition argument in install-mongodb

I was prompted by an error message to install the community_ssl version, but when I try that, I get the following error about the argument being unrecognized:

% mongoctl install-mongodb --edition community_ssl 3.0.5      
unrecognized arguments: --edition 3.0.5

I am running mongoctl 0.9.0.

Any ideas?

mongoctl prefer ssl does not use --ssl in executed command

logs:

~ Tue Jan 20 17:18:24 mongoctl --client-ssl-mode prefer connect MONGODB_URI


Will not be using database repository for configurations at this time!
REASON: Could not establish a database connection to mongoctl's database repository.
CAUSE: [Errno 61] Connection refused.


Locating default server for cluster 'MONGODB_URI'...
Connecting to server '......'
Using mongo at '/Users/mongochang/mongodb/mongodb-osx-x86_64-community_ssl-2.6.1/bin/mongo' version '2.6.1 (community_ssl)'...
Executing command:
/Users/mongochang/mongodb/mongodb-osx-x86_64-community_ssl-2.6.1/bin/mongo dsxxxxx.mongolab.com:xxxx/ssl -u **** -p **** (should use --ssl)
MongoDB shell version: 2.6.1
connecting to: ..........
Error while trying to show server startup warnings: not authorized on admin to execute command { getLog: "startupWarnings" }

Remote server/cluster management

It would be a great feature to be able to remotely manage servers and eliminating the requirement to have mongoctl installed on each cluster node.

install-mongdb fails on osx, bad architecture

It looks like its trying to fetch a nonexistent i386 version

dmacd$ mongoctl install 2.2.5

Running install for osx 32bit to mongoDBInstallationsDirectory (/Users/dmacd/mongodb)...
ERROR: Unable to download from url 'http://fastdl.mongodb.org/osx/mongodb-osx-i386-2.2.5.tgz' (response code '403'). It could be that version '2.2.5' you specified does not exist. Please double check the version you provide

Running the python 2.7.5 build from python.org.

Would love to use your tool, is there any way to provide a literal url?

Latest Stable Version file out of date

Today we tried to upgrade to mongo v 2.4.3, but were unable to do so using mongoctl. We soon realized that this is because the value of the file mongo_latest_stable_version.txt is 2.2.4! Please update asap.

test

i am testing you!

Add security warning about open MongoDB instances

Hey everyone,

I would like to propose that we do something against the rising amount of open, insecure MongoDB instances exposed to the public.

By default, mongoctl sets up a Mongo server with no auth parameter in the config, meaning that if you use mongoctl on a server, everybody can connect to it, if you know the IP or domain. This problem is so widespread, that over 35,000 MongoDB instances are public, and hackers actively exploit this.

This is not a bug in mongoctl, and these things happen because developers don't inform themselves enough, but nonetheless I think we should put a big, fat warning up on this repo, because a lot of users are falling into this trap. And that's because we easily let them:

  • Users intuitively create a user and password after installing MongoDB, but do not realize that the database is still accessible using no credentials
  • No mention of the auth parameter in the mongoctl documentation and hidden deep in the MongoDB documentation.
  • mongoctl hides the configuration under the surface and comes "packaged with out-of-the-box configurations"
  • Because of the easy setup, mongoctl is most often used by beginners, and because of it's cluster ability, it is most often used in production.

I confess that I also did not read the docs in detail and had a database out in the wild โ€“ fortunately I was able to fix it before something bad happened because DigitalOcean sent me this email:

bildschirmfoto 2015-12-21 um 18 13 39

With ~6000 installs per year, mongoctl has some significance when it comes to the number of open Mongo databases out there. While mongoctl is not guilty for this, it should be a lot easier for developers to figure out how to set up a secure MongoDB.

That's why I propose that the Github repo and the mongoctl website get a prominent warning "Make sure to use {auth: true} in production!", because really, that is the essential information which more people need to know.

Best,
Jonny

Readonly users

Is it possible to create a user in the seedUsers list as read only?

Thanks

Mongo URI AuthSource Not Supported with Connect

It appears that a mongo URI that uses the authSource option cannot properly connect to the database.

Given a URI of the form: mongodb://user:pass@server-1:27017,server-2:27017/database?replicaSet=rs-1&ssl=true&authSource=admin

The response is

Locating default server for cluster 'mongodb://*****:*****@server-1:27017,server-2:27017/database'...
Connecting to server 'server-1:27017'
Invalid login!
Enter username for database 'database': 

The authSource to the admin database appears to be lost during the URI parsing and connection process.

publish to pypi

It looks like the latest version on pypi is 0.7.81, though 0.9.0 is tagged in the repo. Would you mind publishing it?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.