Detailed installation of Redis and configuration and startup of Linux environment variables

Source: Internet
Author: User
Tags redis redis cluster install redis

Objective:

  

Redis

Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages.

I am using the following version:

If there is no resources, I share this on the network, no password, can be directly downloaded online disk. https://pan.baidu.com/s/1pYf6xPE9wv4RufrG5JFRGg

First, Next, open your Linux. , and then enter the following command.

Yum Install gcc tcl–y  installation dependencies and some components

Two. , extracting redis-using the TAR command

Tar XF redis-2.8.24.tar.gz

The next step is the compile phase. Maybe you'll ask what to compile and I'll show you what to compile.

Go to Deps in the Redis folder

Deps folders under these things to compile, such as Jemalloc is about allocating memory, etc.)

Next, in the Redis-2.8.24 folder (which is the folder you unzipped), make directly below (

Compile successfully you will see a similar picture below.

Third, the next thing to do is (to install Redis), these are just the preparatory work.

I started in the home directory mkdir Redis folder (create a folder to install Redis) (YSW is my user group, please ignore directly)

Go to the directory where you just unzipped the Redis (remember not to create a Redis directory, but to extract the redis-2.8.24 directory from the start to the make prefix command)

Then execute the command.

Make prefix= '/home/redis ' Install (PREFIX is the path of the specified move)

After successful installation, go to your installed directory, you can see the bin directory, there are some executable scripts in the bin directory.

Now that's the case, Redis's installed successfully.

We found the Redis-sentinel script in the SRC directory of the redis-2.8.24 directory where we started the decompression.

and copy the script to the installed Redis directory so that we can later use the Redis Sentinel (a tool for monitoring the Master state in the Redis cluster, which has been integrated in the redis2.4+ version)

Add Redis Bin directory to environment variables (I'm using the VIN editor)

Vim ~/.bash_profile

Add to

Export Redis_home=/home/redisexport path= $PATH: $REDIS _home/bin

And then let the change environment variable take effect

Execute the command again.

Source ~/.bash_profile

Next we want to make Redis into a service (), a little redis is better, we can go directly to the beginning of the unpacked folder redis-2.8.24, there is a utils folder inside, there is a install--server. Sh

A service can be made by executing it.

I found this problem with my execution file.

Oh, the original execution is required root permission, then I will su root change the user

Write the password process I will not show, anyway is very simple password 123456 and so on.

where config file:/etc/redis/6379.conf can change the Redis service configuration.

Vim/etc/redis/6379.conf can see the following diagram (change the port or database and so on configuration)

Finally finished making service pull

The next step is to start Redis.

Command for service REDISD start(this should be redis_6379, but I went into the/etc/init.d folder and renamed redis_6379 REDISD, if you haven't changed your name, This should be the service redis_6379 start services)

Take a look at the port with the SS–TANL command (see if your Redis port exists)

See the port settings 6379. It means the service is up.

REDIS-CLI entering the client

Next, you can pull the storage.

Detailed installation of Redis and configuration and startup of Linux environment variables

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.