apiVersion: apps/v1
kind: StatefulSet
metadata:
- name: thingsdb
+ name: siridb
labels:
- app: thingsdb
+ app: siridb
spec:
selector:
matchLabels:
- app: thingsdb
- serviceName: thingsdb
- replicas: 2
+ app: siridb
+ serviceName: siridb
+ replicas: 12
updateStrategy:
type: RollingUpdate
podManagementPolicy: Parallel
template:
metadata:
labels:
- app: thingsdb
+ app: siridb
spec:
- terminationGracePeriodSeconds: 90
+ terminationGracePeriodSeconds: 120
dnsConfig:
searches:
- - thingsdb.default.svc.cluster.local
+ - siridb.default.svc.cluster.local
containers:
- - name: thingsdb
- image: thingsdb/node:gcloud-v0.9.19
+ - name: siridb
+ image: siridb/siridb/siridb-server:2.0.40
imagePullPolicy: Always
- args: ["--deploy"]
env:
- name: SIRIDB_HTTP_STATUS_PORT
value: "8080"
- name: SIRIDB_HTTP_API_PORT
- value: "80"
+ value: "9080"
- name: SIRIDB_ENABLE_SHARD_COMPRESSION
value: "1"
+ - name: SIRIDB_ENABLE_SHARD_AUTO_DURATION
+ value: "1"
- name: SIRIDB_BUFFER_SYNC_INTERVAL
value: "500"
- name: SIRIDB_DEFAULT_DB_PATH
- value: /mnt/thingsdb/
+ value: /mnt/siridb/
- name: SIRIDB_BIND_SERVER_ADDRESS
value: "0.0.0.0"
- name: SIRIDB_BIND_CLIENT_ADDRESS
- name: status
containerPort: 8080
- name: client
- containerPort: 9200
+ containerPort: 9000
- name: http
- containerPort: 9210
- - name: node
- containerPort: 9220
+ containerPort: 9080
+ - name: server
+ containerPort: 9010
volumeMounts:
- name: data
mountPath: /mnt/siridb/
resources:
requests:
- memory: 100M
+ memory: 100M # For example, 3Gi for large data sets
livenessProbe:
httpGet:
path: /healthy
port: 8080
- periodSeconds: 10
- timeoutSeconds: 5
+ periodSeconds: 20
+ timeoutSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
- initialDelaySeconds: 5
- periodSeconds: 10
- timeoutSeconds: 2
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ timeoutSeconds: 10
volumeClaimTemplates:
- metadata:
name: data
accessModes: ["ReadWriteOnce"]
resources:
requests:
- storage: 20Gi
+ storage: 200Mi # For example, 300Gi for large data sets
apk add pcre2 libuv libuuid yajl && \
mkdir -p /etc/siridb && \
mkdir -p /var/lib/siridb
-COPY --from=0 /tmp/siridb-server/siridb.conf /etc/siridb/siridb.conf
COPY --from=0 /tmp/siridb-server/Release/siridb-server /usr/local/bin/
COPY --from=0 /usr/lib/libcleri* /usr/lib/
-# Configuration
-VOLUME ["/etc/siridb"] # config
# Data
VOLUME ["/var/lib/siridb/"]
-# Client connections
+# Client (Socket) connections
EXPOSE 9000
-# back-end connections
+# Server (Socket) connections
EXPOSE 9010
+# Client (HTTP) connections
+EXPOSE 9080
+# Status connection
+EXPOSE 8080
+
+# Overwrite default configuration parameters
+ENV SIRIDB_BIND_SERVER_ADDRESS 0.0.0.0
+ENV SIRIDB_BIND_CLIENT_ADDRESS 0.0.0.0
+ENV SIRIDB_HTTP_API_PORT 9080
+ENV SIRIDB_HTTP_STATUS_PORT 8080
+ENV SIRIDB_ENABLE_SHARD_COMPRESSION 1
+ENV SIRIDB_ENABLE_SHARD_AUTO_DURATION 1
+ENV SIRIDB_BUFFER_SYNC_INTERVAL 500
+
ENTRYPOINT ["/usr/local/bin/siridb-server"]
enable_shard_compression = 1
#
-# Let SiriDB control shard duration when possible. When enabled, the configured
-# shard duration fot both number and log values are still used when SiriDB is
-# not able to detect a sensible duration.
+# Let SiriDB control shard duration when possible. When enabled, the configured
+# shard duration for both number and log values will still be used when SiriDB
+# is not able to detect a sensible duration.
#
enable_shard_auto_duration = 1
pipe_client_name = siridb_client.sock
#
-# When the HTTP status port is not set (or 0), the service will not start.
+# When the HTTP status port is not set (or 0), the service will not start.
# Otherwise the HTTP requests `/status`, `/ready` and `/healthy` are available
# which can be used for readiness and liveness requests.
-#
+#
# Example usage using wget:
-#
+#
# wget -q -O - http://siridb-server.local:8080/status
#
#http_status_port = 8080
http_status_port = 0
#
-# When the HTTP API port is not set (or 0), the API service will not start.
+# When the HTTP API port is not set (or 0), the API service will not start.
# Otherwise the HTTP POST requests can be user to insert or query data points.
#
#http_api_port = 9020
if (!strlen(address) || strlen(address) >= SIRI_CFG_MAX_LEN_ADDRESS)
{
- log_critical("error: got an unexpected address value '%s'.", s);
+ log_error("error: got an unexpected address value '%s'.", s);
return -1;
}
hostname,
SIRI_CFG_MAX_LEN_ADDRESS))
{
- log_critical("error: memory allocation while copying address");
+ log_critical("memory allocation while copying address");
return -1;
}
test_port = atoi(strport);
if (test_port < 1 || test_port > 65535)
{
- log_critical(
+ log_error(
"error: port should be between 1 and 65535, got '%d'.",
test_port);
return -1;