...... ^ server.c:5212:31: error: ‘struct redisServer’ has no member named ‘server_cpulist’ redisSetCpuAffinity(server.server_cpulist); ^ server.c: In function ‘hasActiveChildProcess’: server.c:1480:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ server.c: In function ‘allPersistenceDisabled’: server.c:1486:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ server.c: In function ‘writeCommandsDeniedByDiskError’: server.c:3826:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ server.c: In function ‘iAmMaster’: server.c:5000:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[1]: *** [server.o] Error 1 make[1]: Leaving directory `/usr/local/src/redis-6.0.6/src' make: *** [all] Error 2
...... CC setcpuaffinity.o LINK redis-server INSTALL redis-sentinel CC redis-cli.o LINK redis-cli CC redis-benchmark.o LINK redis-benchmark INSTALL redis-check-rdb INSTALL redis-check-aof
[root@iZx068ismxxjaoZ bin]# cd /usr/local/redis/bin/ [root@iZx068ismxxjaoZ bin]# ./redis-server 31845:C 17 Dec 2020 14:18:30.709 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 31845:C 17 Dec 2020 14:18:30.709 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=31845, just started 31845:C 17 Dec 2020 14:18:30.709 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 6.0.6 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 31845 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-'
31845:M 17 Dec 2020 14:18:30.711 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 31845:M 17 Dec 2020 14:18:30.711 # Server initialized 31845:M 17 Dec 2020 14:18:30.711 # 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. 31845:M 17 Dec 2020 14:18:30.711 # 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. 31845:M 17 Dec 2020 14:18:30.711 * Ready to accept connections
后台启动
从 redis 的源码目录中复制 redis.conf 到 redis 的安装目录
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@iZx068ismxxjaoZ bin]# cp /usr/local/src/redis-6.0.6/redis.conf /usr/local/redis/bin/ [root@iZx068ismxxjaoZ bin]# ll total 35792 -rw-r--r-- 1 root root 92 Dec 17 14:19 dump.rdb -rwxr-xr-x 1 root root 4719584 Dec 17 14:14 redis-benchmark -rwxr-xr-x 1 root root 8952248 Dec 17 14:14 redis-check-aof -rwxr-xr-x 1 root root 8952248 Dec 17 14:14 redis-check-rdb -rwxr-xr-x 1 root root 4975064 Dec 17 14:14 redis-cli -rw-r--r-- 1 root root 83392 Dec 17 14:21 redis.conf lrwxrwxrwx 1 root root 12 Dec 17 14:14 redis-sentinel -> redis-server -rwxr-xr-x 1 root root 8952248 Dec 17 14:14 redis-server [root@iZx068ismxxjaoZ bin]#
修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
################################# GENERAL ##################################### # By default Redis does not run as a daemon. Use 'yes'if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize yes # If you run Redis from upstart or systemd, Redis can interact with your # supervision tree. Options: # supervised no - no supervision interaction # supervised upstart - signal upstart by putting Redis into SIGSTOP mode # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET # supervised auto - detect upstart or systemd method based on # UPSTART_JOB or NOTIFY_SOCKET environment variables # Note: these supervision methods only signal "process is ready." # They do not enable continuous liveness pings back to your supervisor.
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the # internet, binding to all the interfaces is dangerous and will expose the # instance to everybody on the internet. So by default we uncomment the # following bind directive, that will force Redis to listen only into # the IPv4 loopback interface address (this means Redis will be able to # accept connections only from clients running into the same computer it # is running). # # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES # JUST COMMENT THE FOLLOWING LINE. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bind 127.0.0.1 # By default protected mode is enabled. You should disable it only if # you are sure you want clients from other hosts to connect to Redis # even if no authentication is configured, nor a specific set of interfaces # are explicitly listed using the "bind" directive. protected-mode no