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
Copy file name to clipboardExpand all lines: docs/getting-started/_index.md
+19-16
Original file line number
Diff line number
Diff line change
@@ -87,43 +87,46 @@ Running Redis from the command line is fine just to hack a bit or for developmen
87
87
* Run Redis using screen.
88
88
* Install Redis in your Linux box in a proper way using an init script, so that after a restart everything will start again properly.
89
89
90
-
A proper install using an init script is strongly suggested.
91
-
The following instructions can be used to perform a proper installation using the init script shipped with Redis version 2.4 or higher in a Debian or Ubuntu based distribution.
90
+
A proper install using an init script is strongly recommended. Note: the available packages for supported Linux distributions already include the capability of starting the Redis server from `/etc/init`.
92
91
93
-
We assume you already copied **redis-server** and **redis-cli** executables under /usr/local/bin.
92
+
**Note**: the remainder of this section assumes you've [installed Redis from its source code](/docs/getting-started/installation/install-redis-from-source/). If instead you have installed Redis Stack, you will need to download a [basic init script](https://raw.githubusercontent.com/redis/redis/7.2/utils/redis_init_script) and then modify both it and the following instructions to conform to the way Redis Stack was installed on your platform. For example, on Ubuntu 20.04 LTS, Redis Stack is installed in `/opt/redis-stack`, not `/usr/local`, so you'll need to adjust accordingly.
93
+
94
+
The following instructions can be used to perform a proper installation using the init script shipped with the Redis source code, `/path/to/redis-stable/utils/redis_init_script`.
95
+
96
+
If you have not yet run `make install` after building the Redis source, you will need to do so before continuing. By default, `make install` will copy the `redis-server` and `redis-cli` binaries to `/usr/local/bin`.
94
97
95
98
* Create a directory in which to store your Redis config files and your data:
96
99
97
100
sudo mkdir /etc/redis
98
101
sudo mkdir /var/redis
99
102
100
-
* Copy the init script that you'll find in the Redis distribution under the **utils** directory into `/etc/init.d`. We suggest calling it with the name of the port where you are running this instance of Redis. For example:
103
+
* Copy the init script that you'll find in the Redis distribution under the **utils** directory into `/etc/init.d`. We suggest calling it with the name of the port where you are running this instance of Redis. Make sure the resulting file has `0755` permissions.
Make sure to modify **REDISPORT**accordingly to the port you are using.
111
+
Make sure to set the **REDISPORT**variable to the port you are using.
109
112
Both the pid file path and the configuration file name depend on the port number.
110
113
111
-
* Copy the template configuration file you'll find in the root directory of the Redis distribution into `/etc/redis/` using the port number as name, for instance:
114
+
* Copy the template configuration file you'll find in the root directory of the Redis distribution into `/etc/redis/` using the port number as the name, for instance:
112
115
113
116
sudo cp redis.conf /etc/redis/6379.conf
114
117
115
-
* Create a directory inside `/var/redis` that will work as data and working directory for this Redis instance:
118
+
* Create a directory inside `/var/redis` that will work as both data and working directory for this Redis instance:
116
119
117
120
sudo mkdir /var/redis/6379
118
121
119
122
* Edit the configuration file, making sure to perform the following changes:
120
123
* Set **daemonize** to yes (by default it is set to no).
121
-
* Set the **pidfile** to `/var/run/redis_6379.pid` (modify the port if needed).
122
-
* Change the **port** accordingly. In our example it is not needed as the default port is already 6379.
124
+
* Set the **pidfile** to `/var/run/redis_6379.pid`, modifying the port as necessary.
125
+
* Change the **port** accordingly. In our example it is not needed as the default port is already `6379`.
123
126
* Set your preferred **loglevel**.
124
127
* Set the **logfile** to `/var/log/redis_6379.log`
125
128
* Set the **dir** to `/var/redis/6379` (very important step!)
126
-
* Finally add the new Redis init script to all the default runlevels using the following command:
129
+
* Finally, add the new Redis init script to all the default runlevels using the following command:
127
130
128
131
sudo update-rc.d redis_6379 defaults
129
132
@@ -133,12 +136,12 @@ You are done! Now you can try running your instance with:
133
136
134
137
Make sure that everything is working as expected:
135
138
136
-
* Try pinging your instance with redis-cli.
137
-
* Do a test save with `redis-cli save` and check that the dump file is correctly stored into`/var/redis/6379/` (you should find a file called `dump.rdb`).
138
-
* Check that your Redis instance is correctly logging in the log file.
139
-
* If it's a new machine where you can try it without problems make sure that after a reboot everything is still working.
139
+
* Try pinging your instance within a `redis-cli` session using the `PING` command.
140
+
* Do a test save with `redis-cli save` and check that a dump file is correctly saved to`/var/redis/6379/dump.rdb`.
141
+
* Check that your Redis instance is logging to the `/var/log/redis_6379.log` file.
142
+
* If it's a new machine where you can try it without problems, make sure that after a reboot everything is still working.
140
143
141
-
Note: The above instructions don't include all of the Redis configuration parameters that you could change, for instance, to use AOF persistence instead of RDB persistence, or to set up replication, and so forth.
142
-
Make sure to read the example [`redis.conf`](https://github.com/redis/redis/blob/6.2/redis.conf) file (that is heavily commented).
144
+
Note: The above instructions don't include all of the Redis configuration parameters that you could change. For example, to use AOF persistence instead of RDB persistence, or to set up replication, and so forth.
145
+
Make sure to read the example [redis.conf](/docs/management/config-file/) file, which is heavily annotated to help guide you on making changes, and also the [configuration article on this site](/docs/management/config/).
0 commit comments