In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to install Redis". In daily operation, I believe many people have doubts about how to install Redis. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to install Redis". Next, please follow the editor to study!
_
Redis as a member of NOSQL database, installation is much easier than other databases, but in fact, part of the installation of REDIS is not very standard, more casual, so this issue about the installation of REDIS. The following are common installation problems for developers
Question 1 install REDIS using the root account as the LINUX account to start REDIS
When installing ORACLE database, everyone knows to use ORACLE or non-ROOT account as the LINUX ACCOUNT of ORACLE database. The same is true for other databases installed under LINUX, and REDIS is no exception, so it is inappropriate to use ROOT as the account to start the database under REDIS under LINUX.
Each system uses a separate user to run, mainly to prevent the running system from having the authority of ROOT, so that if there are loopholes or modify some system information, it is not easy to be found. If you use a non-ROOT account, if there are multiple systems running on LINUX, it increases isolation and security. In addition, for some configurations, you can set it for a user, not as a whole. For example
/ etc/security/limits.conf
You can do it individually for a user, rather than in a * way. In addition, different accounts can set different profile for each application has its own variable environment, not all applications have a variable environment.
So to install REDIS, you need to set up a separate account for redis.
Question 2 will be reported when make is carried out
/ bin/sh: cc: command not found
The problem is due to a problem with no gcc installed or an earlier version
Please yum-y install gcc directly.
Question 3 after installing gcc, make continues to report an error
After entering the deps directory, execute the following command
Make hiredis lua jemalloc
Cd linenoise & & make
The main problem here is that when building Redis, you choose a non-default memory allocator by setting the MALLOC environment variable. By default, Redis is compiled and linked for libc malloc, and jemalloc is the default on Linux systems. This default value was chosen because jemalloc has been shown to have fewer fragmentation problems than libc malloc.
Of course, you can also use make MALLOC=libc to solve the problem that you don't want to use jemalloc.
After the end of make, you can install REDIS into the specified directory
Sudo make PREFIX=/usr/local/redis install
When compiling, there may also be an error, because the directory of your installation will not be ROOT's directory permission, not redis's permission.
Please modify the relevant permissions
Then copy the configuration file of redis to the / etc/ directory
Question 3 there is a problem with the configuration of redis without a password.
If we say that the important problem in installing REDIS is the configuration file, while some REDIS does not have a password in some use environments, it is also a fact to enter directly, just like last year's MONGODB leaked data, making it seem to be the problem of MONGODB itself, in fact, it simply did not set the most basic password, and then let MONGODB take the blame. The probability of such a thing is that no one in the unit manages the database, or the person who manages the database does not think that MongoDB REDIS belongs to the database, but belongs to the developer. In this case, the developer is not the operation and maintenance staff after all, and the two have different starting points for the use of the tools. As a result, the developers have nothing to do with the OK when the function can be used, and the operation and maintenance personnel are your tools that must conform to the standards and specifications. As for whether it is easy to use in the application, I don't care.
Therefore, the starting points of the two sides are different, resulting in either poor performance or security is not in place, so large units have dedicated management, and study its security and performance, integrate the needs of the two sides to avoid problems.
If Redis is built by the developer of a unit, chances are that it will not pay attention to the configuration file, especially that there may be no password at all. Here are some key information in the configuration file of redis.
Includes
Modules
Network
General
Snapshotting
1 listens to the address. By default, redis only listens to its own address 127.0.0.1. In practical application, it must be configured, otherwise how can the remote connection be connected to the redis?
So you need to bind an address. Redis is a space that can be bound to multiple addresses to split.
2 start redis, start redis and run redis-server / etc/redis.conf directly
But if you turn off redis at this time, there will be the following problems
The reason redis cannot be shut down through ctrl + c is that redis must brush the current data into the RDB file, and RDB persistence performs a point-in-time snapshot of the dataset at a specified interval.
At this time, the rdb file cannot be brushed in because there is no permission. Therefore, you need to specify a data directory that can be used by the redis account. After establishing a directory with write permission for the redis account, update the information after dir in the configuration file to the directory information. If you start redis again, there will be no problem that redis cannot be closed.
In addition, generally speaking, applications need to run in the background, so the location of the following image must be set to yes instead of no.
Set the password in the configuration file, restart redis before logging in to redis-cli
Config get requirepass
After startup, you can see that the current password is already in effect. Finally, you need to set the log.
Finally, you need to set up logs, any system needs logs to troubleshoot system problems, so redis is no exception. After setting up, you need to restart it.
So the installation of stand-alone REDIS should still pay attention to some things, of course, the above content is not complete. But at least let REDIS put on clothes, no password, no log, no log, it will really catch cold.
At this point, the study on "how to install 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.