Skip to content

Commit 2506b15

Browse files
Merge pull request #2554 from dwdougherty/doc-2755-get-started-changes
DOC-2755: update get started for clarity
2 parents 5296168 + d1eb2e7 commit 2506b15

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

docs/getting-started/_index.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -87,43 +87,46 @@ Running Redis from the command line is fine just to hack a bit or for developmen
8787
* Run Redis using screen.
8888
* Install Redis in your Linux box in a proper way using an init script, so that after a restart everything will start again properly.
8989

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`.
9291

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`.
9497

9598
* Create a directory in which to store your Redis config files and your data:
9699

97100
sudo mkdir /etc/redis
98101
sudo mkdir /var/redis
99102

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.
101104

102105
sudo cp utils/redis_init_script /etc/init.d/redis_6379
103106

104107
* Edit the init script.
105108

106109
sudo vi /etc/init.d/redis_6379
107110

108-
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.
109112
Both the pid file path and the configuration file name depend on the port number.
110113

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:
112115

113116
sudo cp redis.conf /etc/redis/6379.conf
114117

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:
116119

117120
sudo mkdir /var/redis/6379
118121

119122
* Edit the configuration file, making sure to perform the following changes:
120123
* 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`.
123126
* Set your preferred **loglevel**.
124127
* Set the **logfile** to `/var/log/redis_6379.log`
125128
* 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:
127130

128131
sudo update-rc.d redis_6379 defaults
129132

@@ -133,12 +136,12 @@ You are done! Now you can try running your instance with:
133136

134137
Make sure that everything is working as expected:
135138

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.
140143

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/).
143146

144147
<hr>

docs/getting-started/installation/install-redis-from-source.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ If the compile succeeds, you'll find several Redis binaries in the `src` directo
3636
To install these binaries in `/usr/local/bin`, run:
3737

3838
{{< highlight bash >}}
39-
make install
39+
sudo make install
4040
{{< / highlight >}}
4141

4242
### Starting and stopping Redis in the foreground
@@ -50,3 +50,5 @@ redis-server
5050
If successful, you'll see the startup logs for Redis, and Redis will be running in the foreground.
5151

5252
To stop Redis, enter `Ctrl-C`.
53+
54+
For a more complete installation, continue with [these instructions](/docs/getting-started/#install-redis-more-properly).

0 commit comments

Comments
 (0)