Is there any advantage to using aptitude to install mongoDB on a server vs downloading/extracting the tar file?

StackOverflow https://stackoverflow.com/questions/7015332

문제

I'm currently coding up the server-side of a webapp for the first time in my life. I'm using nodeJS, and plan on using MongoDB as my database with that. On the MongoDB website, their tutorial goes through downloading and extracting the mongoDB files into a local folder, but I've already installed everything via aptitude.

Is there any advantage to keeping the database files in a local folder that way instead of using a package manager? I feel like updating the code in the future when there are new MongoDB releases will be easier via a package manager, but I really don't know for sure.

Would somebody be able to lay out some of the advantages or disadvantages of using one method vs the other? If I was planning on using mongoose with this in the future, would using one method vs the other make a difference?

Best, and Thanks,
Sami

도움이 되었습니까?

해결책

Would somebody be able to lay out some of the advantages or disadvantages of using one method vs the other?

Package manager pros:

  • it's easy to replicate the installation process across multiple machines
  • it generally comes with a config file and "service" setup (depends on your package)

Package manager cons:

  • naming is currently inconsistent
  • it may not be possible to get the bug-fix version you need

I feel like updating the code in the future when there are new MongoDB releases will be easier via a package manager, but I really don't know for sure.

The problem here is that 10gen has been really sketchy with their package names. Currently the package name is mongodb-10gen, a few months back it was mongodb-stable. Version 1.6 to 1.8 had breaking changes, the same may be true of 1.8 to 2.0 (or 1.10 or whatever...).

You'll note there's no version number in the package. So one day you could add a server and find it running 1.10 instead of 1.8. (which may break code)

With MongoDB being the young product that it is, it's best to just keep a copy of your "current dev" build so that you can deploy the correct version to all servers. The whole wget / tar process isn't really that hefty.

다른 팁

Here's my take, which is package manager is better.

Package manager pros:

  • Consistent with the rest of the OS
  • Provides ability to inventory installed packages
  • Provides proper automatic uninstallation capability
  • Has more robustness built in (won't leave 1/2 a tar file on your filesystem if things go wrong)
  • Was specifically created to be better than plain old tar files
  • Promotes CONSISTENCY across other mongodb/ubuntu users
  • has smarts available for better upgrades (preserve config files, interactive diff, etc)

Package manager cons:

  • Less flexible/customizable (but really this is a GOOD THING in disguise)

Note, to address @Gates' point about installing server 1 on day 1 and getting mongodb version 1, then building server 2 on day 2 and getting mongodb version 2, that's good default behavior. If you want to ensure the versions match, you can install a specific version like this.

apt-get install mongodb-10gen=1.8.2

See this blog for details on that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top