PHP operating MongoDB module linux, detailed introduction (7), mongodblinux
In linux, why did I quit immediately after I got connected to mongodb?
Connect failed, not connected at all, not just connected and exited.Check whether mongod is running normally. Check log, process, and port.How can I write mu
Linux MongoDBinstallationPreface:Official Reference manual: https://docs.mongodb.org/manual/?_ga=1.41355425.2024551820.1440643898You can also download the corresponding PDF version, or find the Chinese version online (mongodb_ authoritative Guide _ Chinese version), find the Linux platform installation introduction1. Installation Environment centos-5.10-x86_642. Mon
This article mainly describes the Python monitoring of Linux memory and write the relevant information of MongoDB, the need for friends can refer to the following
(Need to install Psutil to get server resources, as well as Pymongo drivers) #pip Install Psutil
#pip Install Pymongo#vim memory_monitory.py
The file contents are as follows
#!/usr/bin/env python#-*-coding:utf-8-*-import psutilimport socketimpo
Linux to increase the expansion module, first download the source package from the Http://pecl.php.net/package/mongo, where the download is mongo-1.2.12.tgz, then perform the installation steps
Tar zxvf mongo-1.2.12.tgzCD mongo-1.2.12
Prepare the compilation environment/usr/local/webserver/php/bin/phpize./configure--with-php-config=/usr/local/webserver/php/bin/php-configMakeMake installVi/usr/local/webserver/php/etc/php.ini
Add extension = mongo.so
# method 1: (recommended)#--fork option will notify Mongod to run in the background/path/to/mongodb_dir/bin/mongod--logpath/path/to/file.log--logappend--fork# Method 2:# REDIRECT output to the File.log file# Put the process in the background run/path/to/mongodb_dir/bin/mongod >>/path/to/file.log # can also run like this (do not log logs)# because all redirected bin files/dev/null information will be discarded/path/to/mongodb_dir/bin/mongod >>/dev/null Mongo
The official MongoDB is actually green-free, http://www.mongodb.org/downloadsDefault no configuration file, build one yourself:VI mongodb.conf:
The code is as follows
Copy Code
Dbpath=/home/mongodataFork=trueAuth=trueLogpath=/home/server/mongodb-linux-i686-2.4.3/log.logLogappend=trueJournal=trueQuiet=true
Start:
has a user table, each database has a user table, but seemingly alone in the user table set up users can not directly access MongoDB, must go to the admin library inside Auth can
Second, Linux installation configuration
The MOGODB is installed in the/usr/local/src/mongodb/directory, the database is in/data/mongodb/db,
Label:The first two days have received a new requirement to monitor the maximum number of MongoDB connections, memory usage, etc. in a Linux shell script.But I do not know about the Linux Shel, but will be some simple common Linux operation, as long as a crazy search, eventually try to finally get these values.The step
This article will describe my installation MongoDB expansion process, we can have a little reference
Installation Environment
Linux Environment: CentOS 6.5Apache Version: 2.4PHP Version: 5.4.3MongoDB version: 2.6.5
First, download mongo-php extended installation package
Can download from GitHub, address is https://github.com/mongodb/mongo-php-driver-legacy
D
One: Problem description
These several times perform MongoDB initialization scripts and discover a problem:
When you upload a script from Windows to Linux, the error occurs when you execute it.
Such as:
Mongo-u root-p mongo123 Admin--port 8000
There are many errors in the Initdata-bmis.log file:
Syntaxerror:unexpected token illegal But the direct copy paste script content executes on the command li
Tags: path gui round color tar reason tar zxvf stop exit 1. To the official website, select the appropriate version to download Https://www.mongodb.com/download-center#community 2. Unzip tar -zxvf mongodb-linux-x86_64-ubuntu1604-3.4.0.tgz 3. Move to the/usr/local/directory sudo mv -r mongodb-
1. Connect to the Linux system first.2. Download the appropriate MongoDB install compression package to the MongoDB website.Download page: Https://www.mongodb.org/downloads#production.Here i download the Linux 64-bit legacy: https://fastdl.mongodb.org/linux/
1. On the official website https://www.mongodb.org/dl/linux/x86_64 download the corresponding installation compression package, I use 3.2.5, we recommend this version, the higher the version, there may be other unknown problems, such as the need to glibc high version, throughLl/lib64/libc.so.6 can view the native version of/lib64/libc.so.6-libc-2.17.so, installed once.2. Put the compressed package in the/usr/download directory, enter the download dire
Python monitors linux memory and writes it to mongodb and pythonmongodb
(You need to install psutil to obtain server resources and pymongo driver) # pip install psutil
# Pip install pymongo
# Vim memory_monitory.py
The file content is as follows:
#! /Usr/bin/env python#-*-Coding: UTF-8 -*-Import psutilImport socketImport timeFrom pymongo import MongoClientMongodbIp = '192. 168.200.112'Export dbport = 27017
Tags: linux centos6 mongodb NoSQLMongo DB is a non-relational database (NOSQL) that is currently very popular in the IT industry, and its flexible data storage methods are favored by current it practitioners. Mongo db is a good way to implement object-oriented thinking, in Mongo db, each record is a document object. The biggest advantage of Mongo DB is that all data persistence requires no developers to wri
Installation
1> Set MongoDB Directory
Cd/home/apps: CentOS Create directory command Mkdir/home/apps
2> Download MongoDB
Curl-o http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.6.tgz
Either download it or copy it directly or upload it to the specified directory with
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.