-
Notifications
You must be signed in to change notification settings - Fork 209
DEV: add build from source procedures #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
09a6c16
DEV: add build from source procedures
dwdougherty 56c516d
Apply review comments; added AlmaLinux and Ubuntu (Focal) pages
dwdougherty 7888116
Apply review comments; merged alma/rocky pages; added stubs for macOS
dwdougherty 29b55ac
Added macOS 13/14 page
dwdougherty 84a2dec
Apply code review comments and issues found whilst testing
dwdougherty f8ca1ef
Bug fix
dwdougherty b416dea
Change titles per Lior
dwdougherty 7ed8541
Remove bash requirement from alma/rocky; it's already there
dwdougherty 21013c0
Remove banner as instructs are complete
dwdougherty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
content/operate/oss_and_stack/install/build-stack/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
categories: | ||
- docs | ||
- operate | ||
- stack | ||
- oss | ||
description: Build and run Redis Open Source on Linux and macOS | ||
linkTitle: Build and run Redis Open Source | ||
stack: true | ||
title: Build and run Redis Open Source | ||
weight: 20 | ||
--- | ||
|
||
Build instructions are provided for the following platforms: |
184 changes: 184 additions & 0 deletions
184
content/operate/oss_and_stack/install/build-stack/almalinux-rocky-8.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
--- | ||
categories: | ||
- docs | ||
- operate | ||
- stack | ||
- oss | ||
linkTitle: AlmaLinux/Rocky 8.10 | ||
title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 8.10 | ||
weight: 5 | ||
--- | ||
|
||
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. | ||
|
||
{{< note >}} | ||
Docker images used to produce these build notes: | ||
- AlmaLinux: | ||
- almalinux:8.10 | ||
- almalinux:8.10-minimal | ||
- Rocky Linux: | ||
- rockylinux/rockylinux:8.10 | ||
- rockylinux/rockylinux:8.10-minimal | ||
{{< /note >}} | ||
|
||
## 1. Prepare the system | ||
|
||
{{< note >}} | ||
For 8.10-minimal, you'll need to install `sudo` and `dnf` as follows: | ||
|
||
```bash | ||
microdnf install dnf sudo -y | ||
``` | ||
|
||
For 8.10 (regular), you'll need to install `sudo` as follows: | ||
|
||
```bash | ||
dnf install sudo -y | ||
``` | ||
{{< /note >}} | ||
|
||
Clean the package metadata, enable required repositories, and install development tools: | ||
|
||
```bash | ||
sudo dnf clean all | ||
|
||
# Add GoReleaser repo | ||
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF | ||
[goreleaser] | ||
name=GoReleaser | ||
baseurl=https://repo.goreleaser.com/yum/ | ||
enabled=1 | ||
gpgcheck=0 | ||
EOF | ||
|
||
sudo dnf update -y | ||
sudo dnf groupinstall "Development Tools" -y | ||
sudo dnf config-manager --set-enabled powertools | ||
sudo dnf install -y epel-release | ||
``` | ||
|
||
## 2. Install required packages | ||
|
||
Install the build dependencies, Python 3.11, and supporting tools: | ||
|
||
```bash | ||
sudo dnf install -y --nobest --skip-broken \ | ||
pkg-config \ | ||
wget \ | ||
gcc-toolset-13-gcc \ | ||
gcc-toolset-13-gcc-c++ \ | ||
git \ | ||
make \ | ||
openssl \ | ||
openssl-devel \ | ||
python3.11 \ | ||
python3.11-pip \ | ||
python3.11-devel \ | ||
unzip \ | ||
rsync \ | ||
clang \ | ||
curl \ | ||
libtool \ | ||
automake \ | ||
autoconf \ | ||
jq \ | ||
systemd-devel | ||
``` | ||
|
||
Create a Python virtual environment: | ||
|
||
```bash | ||
python3.11 -m venv /opt/venv | ||
``` | ||
|
||
Enable the GCC toolset: | ||
|
||
```bash | ||
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh | ||
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc | ||
``` | ||
|
||
## 3. Install CMake | ||
|
||
Install CMake 3.25.1 manually: | ||
|
||
```bash | ||
CMAKE_VERSION=3.25.1 | ||
ARCH=$(uname -m) | ||
|
||
if [ "$ARCH" = "x86_64" ]; then | ||
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh | ||
else | ||
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh | ||
fi | ||
|
||
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE} | ||
chmod +x ${CMAKE_FILE} | ||
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir | ||
rm ${CMAKE_FILE} | ||
|
||
cmake --version | ||
``` | ||
|
||
## 4. Download and extract the Redis source | ||
|
||
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). | ||
|
||
Copy the tar(1) file to `/usr/src`. | ||
|
||
Extract the source: | ||
|
||
```bash | ||
cd /usr/src | ||
tar xvf redis.tar.gz | ||
rm redis.tar.gz | ||
``` | ||
|
||
## 5. Build Redis | ||
|
||
Enable the GCC toolset and build Redis with support for TLS and modules: | ||
|
||
```bash | ||
source /etc/profile.d/gcc-toolset-13.sh | ||
cd /usr/src/redis | ||
|
||
export BUILD_TLS=yes | ||
export BUILD_WITH_MODULES=yes | ||
export INSTALL_RUST_TOOLCHAIN=yes | ||
export DISABLE_WERRORS=yes | ||
|
||
make -j "$(nproc)" all | ||
sudo make install | ||
``` | ||
|
||
## 6. (Optional) Verify the installation | ||
|
||
Check the installed Redis server and CLI versions: | ||
|
||
```bash | ||
redis-server --version | ||
redis-cli --version | ||
``` | ||
|
||
## 7. Start Redis | ||
|
||
To start Redis, use the following command: | ||
|
||
```bash | ||
redis-server /path/to/redis.conf | ||
dwdougherty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
To validate that the available modules have been installed, run the [`INFO`]{{< relref "/commands/info" >}} command and look for lines similar to the following: | ||
|
||
``` | ||
redis-cli INFO | ||
... | ||
# Modules | ||
module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors] | ||
module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors] | ||
module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[] | ||
module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors] | ||
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[] | ||
module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[] | ||
... | ||
``` |
182 changes: 182 additions & 0 deletions
182
content/operate/oss_and_stack/install/build-stack/almalinux-rocky-9.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
--- | ||
categories: | ||
- docs | ||
- operate | ||
- stack | ||
- oss | ||
linkTitle: AlmaLinux/Rocky 9.5 | ||
title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 9.5 | ||
weight: 10 | ||
--- | ||
|
||
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. | ||
|
||
{{< note >}} | ||
Docker images used to produce these build notes: | ||
- AlmaLinux: | ||
- almalinux:9.5 | ||
- almalinux:9.5-minimal | ||
- Rocky Linux: | ||
- rockylinux/rockylinux:9.5 | ||
- rockylinux/rockylinux:9.5-minimal | ||
{{< /note >}} | ||
|
||
## 1. Prepare the system | ||
|
||
{{< note >}} | ||
For 9.5-minimal, you'll need to install `sudo` and `dnf` as follows: | ||
|
||
```bash | ||
microdnf install dnf sudo -y | ||
``` | ||
|
||
For 9.5 (regular), you'll need to install `sudo` as follows: | ||
|
||
```bash | ||
dnf install sudo -y | ||
``` | ||
{{< /note >}} | ||
|
||
Enable the GoReleaser repository and install required packages: | ||
|
||
```bash | ||
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF | ||
[goreleaser] | ||
name=GoReleaser | ||
baseurl=https://repo.goreleaser.com/yum/ | ||
enabled=1 | ||
gpgcheck=0 | ||
EOF | ||
|
||
sudo dnf clean all | ||
sudo dnf makecache | ||
sudo dnf update -y | ||
``` | ||
|
||
## 2. Install required packages | ||
|
||
Install build dependencies, GCC toolset, Python, and utilities: | ||
|
||
```bash | ||
sudo dnf install -y --nobest --skip-broken \ | ||
pkg-config \ | ||
xz \ | ||
wget \ | ||
which \ | ||
gcc-toolset-13-gcc \ | ||
gcc-toolset-13-gcc-c++ \ | ||
git \ | ||
make \ | ||
openssl \ | ||
openssl-devel \ | ||
python3 \ | ||
python3-pip \ | ||
python3-devel \ | ||
unzip \ | ||
rsync \ | ||
clang \ | ||
curl \ | ||
libtool \ | ||
automake \ | ||
autoconf \ | ||
jq \ | ||
systemd-devel | ||
``` | ||
|
||
Create a Python virtual environment: | ||
|
||
```bash | ||
python3 -m venv /opt/venv | ||
``` | ||
|
||
Enable the GCC toolset: | ||
|
||
```bash | ||
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh | ||
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc | ||
``` | ||
|
||
## 3. Install CMake | ||
|
||
Install CMake version 3.25.1 manually: | ||
|
||
```bash | ||
CMAKE_VERSION=3.25.1 | ||
ARCH=$(uname -m) | ||
|
||
if [ "$ARCH" = "x86_64" ]; then | ||
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh | ||
else | ||
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh | ||
fi | ||
|
||
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE} | ||
chmod +x ${CMAKE_FILE} | ||
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir | ||
rm ${CMAKE_FILE} | ||
|
||
cmake --version | ||
``` | ||
|
||
## 4. Download and extract the Redis source | ||
|
||
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). | ||
|
||
Copy the tar(1) file to `/usr/src`. | ||
|
||
Extract the source: | ||
|
||
```bash | ||
cd /usr/src | ||
tar xvf redis.tar.gz | ||
rm redis.tar.gz | ||
``` | ||
|
||
## 5. Build Redis | ||
|
||
Enable the GCC toolset and compile Redis with TLS and module support: | ||
|
||
```bash | ||
source /etc/profile.d/gcc-toolset-13.sh | ||
cd /usr/src/redis | ||
|
||
export BUILD_TLS=yes | ||
export BUILD_WITH_MODULES=yes | ||
export INSTALL_RUST_TOOLCHAIN=yes | ||
export DISABLE_WERRORS=yes | ||
|
||
make -j "$(nproc)" all | ||
sudo make install | ||
``` | ||
|
||
## 6. (Optional) Verify the installation | ||
|
||
Check that Redis was installed successfully: | ||
|
||
```bash | ||
redis-server --version | ||
redis-cli --version | ||
``` | ||
|
||
## 7. Start Redis | ||
|
||
To start Redis, use the following command: | ||
|
||
```bash | ||
redis-server /path/to/redis.conf | ||
``` | ||
|
||
To validate that the available modules have been installed, run the [`INFO`]{{< relref "/commands/info" >}} command and look for lines similar to the following: | ||
|
||
``` | ||
redis-cli INFO | ||
... | ||
# Modules | ||
module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors] | ||
module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors] | ||
module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[] | ||
module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors] | ||
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[] | ||
module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[] | ||
... | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.