In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 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 Redis under Linux, I believe that 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!
Official website download link: https://redis.io/download
1. Select the Download 5.0.0 link under Stable (5.0) to download (stable is a stable version, linux version is downloaded by default)
Recommended (free): redis
2. After the download is complete, open WinSCP, upload the downloaded Redis package to the Linux / mnt/ file directory
3. Use putty to connect to our Linux server, go to the / mnt/ file directory, extract redis-5.0.0.tar.gz, and move redis-5.0.0 to the / usr/local/ directory
[root@localhost ~] # cd / mnt/ enter the mnt file directory [root@localhost mnt] # tar xzf redis-5.0.0.tar.gz / / decompress redis [root@localhost mnt] # ls / / View the mnt directory redis-5.0.0 redis-5.0.0.tar.gz [root@localhost mnt] # mv redis-5.0.0 / usr/local/ put redis-5.0 .0 move to / usr/local/ directory
4. Install the gcc environment
Since redis is written in C, it needs a C environment to run, so we need to install gcc first. The installation commands are as follows:
[root@localhost mnt] # yum install gcc-c++
5. Go to the / usr/local/redis-5.0.0/ directory to compile and install
/ / enter [root@localhost mnt] # cd / usr/local/redis-5.0.0/ [root@localhost redis-5.0.0] # make / / compile the extracted files [root@localhost redis-5.0.0] # cd. / src / / under the / usr/local/redis-5.0.0/ file directory [root@localhost src] # make install / / to install redis.
(1) compile the decompressed file
(2) install redis
6. To facilitate management, move the conf configuration files and common commands in the Redis file to the unified file
(1) create bin and etc folders
[root@localhost redis-5.0.0] # mkdir bin / / create a bin folder [root@localhost redis-5.0.0] # mkdir etc / / create an etc folder
(2) move the redis.conf under the redis-5.0.0 directory to the etc folder under the redis-5.0.0 directory
Move mkreleasehdr.sh, redis-benchmark, redis-check-aof, redis-cli, redis-server to the / usr/local/redis-5.0.0/bin/ directory
/ / move the redis.conf under the redis-5.0.0 directory to the src folder under the redis-5.0.0 directory [root@localhost redis-5.0.0] # mv redis.conf. / etc/ [root@localhost redis-5.0.0] # cd. / src/ enter the src folder under the redis-5.0.0 directory / / mkreleasehdr.sh, redis-benchmark, redis-check-aof, redis-cli, Move redis-server to / usr/local/redis-5.0.0/bin/ directory [root@localhost src] # mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-cli redis-server / usr/local/redis-5.0.0/bin/
7. Go to the / usr/local/redis-5.0.0/etc/ directory
/ / go to the / usr/local/redis-5.0.0/etc/ directory [root@localhost src] # cd / usr/local/redis-5.0.0/etc/ [root@localhost etc] # ls / / View the etc directory redis.conf
8. Edit the redis.conf configuration file and set the background to start the redis service.
[root@localhost etc] # vi redis.conf
Change the daemonize attribute in the file to yes (indicates that it needs to be run in the background)
9. Edit the redis.conf configuration file and enable the redis remote access service.
(1) comment out the line bind 127.0.0.1 in the redis.conf configuration file. Here, bind means that only the specified network segment can access the redis remotely. After the comment is left out, there is no such restriction.
(2) set protected-mode in redis.conf configuration file to no (default is set to yes to prevent remote access, after redis3.2.3 version)
10. Edit the redis.conf configuration file and modify the Redis default password (the default password is empty)
(1) find this line # requirepass foobared in the configuration file
(2) remove the previous comment symbol # and change foobared to your own password or another line of requirepass's own password
11. Set Redis to boot
[root@localhost etc] # vi / etc/rc.d/rc.local
Add the following code to / etc/rc.d/rc.local:
/ usr/local/redis-5.0.0/bin/redis-server / usr/local/redis-5.0.0/etc/redis.conf
12. Change to the / usr/local/redis-5.0.0/bin/ directory to execute the redis-server command and use the / usr/local/redis-5.0.0/etc/redis.conf configuration file to start the redis service
/ / go to the / usr/local/redis-5.0.0/bin/ directory [root@localhost etc] # cd / usr/local/redis-5.0.0/bin/ [root@localhost bin] # ls / / View the bin directory mkreleasehdr.sh redis-benchmark redis-check-aof redis-cli redis-server [root@localhost bin] #. / redis-server / usr/local/redis-5.0.0/etc/redis.conf / / start the Redis service
13. Open RedisDesktopManager and test whether the service is enabled and whether Redis can be accessed remotely
These are all the contents of this article entitled "how to install Redis under Linux". 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.