反馈已提交
网络繁忙
Redis is used as a stateful server in Web clusters, mainly for storing cached logins, template locks, SessionIDs, WebSockets, etc. It plays and authenticates all accesses and operations.
This step relies on the gcc compiler. If you do not have a gcc environment, you will need to install the package yourself.
yum install gcc gcc-c++ ,As shown below.
gcc -v ##Check for gcc compiler
There are two ways to download Redis-5.0.4, either from the official website or by downloading the recommended version.
1)Official Website Download:http://download.redis.io/releases/
2)Redis-5.0.4:redis-5.0.4.tar.gz
mkdir /usr/redis # Creating a Redis Directorycd /usr/redis # Go to catalog# Transfer the Redis installation package to this directory#tar -zxvf redis-5.0.4.tar.gz # Unzip the installation packagecd /usr/redis/redis-5.0.4 # Go to the decompression directorymake make testmake install # installation commandredis-server -v # Check the installation results
Go to the edit file, as follows.
vi /usr/redis/redis-5.0.4/redis.conf # Edit the redis.conf configuration file
Modify the following.
bind 127.0.0.1 ---> # bind 127.0.0.1protected-mode yes ---> protected-mode nodaemonize no ---> daemonize yes # Runs as a background program by default, no need to add & force the background to runport 6379 ---> port 7379 # Change the port number to 7379pidfile /var/run/redis_6379.pid ---> pidfile /var/run/redis_7379.pid # Change the port number to 7379# requirepass foobared ---> requirepass 123456 # 123456 is the password can be replaced at willmaxmemory 4294967296 # Configure memory to 4G unit is byte, can also be configured to other sizes, the recommended size is 4G (need to add content)maxmemory-policy allkeys-lru # Expiration policy, LRU Least Recent Use algorithm (content to be added)
cd /usr/redis/redis-5.0.4/src #Go to the src directory./redis-server /usr/redis/redis-5.0.4/redis.conf #Specify the configuration file when starting Redisredis-cli -p port -a password #Local start Redis client, you can view key values, delete key values, check redis status and other operations
cd /usr/redis/redis-5.0.4/src #Go to the src directory. /redis-server /usr/redis/redis-5.0.4/redis.conf #Specify the configuration file when starting Redisredis-cli -p port -a password #Local start Redis client, you can view key values, delete key values, check redis status, etc.redis-cli -p port -a password shutdown #Stop redisredis-cli -h ip -p port -a password #Remotely connect to the Redis service, ip and port are the Redis service to connect to
For more information on operations and maintenance, see: Redis Operations and Maintenance Manual for Linux
售前咨询电话
400-811-8890转1
在线技术支持
在线QQ:800049425
热线电话:400-811-8890转2
总裁办24H投诉
热线电话:173-1278-1526
文 档反 馈
鼠标选中内容,快速反馈问题
鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。
不再提示
10s后关闭