系统环境
CentOS Linux release 7.7.1908 (Core)
yum安装
yum install redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:3.2.8-1.el7 will be installed
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: redis-3.2.8-1.el7.x86_64
--> Running transaction check
---> Package jemalloc.x86_64 0:3.6.0-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================
Installing:
redis x86_64 3.2.8-1.el7 cloud 542 k
Installing for dependencies:
jemalloc x86_64 3.6.0-1.el7 cloud 105 k
Transaction Summary
=====================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 647 k
Installed size: 1.7 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): jemalloc-3.6.0-1.el7.x86_64.rpm | 105 kB 00:00:09
(2/2): redis-3.2.8-1.el7.x86_64.rpm | 542 kB 00:00:10
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 62 kB/s | 647 kB 00:00:10
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : jemalloc-3.6.0-1.el7.x86_64 1/2
Installing : redis-3.2.8-1.el7.x86_64 2/2
Verifying : jemalloc-3.6.0-1.el7.x86_64 1/2
Verifying : redis-3.2.8-1.el7.x86_64 2/2
Installed:
redis.x86_64 0:3.2.8-1.el7
Dependency Installed:
jemalloc.x86_64 0:3.6.0-1.el7
Complete!
Redis服务启动
systemctl start redis
Redis开机启动
# systemctl enable redis
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
查看运行状态
# systemctl status redis
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Sun 2020-02-16 02:28:04 CST; 12s ago
Main PID: 7334 (redis-server)
CGroup: /system.slice/redis.service
└─7334 /usr/bin/redis-server 127.0.0.1:6379
Feb 16 02:28:04 controller systemd[1]: Started Redis persistent key-value database.
查看程序进程以及端口 6379
# ps -aux | grep redis
redis 7334 0.1 0.2 142968 2512 ? Ssl 02:28 0:00 /usr/bin/redis-server 127.0.0.1:6379
root 7456 0.0 0.0 112712 960 pts/0 S+ 02:31 0:00 grep --color=auto redis