崖山数据库(YashanDB)是由深圳计算科学研究院自主研发的一款新型数据库管理系统。该数据库系统不仅融合了经典数据库理论,还融入了新的原创理论,具备高性能、高可用性和强大的数据处理能力。本文将详细介绍如何在单机环境下部署崖山数据库,帮助读者快速上手并体验其强大功能。
崖山数据库管理系统(YashanDB)是深圳计算科学研究院在数据库前沿基础理论上自主设计、研发的一款新型数据库系统。它支持多种存储表类型(如HEAP、TAC、LSC),具备完整的ACID事务处理能力、向量化计算、MPP分布式执行方式等特性。同时,YashanDB还提供了丰富的数据类型和函数库,支持ANSI SQL标准,并且具备强大的优化器模型,能够处理复杂的查询和大规模数据。
部署崖山数据库需要一台配置合适的Linux服务器,推荐使用CentOS 7.6及以上版本。服务器的最少配置建议如下:
#!/bin/bash
############################################################
## scripts: ysdb_user.sh
## author : dash.cai
## purpose: 配置崖山数据库用户
############################################################
groupadd yashan
useradd -g yashan -s /bin/bash -c "yashan Owner" yashan
echo "yashan" | passwd --stdin yashan
chmod +w /etc/sudoers
echo "yashan ALL=(ALL)NOPASSWD:ALL" >> /etc/sudoers
chmod -w /etc/sudoers
下表为YashanDB数据库所需的资源限制值的最小要求,请根据下表所示将资源限制值调整为大于或等于最小要求的值。
#!/bin/bash
############################################################
## scripts: ysdb_limits.sh
## author : dash.cai
## purpose: 配置崖山数据库资源参数
##
############################################################
echo "
* soft nofile 1048576
* hard nofile 1048576
* soft nproc 1048576
* hard nproc 1048576
* soft rss unlimited
* hard rss unlimited
* soft stack 8192
* hard stack 8192
" >> /etc/security/limits.conf
首先,从崖山数据库官网下载对应版本的安装包(例如yashandb-personal-23.2.0.2-linux-x86_64.tar.gz),并将其上传到服务器的指定目录下(例如/home/yashan/install)。
mkdir -p /home/yashan/install
mkdir -p /home/yashan/yasdb_home
mkdir -p /home/yashan/yasdb_data
cd /home/yashan/install
tar -zxvf yashandb-personal-23.1.1.100-linux-x86_64.tar.gz
执行如下命令生成安装参数文件,ssh登录密码为创建yashan用户时指定的密码,请将--ip参数后面的值更换成安装服务端所在服务器的IP地址(使用127.0.0.1会导致客户端无法连接至服务端):
[yashan@centos7 install]$ ./bin/yasboot package se gen --cluster yashandb -u yashan -p yashan --ip 192.168.56.103 --port 22 --install-path /home/yashan/yasdb_home --data-path /home/yashan/yasdb_data --begin-port 1688
host host0001 openssl version: OpenSSL 1.0.2k-fips 26 Jan 2017
Warning: OpenSSL less than 1.1.1, it may cause installation failures, please upgrade OpenSSL to 1.1.1 or greater
hostid | group | node_type | node_name | listen_addr | replication_addr | data_path
----------------------------------------------------------------------------------------------------------------
host0001 | dbg1 | db | 1-1 | 192.168.56.103:1688 | 192.168.56.103:1689 | /home/yashan/yasdb_data
----------+-------+-----------+-----------+---------------------+---------------------+-------------------------
Generate config success
执行如下命令安装YashanDB数据库,如实际安装数据库版本与示例中版本不同,请将 -i参数后的软件包名称更改成实际名称:
[yashan@centos7 install]$ ./bin/yasboot package install -t hosts.toml -i yashandb-personal-23.2.3.100-linux-x86_64.tar.gz
host host0001 openssl version: OpenSSL 1.0.2k-fips 26 Jan 2017
Warning: OpenSSL less than 1.1.1, it may cause installation failures, please upgrade OpenSSL to 1.1.1 or greater
checking install package...
install version: yashandb 23.2.3.100
host0001 100% [====================================================================] 3s
host0001 failed, 116, , stdout: user yashan don't belong to group yashan stderr:
package install failed
[root@centos7 ~]# groupadd yashan
[root@centos7 ~]# usermod -g yashan yashan
[yashan@centos7 install]$ ./bin/yasboot package install -t hosts.toml -i yashandb-personal-23.2.3.100-linux-x86_64.tar.gz
host host0001 openssl version: OpenSSL 1.0.2k-fips 26 Jan 2017
Warning: OpenSSL less than 1.1.1, it may cause installation failures, please upgrade OpenSSL to 1.1.1 or greater
checking install package...
install version: yashandb 23.2.3.100
host0001 100% [====================================================================] 3s
update host to yasom...
[yashan@centos7 install]$ ./bin/yasboot cluster deploy -t yashandb.toml
type | uuid | name | hostid | index | status | return_code | progress | cost
-----------------------------------------------------------------------------------------------------------
task | c32bb1e97c7ebe9f | DeployYasdbCluster | - | yashandb | FAILED | 1 | 100 | 13
------+------------------+--------------------+--------+----------+--------+-------------+----------+------
task completed, status: FAILED
retcode: 1
stdout: start node with ping
stderr: wait node 1-1 process start failed: failed to init dynamic library OPENSSL
Failed to start instance
异常处理,openssl告警无法忽略,更新openssl后卸载再次安装
[yashan@centos7 install]$ ./bin/yasboot cluster clean --cluster yashandb --purge
Are you sure you want to CLEAN cluster: [yashandb], AND ALL DATA WILL BE DELETED (-p/--purge is given)?
[yes/no]: yes
type | uuid | name | hostid | index | status | return_code | progress | cost
-----------------------------------------------------------------------------------------------------------
task | fb32c95cecf892e6 | CleanYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 1
------+------------------+-------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
[yashan@centos7 install]$ ./bin/yasboot cluster deploy -t yashandb.toml
type | uuid | name | hostid | index | status | return_code | progress | cost
------------------------------------------------------------------------------------------------------------
task | 955ea216e6357a27 | DeployYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 49
------+------------------+--------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
[yashan@centos7 install]$ cd /home/yashan/yasdb_home/yashandb/23.2.3.100/conf/
[yashan@centos7 conf]$ ls -tlr
total 748
-rw-rw-r--. 1 yashan yashan 6261 Jul 8 05:12 yfs_options.json
-rw-rw-r--. 1 yashan yashan 4635 Jul 8 05:12 ycs_options.json
-rw-rw-r--. 1 yashan yashan 590524 Jul 8 05:12 yasreport.template
-rw-rw-r--. 1 yashan yashan 23577 Jul 8 05:12 sqlhtml.template
-rw-rw-r--. 1 yashan yashan 6836 Jul 8 05:12 sqlcollect.toml
-rw-rw-r--. 1 yashan yashan 297 Jul 8 05:12 profile.toml
-rw-rw-r--. 1 yashan yashan 113464 Jul 8 05:12 database_options.json
drwxrwxr-x. 2 yashan yashan 73 Aug 1 03:44 monit
-rwx------. 1 yashan yashan 281 Aug 1 03:44 yashandb.bashrc
[yashan@centos7 conf]$ cat yashandb.bashrc >> ~/.bashrc
[yashan@centos7 conf]$ source ~/.bashrc
[yashan@centos7 conf]$ cd /home/yashan/yasdb_data/db-1-1/instance
[yashan@centos7 instance]$ mv yasdb.pwd yasdb1.pwd
[yashan@centos7 instance]$ yaspwd file=yasdb.pwd
Enter password for SYS:
[yashan@centos7 instance]$ yasboot cluster status -c yashandb
host_id | node_type | nodeid | pid
---------------------------------------
host0001 | db | 1-1:1 | 16868
----------+-----------+--------+-------
[yashan@centos7 instance]$ yasql sys/*****
YashanDB SQL Personal Edition Release 23.2.3.100 x86_64
Connected to:
YashanDB Server Personal Edition Release 23.2.3.100 x86_64 - X86 64bit Linux
SQL> select open_mode from v$database;
OPEN_MODE
-----------------
READ_WRITE
1 row fetched.
至此,单机版部署完成。
YCA官方报名链接:YashanDB|崖山数据库系统YashanDB学习中心-YCA认证详情