2022-06-10 13:30:05 +00:00
|
|
|
# Build DragonflyDB From Source
|
|
|
|
|
|
|
|
## Running the server
|
|
|
|
|
2023-10-03 13:05:04 +00:00
|
|
|
Dragonfly runs on linux. We advise running it on linux version 5.11 or later
|
2022-10-04 08:11:09 +00:00
|
|
|
but you can also run Dragonfly on older kernels as well.
|
2022-06-10 13:30:05 +00:00
|
|
|
|
2023-06-12 09:56:07 +00:00
|
|
|
> :warning: **Dragonfly releases are compiled with LTO (link time optimization)**:
|
|
|
|
Depending on the workload this can notably improve performance. If you want to
|
|
|
|
benchmark Dragonfly or use it in production, you should enable LTO by giving
|
|
|
|
`blaze.sh` the `-DCMAKE_CXX_FLAGS="-flto"` argument.
|
2022-06-10 13:30:05 +00:00
|
|
|
|
2023-02-20 15:16:52 +00:00
|
|
|
## Step 1 - install dependencies
|
2022-06-10 13:30:05 +00:00
|
|
|
|
2023-02-20 15:16:52 +00:00
|
|
|
On Debian/Ubuntu:
|
2022-06-10 13:30:05 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo apt install ninja-build libunwind-dev libboost-fiber-dev libssl-dev \
|
2023-09-06 12:06:38 +00:00
|
|
|
autoconf-archive libtool cmake g++ libzstd-dev bison libxml2-dev
|
2022-06-10 13:30:05 +00:00
|
|
|
```
|
|
|
|
|
2023-02-20 15:16:52 +00:00
|
|
|
On Fedora:
|
|
|
|
|
|
|
|
```bash
|
2023-09-06 06:35:11 +00:00
|
|
|
sudo dnf install -y automake boost-devel g++ git cmake libtool ninja-build libzstd-devel \
|
2023-10-26 16:04:56 +00:00
|
|
|
openssl-devel libunwind-devel autoconf-archive patch bison libxml2-devel libstdc++-static
|
2023-02-20 15:16:52 +00:00
|
|
|
```
|
|
|
|
|
2023-07-24 12:47:10 +00:00
|
|
|
On openSUSE:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo zypper install automake boost-devel gcc-c++ git cmake libtool ninja libzstd-devel \
|
2023-09-06 12:06:38 +00:00
|
|
|
openssl-devel libunwind-devel autoconf-archive patch bison libxml2-devel \
|
2023-07-24 12:47:10 +00:00
|
|
|
libboost_context-devel libboost_system-devel
|
|
|
|
```
|
|
|
|
|
2023-02-20 15:16:52 +00:00
|
|
|
## Step 2 - clone the project
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone --recursive https://github.com/dragonflydb/dragonfly && cd dragonfly
|
|
|
|
```
|
|
|
|
|
|
|
|
## Step 3 - configure & build it
|
2022-06-10 13:30:05 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# Configure the build
|
|
|
|
./helio/blaze.sh -release
|
|
|
|
|
|
|
|
# Build
|
|
|
|
cd build-opt && ninja dragonfly
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2023-02-20 15:16:52 +00:00
|
|
|
## Step 4 - voilà
|
|
|
|
|
2022-06-10 13:30:05 +00:00
|
|
|
```bash
|
|
|
|
# Run
|
|
|
|
./dragonfly --alsologtostderr
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Dragonfly DB will answer to both `http` and `redis` requests out of the box!
|
|
|
|
|
|
|
|
You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379`
|
|
|
|
|
|
|
|
## Step 5
|
|
|
|
|
|
|
|
Connect with a redis client
|
|
|
|
|
|
|
|
```bash
|
|
|
|
redis-cli
|
|
|
|
127.0.0.1:6379> set hello world
|
|
|
|
OK
|
|
|
|
127.0.0.1:6379> keys *
|
|
|
|
1) "hello"
|
|
|
|
127.0.0.1:6379> get hello
|
|
|
|
"world"
|
2022-10-04 08:11:09 +00:00
|
|
|
127.0.0.1:6379>
|
2022-06-10 13:30:05 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Step 6
|
|
|
|
|
2022-10-31 15:45:48 +00:00
|
|
|
Continue being great and build your app with the power of DragonflyDB!
|