Skip to main content

Posts

Showing posts with the label mongodb

How to install Graylog v0.20.0

There are three major dependencies of graylog: java, mongodb and elasticsearch. Either install openjdk-7-jdk or oracle java-7 (In this guide, oracle-java is installed.): echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 apt-get update apt-get install oracle-java7-installer Then, install elasticsearch: wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb sudo dpkg -i elasticsearch-0.90.10.deb

Profiling Slow Query in Mongodb

To monitor slow queries which are run in a mongodb database, profile  attribute need to be set. There are three profiling levels: 0, 1 and 2. Add the following line into mongo.conf: profile=1 Value 0 disables profiling. Value 1 enables the system to detect and record slow queries which take more time than given threshold value. If the attribute is set to 2, information of all queries are recorded. 

How to open a new database and a new collection in Mongodb

As contrast to relational databases, mongodb doesn't explicitly open a new database or a collection. User just says to mongodb to use a database no matter it is available currently or not. When a save action is performed, this database is automatically created by mongodb. I will take following actions in mongo shell. Currently, I have following databases in mongodb:  > show dbs local 0.078125GB monitoring 0.203125GB test 0.203125GB