This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # command | |
| sudo lxc-start -n <container-name> -d | |
| # example | |
| sudo lxc-start -n mongodb -d | |
| # -d will start contaier as deamon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # command | |
| sudo lxc-info -n <container-name> | |
| # example | |
| sudo lxc-info -n mongodb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # command | |
| sudo lxc-connect -n <container-name> | |
| # example | |
| sudo lxc-connect -n mongodb | |
| # It will ask for username/password, | |
| # default username - ubuntu | |
| # default passowrd - ubuntu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # connect as normal ssh session | |
| ssh <user>@<container-ip> | |
| # example | |
| ssh [email protected] | |
| # container ip can be find via container information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From host machine | |
| sudo lxc-stop -n <container-name> | |
| sudo lxc-stop -n mongodb | |
| # From inside container(after connecting via ssh or lxc-console) | |
| sudo poweroff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # command | |
| sudo lxc-destroy -n <container-name> | |
| # example | |
| sudo lxc-destroy -n mongo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create container | |
| sudo lxc-create -n mongo -t ubuntu | |
| # connect to container | |
| ssh [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # GPG keys | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
| # list file for MongoDB | |
| echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
| # install | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo service mongod restart | |
| # or | |
| sudo service mongod stop | |
| sudo service mongod start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install mongodb-org-shell |