YashanDB服务端个人版安装部署

介绍

崖山数据库系统YashanDB是深圳计算科学研究院完全自主研发设计的新型数据库系统,融入原创理论,支持单机/主备、共享集群、分布式等多种部署方式,覆盖OLTP/HTAP/OLAP交易和分析混合负载场景,为客户提供一站式的企业级融合数据管理解决方案。
YashanDB基于原创内核架构,全面支持众核、RDMA、智能计算、云基础设施等面向未来的软硬件技术,采用异步并行、基于代价的事务调度、Raft、有界计算等创新技术和算法,满足企业级核心应用对高兼容、高性能、高扩展、高可用等全生命周期数据管理诉求。

版本描述

  • 个人版:YashanDB面向个人用户推出的免费试用版本,除不支持多模数据类型、高级安全能力、数据库集群等企业级功能,该版本包含YashanDB数据库 所有基础核心能力,支持单机主备部署形态,配套开发者工具,供个人用户或开发者用于学习、测试、开发用途。
  • 标准版:YashanDB面向小规模用户推出的商业版本,该版本价格适中,除不支持多模数据类型、高级安全能力等企业级功能,该版本包含YashanDB数据 库所有基础核心能力,支持单机主备、分布式、共享集群部署形态,配套完整数据迁移和监控运维工具,可以为政府或中小企业提供支撑其业务所需的基 本能力。
  • 企业版:YashanDB面向大规模用户推出的商业版本,该版本包含YashanDB数据库完整核心能力,支持PB级海量数据存储和大量的并发用户,支持多模数 据类型、高级安全能力,支持单机主备、分布式、共享集群部署形态,配套完整数据迁移和监控运维工具,可以满足支撑各类企业应用。

数据库架构

YashanDB服务端个人版安装部署_第1张图片

下载地址

登录官方下载地址https://download.yashandb.com/download,下载x86的安装介质
YashanDB服务端个人版安装部署_第2张图片

安装前准备

服务器环境

** 类别 ** **软件名称 ** 版本 最低内存要求 最低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密码

补充:参数文件说明

hosts.toml
[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"

yashandb.toml
[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"

安装YashanDB数据库

[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

部署YashanDB数据库

[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

设置YashanDB数据库中sys用户的密码

su - yash
cd /yashandb/data/db-1-1/instance

--备份原密码文件
mv yasdb.pwd yasdb.pwdbak

--重新生成密码文件
yaspwd file=yasdb.pwd password=Admin@2023

查看YashanDB数据库状态

[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

实例启停

查看状态

方式1:SQL命令查看当前实例状态及数据库名称

[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.

方式2:命令方式查看YashanDB状态

[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

重启数据库服务

重启数据库服务至nomount状态

[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

重启数据库服务至mount状态

[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

重启数据库服务至open状态

[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 config check failed

问题描述

安装数据库时提示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 is not exist

问题描述

安装数据库时提示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文件所在目录重新安装成功

YASPW-00002 password complexity failed

问题描述

重置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

YAS-00404 address 2023 is an invalid IPV4

问题描述

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

YAS-02193 the account is locked

问题描述

重启后重新输入密码提示错误导致账户被锁

[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

你可能感兴趣的:(YashanDB,YashanDB)