崖山数据库系统YashanDB是深圳计算科学研究院完全自主研发设计的新型数据库系统,融入原创理论,支持单机/主备、共享集群、分布式等多种部署方式,覆盖OLTP/HTAP/OLAP交易和分析混合负载场景,为客户提供一站式的企业级融合数据管理解决方案。
YashanDB基于原创内核架构,全面支持众核、RDMA、智能计算、云基础设施等面向未来的软硬件技术,采用异步并行、基于代价的事务调度、Raft、有界计算等创新技术和算法,满足企业级核心应用对高兼容、高性能、高扩展、高可用等全生命周期数据管理诉求。
登录官方下载地址https://download.yashandb.com/download,下载x86的安装介质
** 类别 ** | **软件名称 ** | 版本 | 最低内存要求 | 最低cpu要求 |
---|---|---|---|---|
操作系统 | Centos | CentOS Linux release 7.9.2009 (Core) x86_64 | 4G | 2核 |
数据库 | YashanDB | v23.1 |
cat >> /etc/security/limits.conf << "EOF"
#add by yashandb
* soft nofile 65536 #文件句柄
* hard nofile 65536
* soft nproc 65536 #最大用户线程数
* hard nproc 65536
* soft rss unlimited #最大内存限制
* hard rss unlimited
* soft stack 8192 #堆栈大小
* hard stack 8192
EOF
groupadd YASDBA
useradd -d /home/yashan -m yashan
echo "yashan"|passwd --stdin yashan
usermod -a -G YASDBA yashan
/yashandb/install:安装目录
/yashandb/data:数据目录
mkdir -p /yashandb/{install,data}
上传yashandb-personal-23.1.1.100-linux-x86_64.tar.gz至/opt
--解压
cd /opt
tar -xvf yashandb-personal-23.1.1.100-linux-x86_64.tar.gz -C /yashandb/install
--赋予权限
chown -R yashan:yashan /yashandb
chmod -R 755 /yashandb
数据库安装过程中将实例自动切换成OPEN阶段,并创建名为yashandb的数据库。
su - yashan
[yashan@localhost]$ cd /yashandb/install/bin
[yashan@localhost]$ yasboot package se gen --cluster yashandb -u yashan -p yashan --ip 192.168.40.152 --port 22 --install-path /yashandb/install --data-path /yashandb/data --begin-port 1688
192.168.40.152
ip: memroy is less than 4096MB
hostid | group | node_type | node_name | listen_addr | replication_addr | data_path
-------------------------------------------------------------------------------------------------------
host0001 | dbg1 | db | 1-1 | 192.168.40.152:1688 | 192.168.40.152:1689 | /yashandb/data
----------+-------+-----------+-----------+---------------------+---------------------+----------------
Generate config success
[yashan@localhost]$ ls -l
total 8
-rw-------. 1 yashan yashan 504 Nov 10 19:29 hosts.toml
-rw-------. 1 yashan yashan 666 Nov 10 19:29 yashandb.toml
参数说明:
-p ssh密码
[yashan@localhost ~]$ cat hosts.toml
uuid = "654e148df857e766e33e42c332d2087c"
cluster = "yashandb"
yas_type = "SE"
secret_key = "7bafb2221442e2ef"
isLocal = true
add_yasdba = true
[om]
hostid = "host0001"
[om.config]
LISTEN_ADDR = "192.168.40.152:1675"
[[host]]
hostid = "host0001"
group = "yashan"
user = "yashan"
password = "yashan"
ip = "192.168.40.152"
port = 22
path = "/yashandb/install"
jvm_path = ""
total_memory = 0
[host.yasagent]
[host.yasagent.config]
LISTEN_ADDR = "192.168.40.152:1676"
[yashan@localhost ~]$ cat yashandb.toml
cluster = "yashandb"
create_simple_schema = false
uuid = "654e148df857e766e33e42c332d2087c"
yas_type = "SE"
[[group]]
group_type = "db"
name = "dbg1"
[group.config]
CHARACTER_SET = "utf8"
ISARCHIVELOG = true
REDO_FILE_NUM = 4
REDO_FILE_SIZE = "128M"
[group.create_sql]
[[group.node]]
data_path = "/yashandb/data"
hostid = "host0001"
role = 1
[group.node.config]
LISTEN_ADDR = "192.168.40.152:1688"
REPLICATION_ADDR = "192.168.40.152:1689"
RUN_LOG_FILE_PATH = "/yashandb/install/log/yashandb/db-1-1/run"
RUN_LOG_LEVEL = "INFO"
SLOW_LOG_FILE_PATH = "/yashandb/install/log/yashandb/db-1-1/slow"
[yashan@localhost]$ cd /yashandb/install/bin
[yashan@localhost ~]$ yasboot package install -t hosts.toml -i yashandb-personal-23.1.1.100-linux-x86_64.tar.gz
checking install profile.toml...
install version: yashandb 23.1.1.100
update host to yasom...
补充:
查看帮助信息
[yashan@localhost]$ cd /yashandb/install/bin
[yashan@localhost bin]$ yasboot package install --help
Usages: yasboot package install []
install package
Flags:
-h,--help Show detailed help information.
-i,--install-pkg yasdb install package(.tar.gz)
-f,--force ignore check errors and force install(default: false)
--disable shield running progress(default: false)
-t,--toml hosts toml config, such as 'hosts.toml' 即上一步生成的参数文件hosts.toml
[yashan@localhost]$ cd /yashandb/install/bin
[yashan@localhost ~]$ yasboot cluster deploy -t yashandb.toml
type | uuid | name | hostid | index | status | return_code | progress | cost
------------------------------------------------------------------------------------------------------------
task | 81091c90e4fcc9f9 | DeployYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 18
------+------------------+--------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
$ cd /yashandb/install/conf
# 如~/.bashrc中已存在YashanDB相关的环境变量,将其清除
$ cat yashandb.bashrc >> ~/.bashrc
$ source ~/.bashrc
补充:查看环境变量
[yashan@localhost conf]$ cat yashandb.bashrc
export YASDB_HOME=/yashandb/install
export PATH=${YASDB_HOME}/bin:$PATH
export LD_LIBRARY_PATH=${YASDB_HOME}/lib:$LD_LIBRARY_PATH
if command -v rlwrap >/dev/null 2>&1; then
alias yasql="rlwrap yasql"
fi
export YASDB_DATA=/yashandb/data/db-1-1
su - yash
cd /yashandb/data/db-1-1/instance
--备份原密码文件
mv yasdb.pwd yasdb.pwdbak
--重新生成密码文件
yaspwd file=yasdb.pwd password=Admin@2023
[yashan@localhost instance]$ yasboot cluster status -c yashandb
host_id | node_type | nodeid | pid
--------------------------------------
host0001 | db | 1-1:1 | 2000
----------+-----------+--------+------
[yashan@localhost instance]$ yasql 'sys/"Admin@2023"'
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
Connected to:
YashanDB Server Personal Edition Release 23.1.1.100 x86_64 - X86 64bit Linux
补充:不包含@ 特殊字符的登录方式如下:
[yashan@localhost instance]$ yasql sys/Admin_2023
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
Connected to:
YashanDB Server Personal Edition Release 23.1.1.100 x86_64 - X86 64bit Linux
[yashan@localhost instance]$ yasql 'sys/"Admin@2023"'
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
Connected to:
YashanDB Server Personal Edition Release 23.1.1.100 x86_64 - X86 64bit Linux
SQL> SELECT status FROM V$INSTANCE;
STATUS
-------------
OPEN
1 row fetched.
SQL> SELECT database_name FROM V$DATABASE;
DATABASE_NAME
----------------------------------------------------------------
yashandb
1 row fetched.
[yashan@localhost ~]$ yasboot cluster status -c yashandb
host_id | node_type | nodeid | pid
--------------------------------------
host0001 | db | 1-1:1 | 2000
----------+-----------+--------+------
[yashan@localhost instance]$ yasboot cluster start -c yashandb
type | uuid | name | hostid | index | status | return_code | progress | cost
-----------------------------------------------------------------------------------------------------------
task | 89b8f2f3de1ae5cd | StartYasdbCluster | - | yashandb | RUNNING | - | 0 | -
------+------------------+-------------------+--------+----------+---------+-------------+----------+------
[yashan@localhost instance]$ yasboot cluster stop -c yashandb
type | uuid | name | hostid | index | status | return_code | progress | cost
----------------------------------------------------------------------------------------------------------
task | 0679fa02218a24ec | StopYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 2
------+------------------+------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
[yashan@localhost instance]$ yasboot cluster restart -c yashandb -m nomount
type | uuid | name | hostid | index | status | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
task | cf25f60bab690234 | ReStartYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 3
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
[yashan@localhost instance]$ yasboot cluster restart -c yashandb -m mount
type | uuid | name | hostid | index | status | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
task | 5a75a4d77aa01e88 | ReStartYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 4
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
[yashan@localhost instance]$ yasboot cluster restart -c yashandb
type | uuid | name | hostid | index | status | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
task | 78018f5b05a212c8 | ReStartYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 4
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
安装数据库时提示cpu和memory检测失败,查看官方文档最低配置为:cpu:2C memory:4G
[yashan@localhost bin]$ yasboot package install -t hosts.toml -i yashandb-personal-23.1.1.100-linux-x86_64.tar.gz
192.168.40.152
ip: cpu cores is less than 2
ip: memroy is less than 4096MB
config check failed
升级硬件配置,cpu:2C,内存5G
安装数据库时提示hosts.toml参数文件不存在
[yashan@localhost conf]$ yasboot package install -t hosts.toml -i yashandb-personal-23.1.1.100-linux-x86_64.tar.gz
hosts.toml is not exist
未切换到配置文件目录,切换到hosts.toml文件所在目录重新安装成功
重置sys密码文件时提示密码复杂度失败
[yashan@localhost instance]$ yaspwd file=yasdb.pwd password=yashan
YASPW-00002 password complexity failed for SYS user : password must contain at least 8 characters
密码复杂度不够,增加密码复杂度解决
yaspwd file=yasdb.pwd password=Admin@2023
sys用户登录时提示YAS-00404 address 2023 is an invalid IPV4
[yashan@localhost ~]$ yasql sys/Admin@2023
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
YAS-00404 address 2023 is an invalid IPV4 URL/Ip address/hostname
由于密码中含有@特殊字符,和Oracle一样需特殊处理。其他字符则不受影响
[yashan@localhost instance]$ yasql 'sys/"Admin@2023"'
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
Connected to:
YashanDB Server Personal Edition Release 23.1.1.100 x86_64 - X86 64bit Linux
重启后重新输入密码提示错误导致账户被锁
[yashan@localhost instance]$ yasql 'sys/"admin_2023"'
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
YAS-02193 the account is locked
--免密登录
[yashan@localhost instance]$ yasql / as sysdba
--更改sys用户密码
SQL> alter user sys identified by "Admin@2023";
[yashan@localhost instance]$ yasql / as sysdba
YashanDB SQL Personal Edition Release 23.1.1.100 x86_64
YAS-02143 invalid username/password, login denied
[yashan@localhost instance]$ id yashan
uid=1000(yashan) gid=1000(yashan) groups=1000(yashan)
yashan用户未在YASDBA组
groupadd YASDBA
usermod -a -G YASDBA yashan
groups yashan
echo "yashan"|passwd --stdin yashan