Get Started

Standalone Mode

This mode integrates broker/storage/ETCD and other components into a single process to achieve rapid and simple deployment.

Applicable scenario: Quickly deploy LinDB test cluster using MacOS or stand-alone Linux environment to experience the basic functions of LinDB cluster.

  1. Download latest version at LinDB version release addressopen in new window;

  2. Quick start;

    Use the following command to experience the standalone mode with default configuration, you can also quickly generate the default configuration file and adjust the corresponding parameters. For more parameters, refer to.

./lind standalone run
./lind standalone -h
Run as a standalone node with embed broker, storage, etcd)

Usage:
  lind standalone [command]

Available Commands:
  init-config create a new default standalone-config
  run         run as standalone mode

Flags:
  -h, --help   help for standalone

Use "lind standalone [command] --help" for more information about a command.
  1. Aceess LinDB Admin Console at http://127.0.0.1:9000open in new window to view the overall status. For more Admin Console, refer to;

  2. At the same time, you can also query the status and data in the cluster through Lin Cli. For more Cli, please refer to;

Cluster Mode

This mode requires independent deployment of LinDB components.

Applicable scenario: production environment.

TIP

The following example use the minimum nodes of LinDB cluster to illustrate the LinDB's deployment of cluster mode.

For actual business scenarios, please picks the cluster size according to specific requirements.

IP in the following example is for reference only.

This example takes three hosts as an example. Each host is deployed with three broker/storage/ETCD components.

The host IP are as follows:

  • 192.168.1.10
  • 192.168.1.11
  • 192.168.1.12

The component deployment order is ETCD/Broker/Storage. The component information is as follows:

ComponentsConfiguration
ETCDDefault port
Default configuration
BrokerDefault port
Default configuration
StorageDefault port
Adjust the node IDs, and use the default configuration for others

1. Deploy ETCD,For more ETCD details, refer toopen in new window

2. Deploy Broker.

$ bin/lind broker
Run as a compute node with cluster mode enabled

Usage:
  lind broker [command]

Available Commands:
  init-config create a new default broker-config
  run         starts the broker

Flags:
  -h, --help   help for broker

Use "lind broker [command] --help" for more information about a command.
$ lind broker init-config
  • Edit config,such as ETCD address and others according to the actual scenario.
[coordinator]
## ETCD register namespace
namespace = "/lindb-broker"
## ETCD address
endpoints = ["http://192.168.1.10:2379","http://192.168.1.11:2379","http://192.168.1.12:2379"]
.......
  • Start Broker.
$ lind broker run --config=broker.toml

TIP

Generally, a VIP or LB may be placed in front of the broker to provide a unified entry address.

3. Deploy Storage:

$ bin/lind storage
Run as a storage node with cluster mode enabled

Usage:
  lind storage [command]

Available Commands:
  init-config create a new default storage-config
  run         starts the storage

Flags:
  -h, --help   help for storage

Use "lind storage [command] --help" for more information about a command.
$ lind storage init-config
  • Edit config,such as ETCD address and Storage Node ID according to the actual scenario.
[storage]
## broker address for storage-cluster registration
broker-endpoint = "http://192.168.1.10:9000"
.......
[coordinator]
## ETCD register namespace
namespace = "/lindb-storage"
## ETCD address
endpoints = ["http://192.168.1.10:2379","http://192.168.1.11:2379","http://192.168.1.12:2379"]
.......

## Self-Monitor details
[monitor]
## Metric Report Address (Broker Write Endpoint)
url = "http://192.168.1.19:9000/api/flat/write?db=_internal"
  • Start Storage.
$ lind storage run --config=storage.toml --myid=1

WARNING

The value of myid must be unique within the current storage cluster to indicate the uniqueness within the storage node cluster.

There are 2 ways to set myid:

  • As above, you can add the --myid=1 parameter to the start command. This method is used to set the default value of myid. If this file already exists, the parameter does not take effect, otherwise this value will be persisted into myid file;
  • Create or modify the value in the myid file under the data storage directory;

The design idea of myid is similar to that of zookeeper.

  1. Access LinDB Admin Console at http://192.168.1.10:9000open in new window The interface is used to view the overall status. For more Admin Console, please refer to;

  2. At the same time, you can also query the status and data in the cluster through Lin Cli. For more Cli, please refer to;

Compile

Scenario: development of LinDB, learn the specific code implementation of LinDB.

  1. Download Latest Codeopen in new window;
git clone https://github.com/lindb/lindb.git
  1. cd root directory
cd lindb
  1. Run Makefile.
make build

The generated binary package generated by is under the 'bin' directory.

  1. Test 'lind' of the corresponding environment under 'bin'.
❯ bin/lind-darwin

██╗     ██╗███╗   ██╗██████╗ ██████╗
██║     ██║████╗  ██║██╔══██╗██╔══██╗
██║     ██║██╔██╗ ██║██║  ██║██████╔╝
██║     ██║██║╚██╗██║██║  ██║██╔══██╗
███████╗██║██║ ╚████║██████╔╝██████╔╝
╚══════╝╚═╝╚═╝  ╚═══╝╚═════╝ ╚═════╝

LinDB is a scalable, high performance, high availability, distributed time series database.
Complete documentation is available at https://lindb.io

Usage:
  lind [command]

Available Commands:
  broker      Run as a compute node with cluster mode enabled
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  standalone  Run as a standalone node with embed broker, storage, etcd)
  storage     Run as a storage node with cluster mode enabled
  version     Print the version

Flags:
  -h, --help   help for lind

Use "lind [command] --help" for more information about a command.
  1. You can deploy as standalone or cluster mode through the compiled binary package.

Local startup from source code

Applicable scenario: development and debugging of LinDB, learn the specific code implementation of LinDB.

  1. For the source code download reference, see Source Code Compilation.

  2. Fast Run. Use the following command under the project root.

make run