Installation under Linux environment redis

A. You Started

1. Visit the official website to download redis redis software: https: //redis.io/download

2. Install rzsz software, convenient upload local files directly on Linux:

yum  install lrzsz

3. Create a folder under opt opt

mkdir redis

4. The installation package upload

In the under / opt / redis catalog:

Enter rzrz command, select upload just downloaded redis installation package

II. Begin installation

1. Unzip.           

takes -xzvf Redis-5.0.5.tar.gz 

2. Switch to the unpacked directory.

cd redis-5.0.5 (  Generally, extract the directory INSTALL file or the README file written installation instructions, refer)

3. Compile.

make   

(Note that the compiler needs C language compiler gcc support, and if not, you need to install gcc . You can use rpm -q gcc see gcc is installed)

(Use yum online install gcc command     yum install gcc)

(If the compiler error, use make clean to clear temporary files. After that, find the cause of the error, solve the problem and then re-install. ) 

4. into the src directory.      

cd src

5. installation.

make install 

If the following error:

Fatal error: jemalloc / jemalloc.h: No such file or directory

Then execute the command: make MALLOC = libc  executed again after the successful implementation of make install command

This installation is complete. However, due to the installation redis time, we did not choose the installation path, it is the default installation location. Here, we can move the executable and configuration files to the directory habits.

d /usr/local
mkdir -p /usr/local/redis/bin 
mkdir -p /usr/local/redis/etc
cd /opt/redis/redis-5.0.5
cp ./redis.conf /usr/local/redis/etc
cd src
cp mkreleasehdr.sh redis-benchmark redis-check-aof  redis-cli redis-server redis-sentinel /usr/local/redis/bin

6. Open the port linux 6379

1. Edit / etc / sysconfig / iptables file: VI / etc / sysconfig / iptables config-
added content and save: -A. 1-RH-Firewall-State -state the INPUT NEW -m -m -p TCP TCP - dport 6379 - j ACCEPT

Triple / start redis, verify whether the installation is successful

/usr/local/redis/bin/redis-server

View redis start case

ps -ef | grip Redis

The above results indicates a successful start

Four / test uses redis

1. Use xhell other from a window

cd /usr/local/redis/bin/
set name cyb
get name

 

As shown above, then redis install and can be used successfully.

And that this blog content, which draws on the knowledge of ants classroom lesson: http://www.mayikt.com/ . If in doubt about the above comments are welcome to explore.

 

Guess you like

Origin www.cnblogs.com/chenyuanbo/p/11570070.html