In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the installation and deployment process of Redis". In the daily operation, I believe many people have doubts about the installation and deployment process of Redis. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the installation and deployment process of Redis. Next, please follow the editor to study!
1. Redis download
Download address: http://download.redis.io/releases/redis-4.0.1.tar.gz
Wget 'http://download.redis.io/releases/redis-4.0.1.tar.gz'
II. Redis installation
Unzip:
Redis] # tar-xzvf redis-4.0.1.tar.gz
Redis] # cd redis-4.0.1
Compile and install:
Redis-4.0.1] # make
Redis-4.0.1] # cd src/
Src] # make install
Configure redis:
Src] # mkdir-p / usr/local/redis/bin / usr/local/redis/etc
Src] # cp-rp redis-benchmark redis-check-rdb redis-cli redis-server redis-check-aof redis-sentinel / usr/local/redis/bin/
Redis-4.0.1] # cp-rp redis.conf / usr/local/redis/etc/
III. Redis start
Redis-4.0.1] # cd / usr/local/redis/bin/
Bin] # redis-server
# the figure above shows that the redis-server starts successfully. The listening port defaults to 6379.
[root@BX-128-28 ~] # netstat-luntp | grep 6379
Tcp 0 0 0.0.0.0 6379 0.0.0.015 * LISTEN 28911/redis-server
Tcp 0 0: 6379: * LISTEN 28911/redis-server
4. Redis shuts down
[root@BX-128-28] # redis-cli shutdown
Or
[root@BX-128-28] # pkill redis-server
5. Redis client connection
[root@BX-128-28] # redis-cli
127.0.0.1 purl 6379 > set name Jerry
OK
127.0.0.1 purl 6379 > get name
"Jerry"
127.0.0.1purl 6379 >
VI. Redis Appendix
1. Self-boot is commonly used in Redis
Add the following to the boot file / etc/rc.local:
/ usr/local/redis/bin/redis-server / usr/local/redis/etc/redis.conf
2. Redis common commands
Redis-benchmark # redis performance stress testing tool
Redis-check-aof # check aof Log tool
Redis-check-rdb # check the rdb log
Redis-cli # redis client tool
Redis-sentinel # Redis cluster management tools, Redis instance monitoring and management, notification and instance failure backup service
Redis-server # redis Service launcher
3. Redis configuration file parameters
Include / path/to/local.conf: contains other redis configuration files
Daemonize: if you need to run in the background, change the value of this item to yes
Pdifile: save the path to the process pid file. By default, the pid file is placed in / var/run/redis.pid, which can be configured to another address, such as / usr/local/redis/redis.pid.
Bind: specifies that redis will only receive requests from this IP. If not set, all requests will be processed. It is best to set this item in the production process.
Port: listening port. Default is 6379.
Timeout: disconnects the client connection after it is idle for N seconds (in seconds). A setting of 0 means that this parameter setting is not enabled.
Loglevel: levels are divided into four levels, debug,verbose,notice and warning. Notice is generally enabled in production environment. The default is verbose.
Logfile: configure the log file address, using standard output by default, that is, printing on the port of the command line terminal
Database: sets the number of databases. The default database is 0
Save: sets how often redis mirrors the database, how many updates it takes, and saves the data to the data file save
Rdbcompression: whether to compress when making a mirror backup
Dbfilename: file name of the backup file that is mirrored
Dir: the path where the files backed up by database mirroring are placed
Slaveof: set this database to be a slave database for other databases
Masterauth: when the primary database connection requires password authentication, set it here
Requirepass: set the password that the client needs to use before making any other assignments after connecting
Maxclients: limit the number of clients connected at the same time
Maxmemory: sets the maximum memory that redis can use
Appendonly: when appendonly mode is enabled, redis appends every write operation received to the appendonly.aof file, and when redis restarts, it returns to the previous state of the file.
Appendfsync: sets how often appendonly.aof files are synchronized
Vm_enabled: whether to enable virtual memory support
Vm_swap_file: sets the path to the swap file for virtual memory
Vm_max_momery: sets the maximum physical memory that redis will use when virtual memory is enabled. Default is 0.
Vm_page_size: sets the size of virtual memory pages
Vm_pages: sets the total number of page for swap files
Vm_max_thrrads: sets the number of threads that vm IO uses simultaneously
At this point, the study on the "installation and deployment process of Redis" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.