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

Yum install redis

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Yum installs redis first, you must surf the Internet. Systemctl stop firewalld / / turn off firewall setenforce 0 / / turn off monitoring cd / etc/yum.repos.d/cp back/*. /

Yum install epel-release-y / / yum add epel feed

Yum install redis-y / / install redis

Vi / etc/redis.conf modifies the following: bind 127.0.0.1 is changed to 0.0.0.0daemonize no (line 128) to daemonize yes

To enable the client, make sure that the server starts: redis-server / etc/redis.confredis-server-v / / check the version of redis-cli ping / / Test starts redis-cli ping and returns PONG, and starts successfully. Redis-cli / / Link

Yum install lrz*-y / / install upload software

Pull the redis-5.0.0.tar.gz package into

Or

Source code compilation and installation

Yum install wget-y / / install wget

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

Tar xf redis-5.0.0.tar.gz-C / opt/ extract the file cd / opt/redis-5.0.0/yum install gcc gcc-c++ make-y

Yum install-y tcl / / install tcl

Make distclean / / Clean the cache

Make / / compilation

Make install PREFIX=/usr/local/redis / / installation

Extend:

Redis-benchmark: used to test the performance of redis.

Redis-check-aof: when the aof backup file is corrupted, you can use this tool to repair the aof file. How to use it: redis-check-aof-the aof file to be repaired by fix.

Redis-check-rdb: repair corrupted rdb backup files.

Redis-cli: redis client, used to connect to the server.

Redis-server: redis server side, used to start the redis server.

Redis-sentinel: Sentinel mode (widely used in practice) in master-slave mode (slave does not support writing by default). When an exception occurs in master, automatically select one of the slave as master.

After connecting to the redis server, you can view the redis server information by directing "info", or you can view the content information known by the server, for example, info replication to view master-slave related information.

Ln-s / usr/local/redis/bin/* / usr/local/bin/ do soft connection mkdir / etc/redis / / create redis directory mkdir / var/rediscd / var/redismkdir data log run / / create dump file directory, log directory, process pid directory cp / opt/redis-5.0.0/redis.conf / etc/redis

Vi / etc/redis/redis.conf / / modify the redis configuration file to read the following: 69 line bind 0.0.0.0 set listening ip address 92 line port 6379 listening port Default 6379 port 158line pidfile / var/redis/run/redis.pid specify pid file 263 line dir / var/redis/data specify dump directory 171line logfile "/ var/redis/log/redis.log" specify log file 136line daemonize yes makes redis run redis-cli shutdown / / turn off redis service redis-server / etc/redis.conf / / enable redis service redis-cli on background / / Link 127.0.0.1 set foo bar 6379 > write title foo The content is barOK127.0.0.1:6379 > get foo to view the content of foo "bar" 127.0.0.1 foo 6379 >

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

Servers

Wechat

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

12
Report