|
| 1 | +--- |
| 2 | +id: installation |
| 3 | +title: Installation |
| 4 | +--- |
| 5 | + |
| 6 | +Getting started with Skytable involves choosing a mode of installation, downloading any required files and then starting up the database. You can choose to either use: |
| 7 | + |
| 8 | +- [**Native binaries (recommended)**](#native-binaries): This is what is generally recommended for the best performance. You will need to download a bundle and then start the server binary; no expert knowledge required |
| 9 | +- [**A Docker image**](#docker-image): We generally recommend using a Docker image for experimenting with Skytable on your local system during development and you want to keep your local system *clean*. If you want to use a Docker image for deployment, you're always free to do so! |
| 10 | + > **Note:** You might experience slightly degraded performance from the storage engine due to Docker engine's abstractions. |
| 11 | +
|
| 12 | + |
| 13 | +## Native binaries |
| 14 | + |
| 15 | +:::info |
| 16 | +Your operating system might sometimes not let you run binaries directly. On Unix based systems, you'll need to run: `chmod +x skyd skysh sky-bench`. |
| 17 | + |
| 18 | +And on Windows systems you might need to right-click on the binaries and click on "unblock" |
| 19 | +::: |
| 20 | + |
| 21 | +To use native binaries you need to download a bundle which is simply a ZIP file with all the necessary binaries that you'll ever need to develop on and deploy Skytable. |
| 22 | + |
| 23 | +1. **First download the latest bundle** for your platform. You can find [download links on the releases page](https://github.com/skytable/skytable/releases). |
| 24 | +2. **Unzip the ZIP file**. You'll find the following binaries in the extracted archive: |
| 25 | + - `skyd`: This is the database server binary which when started runs as a daemon, serving requests |
| 26 | + - `skysh`: This is the Skytable shell and it provides a very helpful interactive REPL database client |
| 27 | + - `sky-bench`: This is the benchmarking tool that you can use to load test Skytable |
| 28 | +3. **Start up the server**. You need to choose a `root` password for the `root` account which will have complete control over the database. |
| 29 | + ```bash |
| 30 | + ./skyd --auth-root-password=<your root password> --auth-plugin=pwd |
| 31 | + ``` |
| 32 | + **Replace with your own secure password!** |
| 33 | + |
| 34 | + Explanation: |
| 35 | + - `--auth-root-password`: sets the root password |
| 36 | + - `--auth-plugin`: sets the authentication plugin to `pwd` which is a simple password based authentication system |
| 37 | + |
| 38 | +The server starts up at `localhost:2003` and is ready to run queries. |
| 39 | + |
| 40 | +## Docker image |
| 41 | + |
| 42 | +:::info You must have docker set up! |
| 43 | +- Use [this great guide from Docker](https://docs.docker.com/engine/install/) to install and get started |
| 44 | +- To be able to run `docker run` and related commands, you may need administrative privileges |
| 45 | +::: |
| 46 | + |
| 47 | +1. **Download the bundle**: To be able to run queries you need to download the bundle as described above |
| 48 | +2. **Create the data directory**: To ensure that our database is persistent and all our data doesn't vanish as soon as the container is terminated, we'll map the data directory to an actual directory on our local system. |
| 49 | + > **Note:** Create a folder called `skytable` in a convenient location. We recommend having a directory in `$HOME/docker-containers` where you can store the Skytable container's data and any other containers that you might use. It's a great way to keep things organized. |
| 50 | +3. **Start the container**: |
| 51 | + ```shell |
| 52 | + docker run -d --name skydb \ |
| 53 | + -v /home/docker-containers/skytable:/var/skytable \ |
| 54 | + -p 2003:2003 \ |
| 55 | + -e SKYDB_AUTH_ROOT_PASSWORD=<your root password> \ |
| 56 | + -e SKYDB_AUTH_PLUGIN=pwd skytable/skytable:latest |
| 57 | + ``` |
| 58 | + **Replace with your own secure password!** |
| 59 | + |
| 60 | + Explanation: |
| 61 | + - This starts a container with name `skydb` |
| 62 | + - It maps the folder (as discussed earlier) `/home/docker-containers/skytable` from your local file system to `/var/skytable` (in the container's file system) |
| 63 | + - Maps port `2003` on the host to the containers port `2003` so that you can use the command-line client `skysh` without having to inspect the container's IP address |
| 64 | + - Set's some basic configuration: |
| 65 | + - `SKYDB_AUTH_ROOT_PASSWORD`: sets the root password. you can't use Skytable without a `root` account |
| 66 | + - `SKYDB_AUTH_PLUGIN`: this sets the authentication plugin to `pwd` which is the simplest authentication plugin |
| 67 | + |
0 commit comments