2

I am playing around Google Cloud Platform and Redis. But is is way more complicated than I expect.

I want to shutdown redis-server, in my local version i can just:

redis-cli shutdown
redis-cli ping // Could not connect to Redis at 127.0.0.1:6379: Connection refused

that means the redis-server no longer running.

But I cannot do that in GCP. I still can get PONG after the refis-cli shutdown.

I googled around and somebody suggest kill.

first find out what is the PID of the redis-server

ps -f -u redis

I will get: enter image description here

which 1637 is the PID. so I do:

sudo kill 1637

and try refis-cli ping again, I still get PONG.

I tried ps -f -u redis again. I get: enter image description here

It seems like for every kill, it will respawn it self with other PID.

How can I resolve this?

1 Answer 1

1

The redis-cli shutdown works on Mac OS. If you using Debian or Ubuntu, the easiest, way you can shutdown the server is to go into the server and type sudo service redis-server stop and service redis-server start to start it again.

Example

test-user@my-server:~$ sudo service redis-server stop
test-user@my-server:~$ ps -f -u redis
UID        PID  PPID  C STIME TTY          TIME CMD
test-user@my-server:~$

The question was answered in this community post. You may also see the following community tutorial on "How to Set Up Redis on Google Compute Engine"

1
  • thanks. I did actually setting up follow the link you posted.
    – sooon
    Jul 22, 2018 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.