⌘CtrlK
Appearance
Appearance
yum install -y gcc-c++下载Redis
wget http://download.redis.io/releases/redis-6.2.5.tar.gz解压
tar -zvxf redis-6.2.5.tar.gz移动到指定目录
mv redis-6.2.5 redis /usr/local/rediscd /usr/local/redis
make例如:
[root@192 redis]# pwd
/usr/local/redis
[root@192 redis]# makemake install PREFIX=/usr/local/redis/ 后面的是你想要安装的路径例如:
[root@192 redis]# make install PREFIX=/usr/local/redis
cd src && make install
make[1]: Entering directory `/usr/local/redis/src'
CC Makefile.dep
make[1]: Leaving directory `/usr/local/redis/src'
make[1]: Entering directory `/usr/local/redis/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/usr/local/redis/src'bind * -::*logfile "/home/primeton/redis-5.0.8/log/redis.log"dir /home/primeton/redis-5.0.8/redis启动redis 根据上面的操作已经将redis安装完成了。在目录/usr/local/redis 输入下面命令启动redis
./bin/redis-server ./redis.conf启动后界面
[root@192 redis]# ./bin/redis-server ./redis.conf
8305:C 14 Jul 2022 03:11:47.631 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
8305:C 14 Jul 2022 03:11:47.631 # Redis version=5.0.12, bits=64, commit=00000000, modified=0, pid=8305, just started
8305:C 14 Jul 2022 03:11:47.631 # Configuration loaded
8305:M 14 Jul 2022 03:11:47.631 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.12 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 8305
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
8305:M 14 Jul 2022 03:11:47.634 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
8305:M 14 Jul 2022 03:11:47.634 # Server initialized
8305:M 14 Jul 2022 03:11:47.634 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
8305:M 14 Jul 2022 03:11:47.634 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
8305:M 14 Jul 2022 03:11:47.634 * Ready to accept connections安装成功 按ctrl+c即可退出
常用命令
bin/redis-server redis.conf 根据配置文件启动
bin/redis-cli shutdown 停止