Running YDB from a binary file

This section describes how to deploy a local YDB cluster using a compiled binary file. Currently, the system only supports builds for Linux. Support for Windows and MacOS builds will be added later.

Connection parameters

As a result of completing the steps below, you’ll get a YDB database running on a local machine that you can connect to using the following:

Installation

Create a working directory. Run the script for downloading an archive with the ydbd executable file and the necessary YDB libraries, and a set of scripts and auxiliary files for starting and stopping the server:

  1. curl https://binaries.ydb.tech/local_scripts/install.sh | bash

Binary file - 图1

Starting

The local YDB server can be started in two modes:

Storing data on disk

Storing data in memory

  • To store data on disk, when running the script for the first time, a 64 GB file named ydb.data is created in the working directory. Make sure you have enough free space to create it.

  • Run the following command from the working directory:

    1. ./start.sh disk

    Binary file - 图2

  • When using in-memory data storage, the data is lost when stopping the server.

  • Run the following command from the working directory:

    1. ./start.sh ram

    Binary file - 图3

The YDB server is started in the context of the current terminal window. Closing the terminal window stops the server.

If you get an error saying Failed to set up IC listener on port 19001 errno# 98 (Address already in use) at startup, the server might have already been started and you should stop it with the stop.sh script (see below).

Stopping

To stop the server, run the following command in the working directory:

  1. ./stop.sh

Binary file - 图4

Making queries via the YDB CLI

Install the YDB CLI and execute queries as described in YDB CLI - Getting started using the endpoint and database location specified at the beginning of this article. For example:

  1. ydb -e grpc://localhost:2136 -d /Root/test scheme ls

Binary file - 图5

Working with the database via the Web UI

To work with the DB structure and data, you can also use the web interface embedded in the ydbd process. It is available at http://localhost:8765. For more information about the embedded web interface, see Embedded UI.

Additional information

Instructions for administrators on how to deploy clusters from multiple nodes and configure them are given in Deploy YDB on-premises in the “Administration” section.