127.0.0.1, the local machine running the Redis server.
redis.conffile. This tutorial uses the
nanoeditor, but you can substitute your favorite editor. Enter the following:
bind 0.0.0.0setting enables Redis to accept connections from any IP address. This is a commonly used setting. When bound to
127.0.0.1, Redis will only accept connections from the local machine running Redis, meaning that your application would have to reside on the same machine as the Redis server.
bind 0.0.0.0setting makes your instance publicly accessible. This requires you to add a strong password to protect your instance from unauthorized access and malicious activities.
# requirepassand add a strong password.
defaultnetwork in your project. The
defaultnetwork allows all TCP connections between its Compute Engine instances using the internal network. In a production environment, you will want to skip this step.
redis-cli, an officially supported command-line tool to interact with a Redis server.
[REDIS_IPV4_ADDRESS]with the external IP address from the previous step and
[YOUR_STRONG_PASSWORD]with the password you defined in step 5 of the "Configure Redis remote access" section:
PONGoutput to the terminal.