Tuesday, November 25, 2014

MongoDB install - open command prompt with admin right


http://www.oodlestechnologies.com/blogs/Setting-up-MongoDB-with-Authentication-on-Windows

http://igorbicanic.blogspot.com/2014/11/install-and-configure-mongodb-replica.html?m=1

https://www.mongodb.org/dr//fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.6-signed.msi/download

http://docs.mongodb.org/ecosystem/platforms/windows-azure/

http://www.mongodb.com/presentations/hands-deploying-mongodb-azure?_ga=1.84217369.1486923176.1416959902


C:\Program Files\MongoDB 2.6 Standard\bin

command prompt has to start with admin right

create c:\data\db directory and run mongod.exe with admin right

mongod --install --replSet "MSWrs" --verbose -vvvvv --logpath c:/logs/mongo-server.log

mongod --install --replSet "MSWrs" --verbose -vvvvv --logpath c:/logs/mongo-server.log --slave


mongod.conf
dbpath=c:/data/db
logpath=c:/logs/mongo-server.log
verbose=vvvvv

C:\Program Files\MongoDB 2.6 Standard\bin

mongod -f c:\data\mongod.conf

install as a service

mongod -f c:\data\mongod.conf --install

mongo to start shell, then add user

add user to admin db
db = db.getSiblingDB('admin')
db.addUser( { user: "myUsername",pwd: "myPassword",roles: [ "userAdminAnyDatabase" ] } ) 

add user to another db
>use myDB
switched to db myDB
>db.addUser("myUsername","myPassword")

then remove service, then install again with --auth
mongod.exe --journal --config c:\data\mongod.conf --dbpath c:\data --auth --install

mongod --remove

mongod.exe --journal --config c:\data\mongod.conf --dbpath c:\data --auth --install --logpath=e:/data/mongo-server.log

mongod.exe --journal --config c:\data\mongod.conf --dbpath c:\data --auth --install

mongod --remove


services.msc

start mongodb

net start | findstr mongo

install on azure Linux box
winscp
putty

http://docs.mongodb.org/manual/core/document


1. Let us start with setting up the inbound rules, to do that click on Start and go to Administrative Settings and select Windows Firewall with Advanced Security as shown in the screen below.

f connected to the VM instance type the following command where port is 27018 for instance 1,27019 for instance 2 and 27020 for instance 3:

No comments:

Post a Comment