Comments (4)
@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.
What about replica in same host, documentation mention single pool may have 2 servers (replica) how to set that ?
from siridb-server.
@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.
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)
- Possible endless loop on point insert HOT 2
- Database cannot be loaded after power outage due to duplicate values in series.dat HOT 2
- Is there any data compression method? HOT 5
- Configuration variable `server_name` should use the default port when omitted HOT 1
- Kubernetes compatibility HOT 1
- Change SIRIDB_DEFAULT_DB_PATH to SIRIDB_DB_PATH HOT 1
- Server stuck in libuv HOT 5
- Question. Time series model and query. HOT 2
- Possible memory corruption HOT 7
- HTTP Pipelining issue in embedded api service HOT 17
- Confused about database duration and shards expiration HOT 4
- Improve the internal mapping to use less memory HOT 1
- Writes being blocked during complex query HOT 2
- Update siridb to work with libcleri 1.x
- Simple insert HOT 4
- Drop dulicate values
- Error when adding to pool HOT 2
- Disk Failure HOT 2
- Support for Encrypted Connections HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siridb-server.