In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to install and configure Redis, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Installation
Redis installation is very convenient, first download the latest version through the official website, official website address: http://redis.io/download
Redis can be installed on Windows as well as Linux, but Redis on the Windows platform is not officially supported by Redis, it is developed and maintained by the MicrosoftOpen Tech team. Redis does not rely on any non-standard function libraries, and there are no parameters that must be added to compile, so the installation is very simple. We use version 3.0 here.
Install the basic environment first:
Download from here: http://download.redis.io/releases/redis-3.0.7.tar.gz
Extract and test the required conditions. This command is included in the compressed package. It prompts you to install tcl8.5 or above.
Install tcl
Install jemalloc allocator, this allocator source code has been included in the Redis source package, in the dev directory, as shown in the following figure: I will explain about the allocator later.
The installation method is as follows: it compiles and installs the following four items, which Redis depends on
Compile and install Redis
If you run make at this time, you won't make a mistake. You can set the installation directory with the following command:
Make PREFIX=/DIRECTORY install (if you use this command, then you don't need to execute make install later)
I use the default here.
Run makeinstall
Note: if you want to install in a different directory, you must use make PERFIX=/DIRECTORY install mode, if this command is not followed by install, and you want to run make install later, then simply running make will not make an error, but after the final installation, you will find that it is still the default directory (/ usr/local/bin) rather than your own specified directory.
Location of installed programs and configuration files:
After installation, the default Redis program is placed under / usr/local/bin, as shown below:
The program name uses the daemon launcher redis-cli command line tool of the redis-serverRedis server. Of course, you can also use telnet to operate the database redis-benchmark performance test tool to test the read and write performance of redis under the current system and hardware configuration. Redis-check-aof is used to repair the problem AOF file redis-check-dump is used to repair the problem dump.rdb file redis-sentinel user cluster management
The location of the configuration file is in the source code package, and the installation does not copy the configuration file, which needs to be copied manually. Do the following:
First create a folder under / etc/ named redis, which is also for ease of management
Here we want to change the configuration file to 6379.conf. Why? Because it has something to do with the setting of the CONF variable in the startup script, it defaults to using the REDISPORT variable as the configuration file name, as you'll see in the next section.
About the distributor
I originally wanted to write a separate article on the allocator, but later I thought it would be more appropriate to put it here, so as to maintain a consistency. The problem of allocator error often occurs when installing Redis. The general advice on the Internet is to use the libc allocator of the Linux system to solve the problem, but it does not tell how to use the better performance jemalloc allocator to install, because the Redis program itself does not have a memory management mechanism, it uses other memory allocators.
View the README document under the archive directory, as shown below:
The default allocator used when installing Redis is jemalloc. If your system does not have it, an error will be reported when installing Redis, as shown below:
Prompt that there is no such file or directory.
MALLOC is an environment variable, if there is this environment variable, it will be used to create Redis, if not, you need to specify this parameter at installation time. In general, the system does not have this environment variable.
Libc is not the default allocator for Redis, the default is jemalloc, because the performance of this allocator is better than libc, mainly reflected in the memory fragmentation rate (too much memory fragmentation, which has a great impact on the performance of pure memory data). When Redis compiles, it first determines whether to use jemalloc (the memory allocation management module provided by BSD). If it does not have any, it will use the memory management function in the standard libc, but using the standard libc requires manually specifying parameters.
If you don't want to use the jemalloc allocator, you can use make MALLOC=libc at installation time to resolve the above error. This is also a conventional online solution. If you want to use jemalloc, follow the steps above to install it.
Common allocators:
Tcmalloc Google's memory allocation management module
Management module provided by jemalloc BSD
Libc Linux system comes with
The above is all the contents of the article "how to install and configure 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: 223
*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.