Linux system Installation NoSQL (MongoDB and Redis) steps and problem solving methods

Source: Internet
Author: User
Tags install mongodb install redis redis server

? more technical dry please poke: Listen to the Cloud blog

The following is a record of my work, which describes the installation process and the problems and solutions of Nosql:mongodb and Redis under Linux system:

Need friends can follow the following steps to install, you can quickly install MongoDB and Redis, hope to help everyone:)!

First, MongoDB

1. MongoDB Installation

(1) Copy the installation package mongodb-linux-i686-3.0.2.tgz to the server to be installed

Here I use the RZ command if it is not supported need to install YUM-Y installed Lrzsz

(2) Unzip the installer tar xzvf mongodb-linux-i686-3.0.2.tgz

(3) Enter directory:/usr/local/Create folder mkdir MongoDB

(3) Move the file to the/usr/local/mongodb directory:

MV mongodb-linux-i686-3.0.2/*/usr/local/mongodb into/usr/local/mongodb execution

(4) mkdir data

(5) Touch logs

(6) Enter the bin directory to execute the boot

   ./mongod --dbpath=/usr/local/mongodb/data/ --fork --logpath=/usr/local/ mongodb/logs    description:--dbpath   Specify to store MongoDB library data          --fork     background execution, otherwise the foreground execution--logpath   specify MongoDB logging file      Error:-bash: ./mongod: /lib/ld-linux.so.2: bad elf interpreter: no such  File or directory Solution: sudo yum install glibc.i686 error:./mongod: error while  loading shared libraries: libstdc++.so.6: cannot open shared object  file: no such file or directory Solutions:yum provides libstdc++.so.6    See which one contains so.6  see libstdc++-4.8.5-4.el7.i686 and then perform the installation     yum install  libstdc++-4.8.5-4.el7.i686  Performing installation Error: error: protected multilib versions: libstdc++- 4.4.7-4.el6.i686 != libstdc++-4.4.7-3.el6.x86_64 solution:yum  update libstdc++-4.4.7-11.el6.x86_64   and then perform the steps  yum install libstdc++-4.4.7-4.el6.i686     after the installation is successful, start on execution./mongod -- Dbpath=/usr/local/mongodb/data/ --fork --logpath=/usr/local/mongodb/logs

(7) View MongoDB process (below two)

Netstat-tlnup|grep Mongodnetstat-tlnup|grep 27017

2, MongoDB start:

(1) Enter/usr/bin

(2) Execute Command Connection client:./mongo

3. Check the boot status:

Netstat-lntup|grep 27017> Show dbs;db.stats () use test;

At this point, Redis has been installed and tested successfully and can be used with confidence:)

Second, Redis

Redis is divided into the service side and the client, we first install the server, is actually compiled in C language, the success of the compilation is successful installation, and then start the Client Connection server to test.

1. Install Redis Server

(1) Download the installation package

Execute the wget command in the appropriate directory of the server (/opt) to download:

wget https://redis.googlecode.com/files/redis-2.6.13.tar.gz error: Permission denied reason: Current user ec2-user to opt This folder does not have W's permission workaround: Sudo-i chmod a+x/opt enables the current user to have Execute permissions on the opt file

(2) Unzip the installation package

Tar xzf redis-2.6.13.tar.gz

(3) Compiling

Go to redis-2.6.13 directory to compile 1) make error:/bin/sh:cc:command not found reason: no C language compilation environment Workaround: Yum install GCC continue to perform the compilation installation 3 ) make install

(4) Copy redis.conf to etc folder

CP redis.conf/etc/

2. Start Redis

(1) Access to the directory Redis SRC:CD/OPT/REDIS-3.0.0/SRC

(2) Start the server (src directory):./redis-server &

Or execute src/redis-server under the redis-3.0.0 directory

(3) Open client (src directory):./REDIS-CLI &

Or execute SRC/REDIS-CLI under the redis-3.0.0 directory

3. Test Redis Installation

Two ways to test if Redis is successful, choose either one

(1) Detect if Port 6379 is listening

NETSTAT-LNTP | grep 6379

(2) Detecting whether background process exists

Ps-ef |grep Redis

4. Perform Redis testing

127.0.0.1:6379> set name yhbok127.0.0.1:6379> get Name "YHB" 127.0.0.1:6379>

At this point, Redis has been installed and tested successfully and can be used with confidence:)

Original link: http://blog.tingyun.com/web/article/detail/1229

Linux system Installation NoSQL (MongoDB and Redis) steps and problem solving methods

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.