查找redis进程失败

来源:4-3 应用服务化

Star3327752

2022-11-03 15:35:29

[root@localhost redis-5.0.14]# ./src/redis-server redis.conf 

3528:C 03 Nov 2022 00:32:56.911 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

3528:C 03 Nov 2022 00:32:56.911 # Redis version=5.0.14, bits=64, commit=00000000, modified=0, pid=3528, just started

3528:C 03 Nov 2022 00:32:56.911 # Configuration loaded

3528:M 03 Nov 2022 00:32:56.912 * Increased maximum number of open files to 10032 (it was originally set to 1024).

                _._                                                  

           _.-``__ ''-._                                             

      _.-``    `.  `_.  ''-._           Redis 5.0.14 (00000000/0) 64 bit

  .-`` .-```.  ```\/    _.,_ ''-._                                   

 (    '      ,       .-`  | `,    )     Running in standalone mode

 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379

 |    `-._   `._    /     _.-'    |     PID: 3528

  `-._    `-._  `-./  _.-'    _.-'                                   

 |`-._`-._    `-.__.-'    _.-'_.-'|                                  

 |    `-._`-._        _.-'_.-'    |           http://redis.io        

  `-._    `-._`-.__.-'_.-'    _.-'                                   

 |`-._`-._    `-.__.-'    _.-'_.-'|                                  

 |    `-._`-._        _.-'_.-'    |                                  

  `-._    `-._`-.__.-'_.-'    _.-'                                   

      `-._    `-.__.-'    _.-'                                       

          `-._        _.-'                                           

              `-.__.-'                                               


3528:M 03 Nov 2022 00:32:56.914 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

3528:M 03 Nov 2022 00:32:56.914 # Server initialized

3528:M 03 Nov 2022 00:32:56.914 # 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.

3528:M 03 Nov 2022 00:32:56.914 # 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.

3528:M 03 Nov 2022 00:32:56.914 * DB loaded from disk: 0.000 seconds

3528:M 03 Nov 2022 00:32:56.914 * Ready to accept connections

^C3528:signal-handler (1667460820) Received SIGINT scheduling shutdown...

3528:M 03 Nov 2022 00:33:40.773 # User requested shutdown...

3528:M 03 Nov 2022 00:33:40.773 * Saving the final RDB snapshot before exiting.

3528:M 03 Nov 2022 00:33:40.787 * DB saved on disk

3528:M 03 Nov 2022 00:33:40.787 * Removing the pid file.

3528:M 03 Nov 2022 00:33:40.787 # Redis is now ready to exit, bye bye...

https://img.mukewang.com/climg/63636f0309c1217225601600.jpg

这里redis打开之后好像在文档编辑的模式,无法退出,我点击CTRL+c强行退出的话,又会导致redis关闭,从而查找不到redis的进程。这种情况怎么办嘞?


写回答

1回答

好帮手慕小小

2022-11-03

同学你好,当前redis是前台运行,再开一个会话窗口查询试下。例如:

https://img.mukewang.com/climg/6363874b090be49516430490.jpg

同学也可退出redis前台运行,按照当前小节课程步骤设置redis后台运行后 再查询redis进程。


注:设置后台运行时需先将redis.conf中的daemonize设置为yes

若未修改,redis.conf中的daemonize默认设置为no,使用命令systemctl start redis启动后redis仍是前台运行,exit强制退出或者关闭连接工具都会导致redis进程退出;将daemonize设置为yes,使用命令systemctl start redis启动,此时redis才为后台运行。

祝学习愉快~

1

0 学习 · 9886 问题

查看课程