linux安装siriDB 时序数据库

2022-05-06 00:00:00 数据 数据库 时序 安装 写入

linux安装siriDB_server
参考文档
时序数据库介绍
什么是时序数据库?

时序数据是基于时间的一系列的数据。在有时间的坐标中将这些数据点连成线,往过去看可以做成多纬度报表,揭示其趋势性、规律性、异常性;往未来看可以做大数据分析,机器学习,实现预测和预警。

时序数据库就是存放时序数据的数据库,并且需要支持时序数据的快速写入、持久化、多纬度的聚合查询等基本功能。

对比传统数据库仅仅记录了数据的当前值,时序数据库则记录了所有的历史数据。同时时序数据的查询也总是会带上时间作为过滤条件

时序数据库需要解决以下几个问题:

时序数据的写入:如何支持每秒钟上千万上亿数据点的写入。

时序数据的读取:又如何支持在秒级对上亿数据的分组聚合运算。

成本敏感:由海量数据存储带来的是成本问题。如何更低成本的存储这些数据,将成为时序数据库需要解决的重中之重

安装环境
Ubuntu 16.04及其以上。
预安装软件
apt install libexpat1 libuv1 libpcre2-8-0 libcleri0
1
libcleri0 Ubuntu 18.04提供了库,对于较旧的版本,可以在这里找到deb软件包:

https://github.com/transceptor-technology/libcleri/releases/latest

# ubuntu 18.04
sudo apt install libcleri-dev

sudo apt install libpcre2-dev
sudo apt install libuv1-dev
sudo apt install libyajl-dev
sudo apt install uuid-dev
1
2
3
4
5
6
7
编译(replace Release with Debug for a debug build)
git clone https://github.com/SiriDB/siridb-server.git
cd siridb-server/Release
make clean
make test
make
1
2
3
4
5
安装
sudo make install
1
运行
配置文件在 /etc/siridb 目录下。
配置文件siridb.conf
# Welcome to the SiriDB configuration file

[siridb]
#
# SiriDB will use this address:port for it's back-end connections.
# This must be an address that other servers can use to connect to.
# For example IPv4, IPv6 or a fqdn are all possible. When using IPv6 be sure
# to wrap the ip address with square brackets. For example [::1]:9010
# The default value is %HOSTNAME:9010. The variable %HOSTNAME will be translate
# to the systems host name.
#
server_name = %HOSTNAME:9010

#
# Listen for SiriDB-server connections only on localhost.
# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
#
bind_server_address = 127.0.0.1

#
# SiriDB will listen for client connections on this port number.
#
listen_client_port = 9000

#
# Listen for client connections only on localhost.
# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces.
#
bind_client_address = 127.0.0.1

#
# When ip_support is set to ALL, SiriDB will listen and connect to both IPv4
# and IPv6 addresses.
# Valid options are ALL, IPV4ONLY and IPV6ONLY.
#
ip_support = ALL

#
# SiriDB will load databases from, and create databases in this location.
#
default_db_path = /var/lib/siridb

#
# SiriDB will run an optimize task each X seconds. A value of 0 (zero) disables
# optimizing.
#
optimize_interval = 3600

#
# SiriDB uses a heart-beat interval to keep connections with other servers
# online.
#
heartbeat_interval = 30

#
# SiriDB can run fsync on the buffer file on an interval in milliseconds.
# This value is set to 0 by default which tells SiriDB to run fsync after
# each insert request. When having many insert requests per second, it can be
# useful to use an interval like 500 milliseconds.
#
#buffer_sync_interval = 500
buffer_sync_interval = 0

#
# SiriDB will not open more shard files than max_open_files. Note that the
# total number of open files can be sligtly higher since SiriDB also needs
# a few other files to write to.
#
max_open_files = 32768

#
# Use shard compression for storing data points.
# Set value 0 to disable shard compression.
#
enable_shard_compression = 1

#
# Enable named pipe support for client connections.
#
enable_pipe_support = 0

#
# SiriDB will bind the client named pipe in this location.
#
pipe_client_name = siridb_client.sock

#
# 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.
# Otherwise the HTTP POST requests can be user to insert or query data points.
#
http_api_port = 9020
#http_api_port = 0

启动siridb-server
# 直接启动
siridb-server -c siridb.conf
# 后台启动日志信息打印到siridb.log
siridb-server -c siridb.conf >siridb.log &
————————————————
版权声明:本文为CSDN博主「小胖_@」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_45459224/article/details/106719819

相关文章