Home  >  Article  >  Database  >  How to make redis run in the background

How to make redis run in the background

王林
王林forward
2021-01-21 09:54:434457browse

How to make redis run in the background

Introduction:

After we install redis, if we run the redis-server command, the content in the figure below will appear.

(Learning video sharing: redis video tutorial)

How to make redis run in the background

But there is no way to do any operation under this tab, because After using Ctrl c at this time, it becomes like this

How to make redis run in the background

# and then it is closed. So what should I do if I want redis to start in the background?

After installing redis, we can find a file called redis.conf, which is the location of the redis configuration file, as shown in the figure:

How to make redis run in the background

Use the vim command to open the file, as shown in the picture:

How to make redis run in the background

#In fact, students who are good at English can read this configuration document carefully. The ones who will benefit a lot are redis. Everyone should be able to understand how to call this configuration document and give examples. Examples have been given.

The following is about units, and there is an explanation of unit conversion.

Look further down, as shown in the figure:

How to make redis run in the background

You can see that other configuration files can be loaded through include.

Look further down, as shown in the picture:

How to make redis run in the background

The general here is the general configuration. When you see the first configuration item, daemonize, this means It is a program that runs continuously. I don’t know the specific principle, but it just means that it can be configured to be started in the background.

According to the instructions, set daemonize to yes, as shown in the figure:

How to make redis run in the background

Save and exit, start redis, of course, pay attention to the use when starting The configuration file you just configured will work, as shown in the picture:

How to make redis run in the background

After startup, there is not a lot of content as before, because we use background startup, confirm whether To start, you can use the ps -ef|grep redis command, as shown in the figure:

How to make redis run in the background

In this way, redis can be started in the background.

Related recommendations: redis database tutorial

The above is the detailed content of How to make redis run in the background. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete