Skip to content

Commit fc80933

Browse files
authored
DEV: add build from source procedures (#1319)
* DEV: add build from source procedures * Apply review comments; added AlmaLinux and Ubuntu (Focal) pages * Apply review comments; merged alma/rocky pages; added stubs for macOS * Added macOS 13/14 page * Apply code review comments and issues found whilst testing * Bug fix * Change titles per Lior * Remove bash requirement from alma/rocky; it's already there * Remove banner as instructs are complete
1 parent 8a7a522 commit fc80933

File tree

12 files changed

+1083
-3
lines changed

12 files changed

+1083
-3
lines changed

content/operate/oss_and_stack/install/archive/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can install [Redis](https://redis.io/about/) or [Redis Stack](https://redis.
1717

1818
Here are the installation instructions:
1919

20-
* [Install Redis]({{< relref "/operate/oss_and_stack/install/install-redis" >}})
21-
* [Install Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack" >}})
20+
* [Install Redis]({{< relref "/operate/oss_and_stack/install/archive/install-redis" >}})
21+
* [Install Redis Stack]({{< relref "/operate/oss_and_stack/install/archive/install-stack" >}})
2222

2323
While you can install Redis or Redis Stack locally, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
description: Build and run Redis Open Source on Linux and macOS
8+
linkTitle: Build and run Redis Open Source
9+
stack: true
10+
title: Build and run Redis Open Source
11+
weight: 20
12+
---
13+
14+
Build instructions are provided for the following platforms:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
linkTitle: AlmaLinux/Rocky 8.10
8+
title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 8.10
9+
weight: 5
10+
---
11+
12+
Follow the steps below to build and run Redis Open Source from its source code on a system running AlmaLinux and Rocky Linux 8.10.
13+
14+
{{< note >}}
15+
Docker images used to produce these build notes:
16+
- AlmaLinux:
17+
- almalinux:8.10
18+
- almalinux:8.10-minimal
19+
- Rocky Linux:
20+
- rockylinux/rockylinux:8.10
21+
- rockylinux/rockylinux:8.10-minimal
22+
{{< /note >}}
23+
24+
## 1. Prepare the system
25+
26+
{{< note >}}
27+
For 8.10-minimal, you'll need to install `sudo` and `dnf` as follows:
28+
29+
```bash
30+
microdnf install dnf sudo -y
31+
```
32+
33+
For 8.10 (regular), you'll need to install `sudo` as follows:
34+
35+
```bash
36+
dnf install sudo -y
37+
```
38+
{{< /note >}}
39+
40+
Clean the package metadata, enable required repositories, and install development tools:
41+
42+
```bash
43+
sudo dnf clean all
44+
45+
# Add GoReleaser repo
46+
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF
47+
[goreleaser]
48+
name=GoReleaser
49+
baseurl=https://repo.goreleaser.com/yum/
50+
enabled=1
51+
gpgcheck=0
52+
EOF
53+
54+
sudo dnf update -y
55+
sudo dnf groupinstall "Development Tools" -y
56+
sudo dnf config-manager --set-enabled powertools
57+
sudo dnf install -y epel-release
58+
```
59+
60+
## 2. Install required packages
61+
62+
Install the build dependencies, Python 3.11, and supporting tools:
63+
64+
```bash
65+
sudo dnf install -y --nobest --skip-broken \
66+
pkg-config \
67+
wget \
68+
gcc-toolset-13-gcc \
69+
gcc-toolset-13-gcc-c++ \
70+
git \
71+
make \
72+
openssl \
73+
openssl-devel \
74+
python3.11 \
75+
python3.11-pip \
76+
python3.11-devel \
77+
unzip \
78+
rsync \
79+
clang \
80+
curl \
81+
libtool \
82+
automake \
83+
autoconf \
84+
jq \
85+
systemd-devel
86+
```
87+
88+
Create a Python virtual environment:
89+
90+
```bash
91+
python3.11 -m venv /opt/venv
92+
```
93+
94+
Enable the GCC toolset:
95+
96+
```bash
97+
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh
98+
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc
99+
```
100+
101+
## 3. Install CMake
102+
103+
Install CMake 3.25.1 manually:
104+
105+
```bash
106+
CMAKE_VERSION=3.25.1
107+
ARCH=$(uname -m)
108+
109+
if [ "$ARCH" = "x86_64" ]; then
110+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh
111+
else
112+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh
113+
fi
114+
115+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE}
116+
chmod +x ${CMAKE_FILE}
117+
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir
118+
rm ${CMAKE_FILE}
119+
120+
cmake --version
121+
```
122+
123+
## 4. Download and extract the Redis source
124+
125+
The Redis source code is available from the [Download](https://redis.io/downloads) page. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes git repository](https://github.com/redis/redis-hashes).
126+
127+
Copy the tar(1) file to `/usr/src`.
128+
129+
Extract the source:
130+
131+
```bash
132+
cd /usr/src
133+
tar xvf redis.tar.gz
134+
rm redis.tar.gz
135+
```
136+
137+
## 5. Build Redis
138+
139+
Enable the GCC toolset and build Redis with support for TLS and modules:
140+
141+
```bash
142+
source /etc/profile.d/gcc-toolset-13.sh
143+
cd /usr/src/redis
144+
145+
export BUILD_TLS=yes
146+
export BUILD_WITH_MODULES=yes
147+
export INSTALL_RUST_TOOLCHAIN=yes
148+
export DISABLE_WERRORS=yes
149+
150+
make -j "$(nproc)" all
151+
sudo make install
152+
```
153+
154+
## 6. (Optional) Verify the installation
155+
156+
Check the installed Redis server and CLI versions:
157+
158+
```bash
159+
redis-server --version
160+
redis-cli --version
161+
```
162+
163+
## 7. Start Redis
164+
165+
To start Redis, use the following command:
166+
167+
```bash
168+
redis-server /path/to/redis.conf
169+
```
170+
171+
To validate that the available modules have been installed, run the [`INFO`]{{< relref "/commands/info" >}} command and look for lines similar to the following:
172+
173+
```
174+
redis-cli INFO
175+
...
176+
# Modules
177+
module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
178+
module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors]
179+
module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[]
180+
module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors]
181+
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
182+
module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
183+
...
184+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
linkTitle: AlmaLinux/Rocky 9.5
8+
title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 9.5
9+
weight: 10
10+
---
11+
12+
Follow the steps below to build and run Redis Open Source from its source code on a system running AlmaLinux and Rocky Linux 9.5.
13+
14+
{{< note >}}
15+
Docker images used to produce these build notes:
16+
- AlmaLinux:
17+
- almalinux:9.5
18+
- almalinux:9.5-minimal
19+
- Rocky Linux:
20+
- rockylinux/rockylinux:9.5
21+
- rockylinux/rockylinux:9.5-minimal
22+
{{< /note >}}
23+
24+
## 1. Prepare the system
25+
26+
{{< note >}}
27+
For 9.5-minimal, you'll need to install `sudo` and `dnf` as follows:
28+
29+
```bash
30+
microdnf install dnf sudo -y
31+
```
32+
33+
For 9.5 (regular), you'll need to install `sudo` as follows:
34+
35+
```bash
36+
dnf install sudo -y
37+
```
38+
{{< /note >}}
39+
40+
Enable the GoReleaser repository and install required packages:
41+
42+
```bash
43+
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF
44+
[goreleaser]
45+
name=GoReleaser
46+
baseurl=https://repo.goreleaser.com/yum/
47+
enabled=1
48+
gpgcheck=0
49+
EOF
50+
51+
sudo dnf clean all
52+
sudo dnf makecache
53+
sudo dnf update -y
54+
```
55+
56+
## 2. Install required packages
57+
58+
Install build dependencies, GCC toolset, Python, and utilities:
59+
60+
```bash
61+
sudo dnf install -y --nobest --skip-broken \
62+
pkg-config \
63+
xz \
64+
wget \
65+
which \
66+
gcc-toolset-13-gcc \
67+
gcc-toolset-13-gcc-c++ \
68+
git \
69+
make \
70+
openssl \
71+
openssl-devel \
72+
python3 \
73+
python3-pip \
74+
python3-devel \
75+
unzip \
76+
rsync \
77+
clang \
78+
curl \
79+
libtool \
80+
automake \
81+
autoconf \
82+
jq \
83+
systemd-devel
84+
```
85+
86+
Create a Python virtual environment:
87+
88+
```bash
89+
python3 -m venv /opt/venv
90+
```
91+
92+
Enable the GCC toolset:
93+
94+
```bash
95+
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh
96+
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc
97+
```
98+
99+
## 3. Install CMake
100+
101+
Install CMake version 3.25.1 manually:
102+
103+
```bash
104+
CMAKE_VERSION=3.25.1
105+
ARCH=$(uname -m)
106+
107+
if [ "$ARCH" = "x86_64" ]; then
108+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh
109+
else
110+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh
111+
fi
112+
113+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE}
114+
chmod +x ${CMAKE_FILE}
115+
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir
116+
rm ${CMAKE_FILE}
117+
118+
cmake --version
119+
```
120+
121+
## 4. Download and extract the Redis source
122+
123+
The Redis source code is available from the [Download](https://redis.io/downloads) page. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes git repository](https://github.com/redis/redis-hashes).
124+
125+
Copy the tar(1) file to `/usr/src`.
126+
127+
Extract the source:
128+
129+
```bash
130+
cd /usr/src
131+
tar xvf redis.tar.gz
132+
rm redis.tar.gz
133+
```
134+
135+
## 5. Build Redis
136+
137+
Enable the GCC toolset and compile Redis with TLS and module support:
138+
139+
```bash
140+
source /etc/profile.d/gcc-toolset-13.sh
141+
cd /usr/src/redis
142+
143+
export BUILD_TLS=yes
144+
export BUILD_WITH_MODULES=yes
145+
export INSTALL_RUST_TOOLCHAIN=yes
146+
export DISABLE_WERRORS=yes
147+
148+
make -j "$(nproc)" all
149+
sudo make install
150+
```
151+
152+
## 6. (Optional) Verify the installation
153+
154+
Check that Redis was installed successfully:
155+
156+
```bash
157+
redis-server --version
158+
redis-cli --version
159+
```
160+
161+
## 7. Start Redis
162+
163+
To start Redis, use the following command:
164+
165+
```bash
166+
redis-server /path/to/redis.conf
167+
```
168+
169+
To validate that the available modules have been installed, run the [`INFO`]{{< relref "/commands/info" >}} command and look for lines similar to the following:
170+
171+
```
172+
redis-cli INFO
173+
...
174+
# Modules
175+
module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
176+
module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors]
177+
module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[]
178+
module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors]
179+
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
180+
module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
181+
...
182+
```

0 commit comments

Comments
 (0)