In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to install and use redis", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install and use redis" this article.
Redis installation 1 first step: install the GCC environment yum install-y gcc-c++yum install-y wget required by C language step 2: download and extract the Redis source code compression package wget http://download.redis.io/releases/redis-5.0.5.tar.gztar-zxf redis-5.0.5.tar.gz step 3: compile the Redis source code, enter the redis-5.0.5 directory, execute the compilation command cd redis-5.0.5/src make step 4: install Redis You need to specify the installation path mkdir / usr/redis-p make install PREFIX=/usr/redisRedis through PREFIX to start the front-end startup.
Startup command: redis-server, running bin/redis-server directly will start in front-end mode
. / redis-server
Close command: ctrl+c
Startup disadvantage: when the client window closes, the redis-server program ends. This method is not recommended.
Start the legend:
Backend startup (daemon startup)
Step 1: copy the redis-5.0.5/redis.conf configuration file to the bin directory of the Redis installation directory
Step 2: modify redis.conf
Vim redis.conf# changes `daemonize` from `no` to `yes` daemonize yes # by default, it is bound to the loopback address, and cannot be accessed by other machines by default. Whether protection mode is enabled for # bind 127.0.0. Yes should be no protected-mode no.
Step 3: start the service
/ shutdown mode of redis-server redis.conf backend startup. / redis-cli shutdown command description * redis-server: start redis service * redis-cli: enter redis command client * redis-benchmark: tool for performance testing * redis-check-aof: tool for aof file check * redis-check-dump: tool for rdb file line check * redis-sentinel: start Sentinel Monitoring Service Redis command line client
Command format
. / redis-cli-h 127.0.0.1-p 6379
Parameter description
-ip address of the h:redis server-Port number of the p:redis instance
Default mode
It is OK if you do not specify the host and port.
The default host address is 127.0.0.1
The default port is 6379
. / redis0-cliredis cluster build 1 server description 192.168.56.103 redis0-cliredis 6381 Master (Master) 192.168.56.103 Master) 192.168.56.103 Master Master (Master) 192.168.56.103 Slave) 192.168.56.103 Slave) 192.168.56.103 purl 6386 slave (Slave) 192.168.56.103 purl 6387 ( Master) after adding 192.168.56.103 redis.conf configuration file to modify the redis.conf configuration file from (Slave)
1. Decompress redis.tar.gz
2 Cd redis
3Make
4 Make-prefix / usr/local/redis6381 install
5 copies of 8 copies
6 modify the redis.conf file separately Note: the red part needs to be changed
Bind 0.0.0.0 port 6381 daemonize yes appendonly yes cluster-enabled yes cluster-config-file nodes-6381.conf3 launches 8 Redis./redis6381/redis-server. / redis6381/redis.conf./redis6382/redis-server. / redis6382/redis.conf./redis6383/redis-server. / redis6383/redis.conf./redis6384/redis-server. / redis6384/redis.conf./redis6385/redis-server. / redis6385/redis.conf./redis6386/redis-server. / redis6386/redis . conf./redis6387/redis-server. / redis6387/redis.conf./redis6388/redis-server. / redis6388/redis.conf4 create a cluster. / redis6381/redis-cli-- cluster create 192.168.56.103cluster create 6381 192.168.56.103cluster create 6382 192.168.56.103cluster create 6383 192.168.56.1036384 192.168.56.103Fringe 6385 192.168.56.103lug 6386-- cluster-replicas 15 add the master node. Add-node 192.168.56.103 add-node 6387 192.168.56.103 cluster add-node 63826 add slave node. / slave-- cluster add-node 192.168.56.103 cluster-master-id 6c256900dba703c23bb2a0e4ecdf1df456cb95937 effect
The above is all the contents of the article "how to install and use redis". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.