Installation of Redis steps in Linux environment problem solving

Source: Internet
Author: User
Tags redis server

The first step: Unzip the installation package on the Windows platform and copy it to the/usr/soft directory of the Linux machine, and give the folder and file the highest permissions, Chmod+x *;

Second step: Enter into the redis-3.2.6 directory, execute make command, there will be a file can not find the situation.

You can use the following command when you encounter this situation: make MALLOC=LIBC

This is the success.

Step three: Execute make install.

Enter into the/usr/local/bin directory to find the following several files:

Fourth step: Execute the command. View version information: redis-serer-v

At this point, the Redis installation is complete and the configuration information is completed.

Fifth Step: Configure:

5.1 Creating a directory:

Create Redis directories in/etc and/var directories, respectively

First go to the/etc directory:

Cd/etc

mkdir Redis

Then go to the Var directory:

Cd/var

mkdir Redis

CD Redis

mkdir Data Log Run

5.2 Configuring the Conf file

First copy the redis.conf file under the/usr/soft/redis-3.2.6 directory to the/etc/redis directory.

Scp/usr/soft/redis-3.2.6/redis.conf/etc/redis

Open the redis.conf in the/etc/redis directory. Then modify some information:

Modify Port:

Modify the PID directory to create a new directory

Modify the Dump directory to create a new directory

Modify the log storage directory to create a new directory

5.3 Persistence

The default RDB, you can choose whether to turn on aof, if enabled, modify the configuration file AppendOnly

5.4 Start Redis to see the files in each directory

Enter the command in the/etc/redis directory: redis-server/etc/redis/redis.conf

This time the cursor is flashing, indicating that the process is executing, such as pressing CTRL + C to exit the process.

The log will print the following log: Tail-f/var/redis/redis.log

Then view the process: Ps-ef | grep Redis. The following display indicates that the Redis boot was successful.

Then look at the log information generated by Redis and so on.

It is visible that Redis is already generating the appropriate data.

When you view the dump file, it is empty.

Found only logs, no dump and PID information, because the current Redis service is still running in console mode, and there is no data store operation

Stop the Redis service, modify the configuration file to make Redis run in background

Change to Yes, which means to start as a daemon. Save and restart the Redis service. This is not the same as the cursor flashing, but in the background to run. Perform popup [[email protected] bin]#

View the dump and PID information as follows. If the AOF persistence mode is configured, the data directory will also have aof related files.

Sixth step: The client connects to the Redis server.

Default port: 6379.

Seventh Step: Boot from boot.

Copy the startup script file under Redis Decompression package to the/ETC/INIT.D directory:

scp/usr/soft/redis-3.2.6/utils/redis_init_script/etc/init.d/

Modify the script name (or not modify it) to Redis

Modify the script PID and Conf path to the actual path

Save exit, under the/etc/init.d/directory, you can already start and close Redis by using the service Redis start/stop command

Permissions are not sufficient Modify permissions: chmod +x/etc/init.d/redis

The service Redis stop is successful at this time.

Restart: Service Redis start

To set up self-booting:

Set up self-start

Chkconfig Redis on will report the following error: (because the Redis boot priority information is not included in the startup script)

Service Redis does not support Chkconfig

Workaround: In the/etc/init.d/redis startup script file only the first line is added #chkconfig:2345 90 10 save exit. Then Chkconfig Redis on successfully.

Installing Redis steps in a Linux environment is an issue resolution

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.