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

Redis usage

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The use of Redis

The storage form of Redis is key-values

Install redis

Wget http://download.redis.io/releases/redis-3.0.7.tar.gz

Tar xzf redis-3.0.7.tar.gz

Cd redis-3.0.7

Make

Cd src & & make install

Copying configuration files and programs is easy to manage

[root@nosql src] # mkdir-p / usr/local/redis/bin

[root@nosql src] # mkdir-p / usr/local/redis/etc

[root@nosql src] # mv / usr/local/src/redis-3.0.7/redis.conf / usr/local/redis/etc

[root@nosql src] # pwd

/ usr/local/src

[root@nosql src] # cd redis-3.0.7/src

[root@nosql src] # mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server / usr/local/redis/bin

[root@nosql src] # ll / usr/local/redis/bin / usr/local/redis/etc

/ usr/local/redis/bin:

Total 15464

-rwxrwxr-x 1 root root 566 Jan 25 09:57 mkreleasehdr.sh

-rwxr-xr-x 1 root root 4587323 Mar 26 01:33 redis-benchmark

-rwxr-xr-x 1 root root 22185 Mar 26 01:33 redis-check-aof

-rwxr-xr-x 1 root root 45395 Mar 26 01:33 redis-check-dump

-rwxr-xr-x 1 root root 4696538 Mar 26 01:33 redis-cli

-rwxr-xr-x 1 root root 6469287 Mar 26 01:33 redis-server

/ usr/local/redis/etc:

Total 44

-rw-rw-r-- 1 root root 41560 Jan 25 09:57 redis.conf

Start redis

By default, redis does not run in the background. Modify his configuration file to let him run in the background.

Vi / usr/local/redis/etc/redis.conf

Change daemonize to yes

Start the command:

[root@nosql redis-3.0.7] # redis-server / usr/local/redis/etc/redis.conf

[root@nosql redis-3.0.7] # lsof-I: 6379

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

Redis-ser 12693 root 4U IPv6 25154 0t0 TCP *: 6379 (LISTEN)

Redis-ser 12693 root 5U IPv4 25156 0t0 TCP *: 6379 (LISTEN)

Stop:

Redis-cli shutdown

Client connection

[root@nosql redis-3.0.7] # redis-cli

127.0.0.1 purl 6379 > help

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