2020-01-15 Linux虛擬機(jī)后臺(tái)啟動(dòng)redis

一、啟動(dòng)redis
1.前臺(tái)啟動(dòng)

[root@iz2ze4jq06yojn4f8bm98kz redis-4.0.8]# ./src/redis-server 
19367:C 15 Jan 18:26:32.374 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
19367:C 15 Jan 18:26:32.374 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=19367, just started
19367:C 15 Jan 18:26:32.374 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 19367
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

19367:M 15 Jan 18:26:32.375 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
19367:M 15 Jan 18:26:32.375 # Server initialized
19367:M 15 Jan 18:26:32.375 # 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.
19367:M 15 Jan 18:26:32.375 # 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.
19367:M 15 Jan 18:26:32.375 * Ready to accept connections
^C19367:signal-handler (1579084009) Received SIGINT scheduling shutdown...
19367:M 15 Jan 18:26:49.705 # User requested shutdown...
19367:M 15 Jan 18:26:49.705 * Saving the final RDB snapshot before exiting.
19367:M 15 Jan 18:26:49.706 * DB saved on disk
19367:M 15 Jan 18:26:49.706 # Redis is now ready to exit, bye bye...

2.后臺(tái)啟動(dòng)

[root@iz2ze4jq06yojn4f8bm98kz redis-4.0.8]# nohup ./src/redis-server &
nohup: ignoring input and appending output to ?.ohup.out?

解決:
1.查看日志:

[root@iz2ze4jq06yojn4f8bm98kz redis-4.0.8]# tail -f nohup.out
19394:C 15 Jan 18:31:38.184 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
19394:M 15 Jan 18:31:38.185 # Creating Server TCP listening socket *:6379: bind: Address already in use
19418:C 15 Jan 18:36:18.970 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
19418:C 15 Jan 18:36:18.970 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=19418, just started
19418:C 15 Jan 18:36:18.970 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
19418:M 15 Jan 18:36:18.971 # Creating Server TCP listening socket *:6379: bind: Address already in use
19420:C 15 Jan 18:37:08.698 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
19420:C 15 Jan 18:37:08.698 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=19420, just started
19420:C 15 Jan 18:37:08.698 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
19420:M 15 Jan 18:37:08.699 # Creating Server TCP listening socket *:6379: bind: Address already in use

好像已經(jīng)啟動(dòng)了,但是netstat -input|grep redis 沒有查到進(jìn)程

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容