Skip to content

Commit 2b3e045

Browse files
committed
Simplify documentation on Docker installations
1 parent e96f32a commit 2b3e045

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

docs/2.installation.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Installation
66
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:
77

88
- [**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-
- [**Using a Debian package (recommended)**](#debian-package): If you're deploying on Ubuntu or any other Debian based Linux distribution, then consider using this method. Configuration files, users and passwords are autogenerated.
9+
- [**Using a Debian package (recommended)**](#debian-package): If you're deploying on Ubuntu or any other Debian based Linux distribution, then consider using this method. Configuration files, users and passwords are autogenerated.
1010
- [**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!
1111
> **Note:** You might experience slightly degraded performance from the storage engine due to Docker engine's abstractions.
1212
@@ -26,9 +26,11 @@ To use native binaries you need to download a bundle which is simply a ZIP file
2626
- `skysh`: This is the Skytable shell and it provides a very helpful interactive REPL database client
2727
- `sky-bench`: This is the benchmarking tool that you can use to load test Skytable
2828
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+
2930
```bash
3031
./skyd --auth-root-password=<your root password> --auth-plugin=pwd
3132
```
33+
3234
**Replace with your own secure password!**
3335

3436
Explanation:
@@ -40,38 +42,55 @@ The server starts up at `localhost:2003` and is ready to run queries.
4042
## Debian package
4143

4244
Find the correct `*.deb` file [from the releases page](https://github.com/skytable/skytable/releases). Now simply run:
45+
4346
```sh
4447
sudo dpkg -i <file name>.deb
4548
```
49+
4650
The package will:
51+
4752
- **Generate a root password:** Watch the terminal output!
4853
- **Create a `systemd` unit**: So you can start and stop the process using `systemd` like `systemd start skyd`
4954
- **Generate a configuration**: Your configuration is stored in `/var/lib/skytable/config.yaml`. Go ahead and modify it if you need to!
5055

5156
## Docker image
5257

5358
:::info You must have docker set up!
59+
5460
- Use [this great guide from Docker](https://docs.docker.com/engine/install/) to install and get started
5561
- To be able to run `docker run` and related commands, you may need administrative privileges
5662
:::
5763

64+
### Simple setup
65+
66+
1. **Download the bundle**: To be able to run queries you need to download the bundle as described above
67+
2. **Start the container**:
68+
69+
```shell
70+
docker run -d --name skydb -p 2003:2003 skytable/skytable:latest
71+
```
72+
73+
:::tip
74+
The password for the Skytable instance on the Docker container is auto-generated Run `docker logs -f skydb` and you'll see a log
75+
message with the generated password.
76+
:::
77+
78+
### With persistence
79+
5880
1. **Download the bundle**: To be able to run queries you need to download the bundle as described above
5981
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.
6082
> **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.
61-
3. **Start the container**:
83+
3. **Create your configuration**: [Download this template file](https://raw.githubusercontent.com/skytable/skytable/next/examples/config-files/template.yaml) and place it into the directory you created. Update the password with your `root` password of choice.
84+
4. **Start the container**:
85+
6286
```shell
6387
docker run -d --name skydb \
64-
-v /home/docker-containers/skytable:/var/lib/skytable \
88+
-v $HOME/docker-containers/skytable:/var/lib/skytable \
6589
-p 2003:2003 \
6690
skytable/skytable:latest
6791
```
68-
**Replace with your own secure password!**
6992
7093
Explanation:
7194
- This starts a container with name `skydb`
72-
- 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)
95+
- 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)
7396
- 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
74-
:::tip
75-
The password for the Skytable instance on the Docker container is auto-generated Run `docker logs -f skydb` and you'll see a log
76-
message with the generated password.
77-
:::

docs/3.using-repl.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ You can read more in the [configuration](system/configuration) page.
2525
## Using the REPL
2626

2727
You will now see a welcome message and the REPL will prompt you to run something. Now is a good time to run `sysctl report status` which should just print out `(Okay)` in a cyan shade:
28+
2829
```sh
2930
> sysctl report status
3031
(Okay)
@@ -33,6 +34,7 @@ You will now see a welcome message and the REPL will prompt you to run something
3334
You can also run queries like: `inspect global` to see available global system information.
3435

3536
:::info Quick notes
37+
3638
- The REPL currently stores history in the `.sky_history` file. If you want to remove history, you can simply delete the file
3739
- The REPL will automatically parameterize queries. Don't worry about what this means; you'll learn about it ahead.
3840
- The REPL applies custom formatting to `DDL` queries. For example, even though `inspect global` returns a JSON as a string,
@@ -42,7 +44,7 @@ the REPL formats it and outputs it without quotes, to improve readability
4244

4345
## First steps
4446

45-
Skytable's data model is discussed in depth on [this page](architecture#data-model), but let us understand some basics. If you've used a SQL
47+
Skytable's data model is discussed in depth on [this page](architecture#data-model), but let us understand some basics. If you've used a SQL
4648
database, you would be used to the idea of a `database` &mdash; just like this, Skytable has `space`s. A `space` is a collection
4749
of `models` (which are like SQL's `table`s with slightly different functionality) and other containers.
4850

@@ -76,6 +78,6 @@ CREATE MODEL myspace.mymodel(username: string, password: string, notes: list { t
7678

7779
```sql
7880
INSERT INTO myspace.mymodel('sayan', 'password123', [])
79-
UPDATE myspace.mymodel SET notes += "mynewnote"
81+
UPDATE myspace.mymodel SET notes += "mynewnote" WHERE username = 'sayan'
8082
SELECT notes, password FROM myspace.mymodel WHERE username = 'sayan'
8183
```

0 commit comments

Comments
 (0)