GithubHelp home page GithubHelp logo

Comments (4)

joente avatar joente commented on August 30, 2024

@eleleme, The basic idea is to create a database on the first server and create pools on the other servers.

To do this, you can use siridb admin which uses the siridb socket connection (default port 9000) and provides a graphical user interface. It is also possible to use plain HTTP API requests if you have this enabled on your siridb servers.

For example, we could use the HTTP API and create the following using curl requests:

  • A database sampledb with second time precision.
  • Three pools:
    • Pool 0: running on host: "siridb0"
    • Pool 1: running on host: "siridb1"
    • Pool 2: running on host: "siridb2"
  • Assume that the accounts are left to the default (service account sa with password siri and database user iris with password siri).
  • Assume that the siridb hosts are listening to 9000 for client connections (this is default) and 9020 for HTTP API request (SIRIDB_HTTP_API_PORT must be set to 9020).

Create the database on host siridb0

curl --location --request POST 'http://siridb0:9020/new-database' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"dbname": "sampledb",
	"time_precision": "s",
}'

Create another pool on host siridb1

curl --location --request POST 'http://siridb1:9020/new-pool' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"dbname": "sampledb",
	"username": "iris",
	"password": "siri",
	"host": "siridb0",
    "port": 9000
}'

And yet another pool on host siridb2

curl --location --request POST 'http://siridb2:9020/new-pool' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"dbname": "sampledb",
	"username": "iris",
	"password": "siri",
	"host": "siridb0",
	"port": 9000
}'

from siridb-server.

kimboox44 avatar kimboox44 commented on August 30, 2024

What about replica in same host, documentation mention single pool may have 2 servers (replica) how to set that ?

from siridb-server.

joente avatar joente commented on August 30, 2024

@kimboox44 , hope this will answer your question:

Suppose you want to run two servers in pool 0, and host siridb0 is the first server hosting pool 0, we could add a replica on host siridb1 with the following command:

curl --location --request POST 'http://siridb1:9020/new-replica' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
	"dbname": "sampledb",
        "username": "iris",
        "password": "siri",
        "host": "siridb0",
        "port": 9000,
        "pool": 0
}'

If you want a second server on the same host, then the second server must use different ports. For example:

SIRIDB_SERVER_NAME = %HOSTNAME:9011
SIRIDB_LISTEN_CLIENT_PORT = 9001
SIRIDB_HTTP_API_PORT = 9021

from siridb-server.

kimboox44 avatar kimboox44 commented on August 30, 2024

Did exactly that (same host) in admin
logged to server0 -> create database -> "rts_siri"
logged to server0 ->databases->db0->new pool give error "database name already exists: 'rts_siri'"
logged to server1-> databases->new replica-> same error "database name already exists: 'rts_siri'"
changed folder path of server1 same
logged to server1-> databases->new replica-> same error "database name already exists: 'rts_siri'"
logged to server1-> databases->new pool-> same error "database name already exists: 'rts_siri'"
logged to server0-> databases->new pool-> same error "database name already exists: 'rts_siri'"

think i get why, when creating
new-pool on server1 it creates a folder rts_siri
with same name, also when attempting to add replica it tries same name (in your example sampledb) says folder exists

when adding adding replica should we create pool in server1? or one of the 2 operations only is possible (either add-replica or add-pool) not both

i think a chart explaining the system architecture would help alot of adopters, it's confusing (except for the one who designed it)

from siridb-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.