在Linux中,您可以使用以下方法之一远程关闭Redis服务器:
方法1:使用redis-cli
命令行工具
your_remote_host
替换为实际的主机名或IP地址):redis-cli -h your_remote_host -p your_remote_port
SHUTDOWN
方法2:使用systemctl
命令(适用于使用systemd的系统)
your_remote_host
替换为实际的主机名或IP地址):ssh your_remote_user@your_remote_host
sudo systemctl stop redis
方法3:使用kill
命令(适用于基于SysV init的系统)
your_remote_host
替换为实际的主机名或IP地址):ssh your_remote_user@your_remote_host
ps aux | grep redis-server
your_redis_pid
替换为实际的PID):sudo kill your_redis_pid
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:linux里redis关闭过程会怎样