You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sudo apt install redis-tools # this will install `redis-cli`
20
+
sudo snap install redis
23
21
{{< / highlight >}}
24
22
25
-
Redis will not start automatically, nor will it start at boot time. To start `redis-server` in the foreground, run the command:
26
-
27
-
{{< highlight bash >}}
28
-
sudo snap run redis-server
29
-
{{< /highlight >}}
30
-
31
-
To stop Redis, enter `Ctrl-C`.
23
+
Redis will start automatically after installation and also at boot time.
32
24
33
-
Follow these steps to integrate Redis CE with `systemd` so you can start/stop in/from the background:
25
+
## Connect to Redis CE
34
26
35
-
1. Edit the `/etc/systemd/system/redis-server.service` file and enter the following information:
27
+
Once Redis is running, you can test it by running `redis-cli`:
36
28
37
-
{{< highlight text >}}
38
-
[Unit]
39
-
Description=Redis CE Server
40
-
After=network.target
41
-
42
-
[Service]
43
-
ExecStart=/usr/bin/snap run redis-server
44
-
Restart=always
45
-
User=root
46
-
Group=root
47
-
48
-
[Install]
49
-
WantedBy=multi-user.target
50
-
{{< /highlight >}}
51
-
52
-
1. Run the following commands.
29
+
{{< highlight bash >}}
30
+
redis-cli
31
+
{{< / highlight >}}
53
32
54
-
{{< highlight bash >}}
55
-
sudo systemctl daemon-reload
56
-
sudo systemctl start redis-server
57
-
sudo systemctl enable redis-server
58
-
{{< /highlight >}}
33
+
Test the connection with the `ping` command:
59
34
60
-
If your Linux distribution does not currently have Snap installed, you can install it using the instructions described [here](https://snapcraft.io/docs/installing-snapd). Then, download the appropriate from the [downloads page](https://redis.io/downloads/).
0 commit comments