In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the method of downloading and installing Redis for you. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Download and install Redis
Redis has an active community on GitHub. Over the years, a large number of pull request have been proposed and merged, and the author Antirez always gives a timely response in the issues section of GitHub. Therefore, the release cycle of Redis is very fast. They have been widely used from the previous version 2.6 Universe 2.8 to 3.0 Universe 3.2, and then to the latest four versions. Each version provides some basic enhancements and bug fixes. So, if possible, using the latest version of Redis is one of the best practices.
In this book, we use the latest version of Redis 4.0.1.
Redis is open software written in pure C, so we can install it by compiling it. Major operating systems also include Redis binary packages in their software repositories, although Redis versions are often out of date.
One: ready!
You can find download links and basic installation steps at https://redis.io/download. If you want to build Redis by compiling source code in Linux/Unix/macOS, you need a gcc compiler and C standard library libc in your environment. When installing the OS system repository, all you need is an Internet connection and the correct system repository configuration.
Two: how to do it?
We will demonstrate the compilation and installation of Redis in Ubuntu 16.04.2 LTS (Xenial Xerus). The download and build steps are as follows:
Set up the build tool:
$sudo apt-get install build-essential
Create a directory and enter Redis:
$mkdir / redis $cd / redis
Then, download Redis:
$wget http://download.redis.io/releases/redis-4.0.1.tar.gz
Extract and enter the directory:
$tar zxvf redis-4.0.1.tar.gz $cd redis-4.0.1
Create a directory for the Redis configuration file and copy the default profile to it:
$mkdir / redis/conf $cp redis.conf / redis/conf/
Establish dependencies:
$cd deps $make hiredis lua jemalloc linenoise $cd..
Be careful
Due to the differences between the various operating systems and libraries installed on it, the above steps will need to be performed when an error indicates some dissatisfaction. For example, you might encounter an error message: zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory. For most environments, you do not have to perform this step if there is no problem with dependencies.
To compile:
$make
If all goes well, the following message will be displayed. This means that the compilation has completed successfully:
It's a good idea to run 'make test';) make [1]: Leaving directory' / redis/redis-4.0.1/src'
Install Redis:
$make PREFIX=/redis install
The following message indicates that the installation was successful:
Enter the / redis directory and verify that the Redis binaries have been generated:
$ls / redis/bin redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
Congratulations! You have completed the Redis compilation and installation.
It is much easier for apt-get to use and install Redis in Ubuntu than to compile and install. Let's take a look:
First, update the software repository index:
$sudo apt-get update
Then start the installation:
$sudo apt-get install redis-server
When you are finished, check that Redis is set in your environment:
$which redis-server
Three: how does this work?
When choosing a Redis version, keep in mind that Redis follows the standard version control convention, that is, the major.minor.patch level. An even number represents a stable version, while an odd number mainly represents an unstable version, although in some versions Redis uses an odd number secondary.
The difference between compiling and building Redis from software repositories is that the former adds optimization or debugging options at compile time and also has the flexibility to specify the installation location during installation.
After installation, there are some executables in the bin directory. Their descriptions and descriptions are shown in the following table:
Four: there are more!
For Windows, you can get the Redis version of Windows, and the Microsoft Open Technologies group is used for maintenance:
Https: / / github.com/MicrosoftArchive/redis/releases .
Simply download the .msi executable and double-click to install it to keep the default configuration.
For macOS, it is not much different from the process in Linux. You can also install Redis by issuing commands on macOS through brew install redis.
This is the end of the method of downloading and installing Redis. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.
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.