# Installation

Please Download release package. Default account: admin/admin.

To understand properties when install, please learn Monitor first.

# Standalone

  • Java enviroment required, please install jdk8+ on your machine first, and configure enviroment variable
  • Download release package and unpack
  • Modify configurations below of conf/application.properties file
# api context
dbapi.api.context=api


# metadata database address, you can use your own mysql or default embedded sqlite
spring.datasource.dynamic.datasource.meta-db.driver-class-name=org.sqlite.JDBC
spring.datasource.dynamic.datasource.meta-db.url=jdbc:sqlite::resource:sqlite.db
spring.datasource.dynamic.datasource.meta-db.username=
spring.datasource.dynamic.datasource.meta-db.password=

# the writer to write access log to database, value can be null/db/kafka
# "db" means dbapi writes access log to database directly
# "kafka" means dbapi writes access log to kafka, you need to collect log from kafka to log database yourself
# "null" means dbapi only writes access log to disk file(logs/dbapi-access.log), you need to collect log from disk to log database yourself
access.log.writer=null

# access log database(recommend clickhouse) address. If you do not need monitor function in web UI, the properties no need
spring.datasource.dynamic.datasource.access-log-db.driver-class-name=ru.yandex.clickhouse.ClickHouseDriver
spring.datasource.dynamic.datasource.access-log-db.url=jdbc:clickhouse://127.0.0.1:8123/default
spring.datasource.dynamic.datasource.access-log-db.username=default
spring.datasource.dynamic.datasource.access-log-db.password=123456

# if "access.log.writer=kafka",then you need specify kafka address and topic
access.log.kafka.topic=dbapi_access_log
spring.kafka.bootstrap-servers=127.0.0.1:9092

If you use mysql as your metadata databse, please execute initialization script sql/ddl_mysql.sql

If you specified access log database address, please execute initialization script sql/access_log_clickhouse.sql

  • Linux start or stop
sh bin/dbapi-daemon.sh start standalone
sh bin/dbapi-daemon.sh stop standalone
  • If windows, please right click bin/dbapi.ps1 and click "run with powershell"

Windows only support standalone mode, do not support cluster mode

  • The system will automatically exit after the first start, requiring activation, and can be restarted after activation

  • Browse http://192.168.xx.xx:8520 to web UI

# Cluster

  • nacosmysqlredis are required, please install nacos(recommend 1.4.2)、mysqlredis first
  • Prepare multiple machines, install jdk8+ and configure environment variable on each machine
  • Choose one machine(host1) as deploy machine, configure SSH password-free login from host1 to each other nodes
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

for ip in host2 host3; # 
do
  ssh-copy-id  $ip   # you need input password manually
done
  • Download release package and unpack to the installation folder of host1 node

  • Execute initialization script sql/ddl_mysql.sql in mysql

  • Modify properties bellow of conf/application.properties

#################################### please configure properties below #####################################

# api context
dbapi.api.context=api

# metadata database address, only mysql allowed
spring.datasource.dynamic.datasource.meta-db.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.dynamic.datasource.meta-db.url=jdbc:mysql://127.0.0.1:3306/dbapi?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.dynamic.datasource.meta-db.username=root
spring.datasource.dynamic.datasource.meta-db.password=root

# the writer to write access log to database, value can be null/db/kafka
# "db" means dbapi writes access log to database directly
# "kafka" means dbapi writes access log to kafka, you need to collect log from kafka to log database yourself
# "null" means dbapi only writes access log to disk file(logs/dbapi-access.log), you need to collect log from disk to log database yourself
access.log.writer=null

# access log database(recommend clickhouse) address. If you do not need monitor function in web UI, the properties no need
spring.datasource.dynamic.datasource.access-log-db.driver-class-name=ru.yandex.clickhouse.ClickHouseDriver
spring.datasource.dynamic.datasource.access-log-db.url=jdbc:clickhouse://127.0.0.1:8123/default
spring.datasource.dynamic.datasource.access-log-db.username=default
spring.datasource.dynamic.datasource.access-log-db.password=123456

# if "access.log.writer=kafka",then you need specify kafka address and topic
access.log.kafka.topic=dbapi_access_log
spring.kafka.bootstrap-servers=127.0.0.1:9092

############################## if cluster, please configure properties below ##############################

# nacos address, needed if cluster mode
spring.cloud.nacos.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.username=nacos
spring.cloud.nacos.discovery.password=nacos
spring.cloud.nacos.discovery.namespace=public

# redis address, needed if cluster mode
spring.redis.host=localhost
spring.redis.port=6379
spring.redis.database=0
spring.redis.password=

If access log database specified, please execute initialization script sql/access_log_clickhouse.sql

  • Modify conf/install_config.conf, describes which machines will be installed DBAPI and what role will be installed on each machine.
# host of all machines
ips=host1,host2,host3

sshPort=22

# host of machine that gateway  installed
gateway=host1

# host of multiple machines that apiServer installed
apiServers=host1,host2,host3

# host of machine that manager installed
manager=host2
  • Copy files to each other machine from host1, must to the same folder of host1, you can use script below
sh bin/scp-host.sh
  • Cluster operation
# start all
sh bin/start-all.sh

# stop all
sh bin/stop-all.sh

# start or stop one role manually
sh bin/dbapi-daemon.sh start gateway
sh bin/dbapi-daemon.sh start manager
sh bin/dbapi-daemon.sh start apiServer

sh bin/dbapi-daemon.sh stop gateway
sh bin/dbapi-daemon.sh stop manager
sh bin/dbapi-daemon.sh stop apiServer

  • The system will automatically exit after the first start, requiring activation, and can be restarted after activation

  • Browse http://192.168.xx.xx:8523 to UI; API gateway:http://192.168.xx.xx:8525/api/xx