如何从我的 ubuntu-16.04 服务器中删除 redis
how to delete redis from my ubuntu-16.04 server
当我 运行 sudo systemctl status redis
我明白了
● redis.service - Redis In-Memory Data Store
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset:
enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2017-05-11 03:43:43
WEST;
31min ago
Main PID: 1553 (code=exited, status=203/EXEC)
May 11 03:43:42 fevrok systemd[1]: redis.service: Control process exited,
code=exited status=203
May 11 03:43:42 fevrok systemd[1]: redis.service: Unit entered failed state.
May 11 03:43:42 fevrok systemd[1]: redis.service: Failed with result 'exit-code'.
May 11 03:43:43 fevrok systemd[1]: redis.service: Service hold-off time over, scheduling restart.
May 11 03:43:43 fevrok systemd[1]: Stopped Redis In-Memory Data Store.
May 11 03:43:43 fevrok systemd[1]: redis.service: Start request repeated too quickly.
May 11 03:43:43 fevrok systemd[1]: Failed to start Redis In-Memory Data Store.
当我 运行 sudo systemctl status redis-server
我明白了
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-05-11 03:25:48 WEST; 49min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 1121 (redis-server)
CGroup: /system.slice/redis-server.service
└─1121 /usr/bin/redis-server 127.0.0.1:6379
May 11 03:25:48 fevrok systemd[1]: Starting Advanced key-value store...
May 11 03:25:48 fevrok run-parts[1116]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example
May 11 03:25:48 fevrok run-parts[1122]: run-parts: executing /etc/redis/redis-server.post-up.d/00_example
May 11 03:25:48 fevrok systemd[1]: Started Advanced key-value store.
看起来我的机器上有 2 个 redis 服务,所以我怎么能删除第一个,因为它很旧并且在我尝试启动它时不工作,也许是因为我很久以前就试图删除它所以我想我已经做到了,所以问题是:我如何才能删除此服务:/etc/systemd/system/redis.service
sudo apt-get purge redis
如果不行,你可以尝试找到redis文件并删除它,主要是redis在/usr/bin/redis
如果安装时使用apt-get
sudo apt-get purge --auto-remove redis-server
如果安装时使用了makefile
当我 运行 sudo systemctl status redis
我明白了
● redis.service - Redis In-Memory Data Store
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset:
enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2017-05-11 03:43:43
WEST;
31min ago
Main PID: 1553 (code=exited, status=203/EXEC)
May 11 03:43:42 fevrok systemd[1]: redis.service: Control process exited,
code=exited status=203
May 11 03:43:42 fevrok systemd[1]: redis.service: Unit entered failed state.
May 11 03:43:42 fevrok systemd[1]: redis.service: Failed with result 'exit-code'.
May 11 03:43:43 fevrok systemd[1]: redis.service: Service hold-off time over, scheduling restart.
May 11 03:43:43 fevrok systemd[1]: Stopped Redis In-Memory Data Store.
May 11 03:43:43 fevrok systemd[1]: redis.service: Start request repeated too quickly.
May 11 03:43:43 fevrok systemd[1]: Failed to start Redis In-Memory Data Store.
当我 运行 sudo systemctl status redis-server
我明白了
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-05-11 03:25:48 WEST; 49min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 1121 (redis-server)
CGroup: /system.slice/redis-server.service
└─1121 /usr/bin/redis-server 127.0.0.1:6379
May 11 03:25:48 fevrok systemd[1]: Starting Advanced key-value store...
May 11 03:25:48 fevrok run-parts[1116]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example
May 11 03:25:48 fevrok run-parts[1122]: run-parts: executing /etc/redis/redis-server.post-up.d/00_example
May 11 03:25:48 fevrok systemd[1]: Started Advanced key-value store.
看起来我的机器上有 2 个 redis 服务,所以我怎么能删除第一个,因为它很旧并且在我尝试启动它时不工作,也许是因为我很久以前就试图删除它所以我想我已经做到了,所以问题是:我如何才能删除此服务:/etc/systemd/system/redis.service
sudo apt-get purge redis
如果不行,你可以尝试找到redis文件并删除它,主要是redis在/usr/bin/redis
如果安装时使用apt-get
sudo apt-get purge --auto-remove redis-server
如果安装时使用了makefile