Meteor Up deployment, can't use meteor mongo --url

前端 未结 7 1305
-上瘾入骨i
-上瘾入骨i 2020-12-09 06:21

I\'ve recently deployed my Meteor app to a Digital Ocean droplet running Ubuntu 14.04 x32. I used Meteor Up with this mup.json file:



        
7条回答
  •  一个人的身影
    2020-12-09 06:42

    It is impossible to remotely access the database, if Meteor Up installed and set it up for you. From the Meteor Up docs:

    You can't access the MongoDB from the outside of the server. To access the MongoDB shell you need to log into your server by SSH first and then run the following command.

    mongo appName
    

    It can however be accessed in other ways than that mongo appName interface, if those programs are running on the server.

    Digital Ocean Ubuntu droplets come equipped with Python 2.7, so using pymongo is possible. This command will connect you:

    from pymongo import MongoClient
    client = MongoClient()
    

    That will automatically connect at mongodb://localhost:27017/

    pymongo isn't a default package, so install pip, and then use pip to install pymongo.

    apt-get install python-pip python-dev build-essential
    pip install pymongo
    

提交回复
热议问题