Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for linux to start redis

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

What is the method for linux to start redis? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

1. First of all, in order to facilitate management, move the conf configuration file and common commands in the Redis file to the unified file.

(1) create the bin and redis.conf files, and copy the code "mkdir-p _ use _ bind _ MKDir-p/usr/local/redis/ect"

(2) execute the Linux file move command and copy the code "mv / lamp/redis-3.0.7/redis.conf / usr/local/redis/etc;cd / lamp/redis-3.0.7/src;mv mkreleasdhdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server / usr/local/redis/bin"

2. Execute the Redis-server command to start the Redis service.

Note: the Redis service started by Redis-server is executed directly here and runs directly in the foreground (the effect is shown above). That is to say, if Lunix closes the current session after executing the command, the Redis service is also shut down. Normally, starting the Redis service needs to be started from the background, and the startup configuration file is specified.

3. Start the redis service at the background.

(1) first edit the conf file and change the daemonize attribute to yes (indicating that it needs to be run in the background), and the code is cd etc/;Vi redis.conf

(2) start the redis service again and specify the startup service configuration file with the code redis-server / usr/local/redis/etc/redis.conf

4. After the server starts successfully, execute redis-cli to start the Redis client and check the port number.

1. Introduction of Redis

Redis is one of the most popular NOSQL systems, and it is a key-value storage system. Similar to Memcache, but largely compensating for the shortcomings of Memcache, it supports relatively more value types of storage, including string, list, set, zset, and hash. These data types support push/pop, add/remove, and take intersection union and difference sets and richer operations. On this basis, Redis supports a variety of different sorting methods.

Like Memcache, Redis data is cached in computer memory. The difference is that Memcache can only cache data in memory and cannot automatically write to the hard disk on a regular basis, which means that when a power outage or restart occurs, the memory is emptied and the data is lost. So the application scenario of Memcache is suitable for caching data that does not need to be persisted. The difference of Redis is that it periodically writes updated data to disk or writes modification operations to additional record files to achieve data persistence.

Summarize the commands commonly used in Linux and Redis operations

1. Linux:cd / usr is from the subfolder to the parent folder usr;cd local is from the parent to the child; mv / A / B is to move the file A to the usr/local/redis/redis.conf is to edit the redis.conf file

2. Redis:Redis-server / usr..../redis.conf starts the redis service and specifies the configuration file; Redis-cli starts the redis client; Pkill redis-server closes the redis service; Redis-cli shutdown closes the redis client: Netstat-tunpl | grep 6379 is to check the occupancy of the redis default port number 6379.

Thank you for reading! After reading the above, do you have a general idea of how linux starts redis? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report