YashanDB服务端安装

简介: YashanDB服务端安装

本章节将介绍Linux环境下单机形态的YashanDB数据库服务端安装部署方式,请确保已根据安装前准备章节进行相关配置,本文以yashandb-personal-23.3.1.100-linux-x86_64.tar.gz软件包为例进行阐述 。

如需安装其他部署形态的YashanDB数据库,请参考安装部署章节。

创建安装目录


  1. 执行如下命令切换至yashan用户:

    
    $ cd
    

    Copied!

  2. 执行如下命令创建目录install:

    $ mkdir install
    

    Copied!

获取yasboot安装工具


  1. 执行如下命令进入目录install,此时用户所在路径为/home/yashan/install

    $ cd install
    $ pwd
    /home/yashan/install
    

    Copied!

  2. 将软件包上传至install目录中。

  3. 执行如下命令解压软件包,并查看解压后目录中所有文件,请将解压命令后的软件包名称更改为实际使用的软件包名称:

    $ tar -zxf yashandb-personal-23.3.1.100-linux-x86_64.tar.gz
    $ ll
    
    total 238528
    drwxrwxr-x 6 yashan yashan        70 Aug  8 01:29 admin
    drwxrwxr-x 2 yashan yashan      4096 Aug  8 01:29 bin
    drwxrwxr-x 2 yashan yashan       103 Aug  8 01:29 conf
    drwxrwxr-x 4 yashan yashan        46 Aug  8 01:29 ext
    -rw-rw-r-- 1 yashan yashan     11836 Aug  8 01:29 gitmoduleversion.dat
    drwxrwxr-x 2 yashan yashan        79 Aug  8 01:29 include
    drwxrwxr-x 3 yashan yashan        17 Aug  8 01:29 java
    drwxr-xr-x 2 yashan yashan      4096 Aug  8 01:29 lib
    drwxrwxr-x 3 yashan yashan        21 Aug  8 01:29 plug-in
    drwxrwxr-x 2 yashan yashan       115 Aug  8 01:29 scripts
    -rw-rw-r-- 1 yashan yashan 244227405 Aug  8 01:30 yashandb-personal-23.3.1.100-linux-x86_64.tar.gz
    

    Copied!

生成参数文件


  1. 执行如下命令生成安装参数文件,ssh登录密码为创建yashan用户时指定的密码,请将--ip参数后面的值更换成安装服务端所在服务器的IP地址(使用127.0.0.1会导致客户端无法连接至服务端):

    $ ./bin/yasboot package se gen --cluster yashandb -u yashan -p ssh登录密码 --ip 192.168.1.2 --port 22 --install-path /data/yashan/yasdb_home  --data-path /data/yashan/yasdb_data --begin-port 1688
     hostid   | group | node_type | node_name | listen_addr    | replication_addr | data_path
    --------------------------------------------------------------------------------------------------------
     host0001 | dbg1  | db        | 1-1       | 192.168.1.2:1688 | 192.168.1.2:1689   | /data/yashan/yasdb_data
    ----------+-------+-----------+-----------+----------------+------------------+-------------------------
    
    Generate config completed
    

    Copied!

执行安装


  1. 执行如下命令安装YashanDB数据库,如实际安装数据库版本与示例中版本不同,请将-i参数后的软件包名称更改成实际名称:

    $ ./bin/yasboot package install -t hosts.toml -i yashandb-personal-23.3.1.100-linux-x86_64.tar.gz
    checking install package...
    install version: yashandb 23.3.1.100
    host0001 100% [====================================================================]   27s
    update host to yasom...
    

    Copied!

执行部署


  1. 执行如下命令部署YashanDB数据库:

    $ ./bin/yasboot cluster deploy -t yashandb.toml
     type | uuid             | name               | hostid | index    | status  | return_code | progress | cost
    ------------------------------------------------------------------------------------------------------------
     task | 356b6a4a51ad600a | DeployYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 9
    ------+------------------+--------------------+--------+----------+---------+-------------+----------+------
    task completed, status: SUCCESS
    

    Copied!

  2. 执行如下命令配置环境变量:

    ```
    $ cd /data/yashan/yasdb_home/yashandb/23.3.1.100/conf

$ cat yashandb.bashrc >> ~/.bashrc
$ source ~/.bashrc

```

Copied!
  1. 执行如下命令设置YashanDB数据库中sys用户的密码(命令中的newpasswd请替换为实际密码):

    $ yasboot cluster password set -n newpasswd -c yashandb
    

    Copied!

  2. 执行如下命令查看YashanDB数据库状态,如显示出数据库状态信息即为安装成功:

    $ yasboot cluster status -c yashandb
     host_id  | node_type | nodeid | pid
    --------------------------------------
     host0001 | db        | 1-1:1  | 8554
    ----------+-----------+--------+------
    

    Copied!

  3. 执行如下命令连接数据库(命令中的newpasswd请替换为实际密码):

    $ yasql sys/newpasswd
    YashanDB SQL Personal Edition Release 23.3.1.100 x86_64
    
    Connected to:
    YashanDB Server Personal Edition Release 23.3.1.100 x86_64 - Linux
    
    SQL>
    

    Copied!

相关文章
|
7月前
|
数据库
YashanDB环境变量
YashanDB环境变量
|
7月前
|
SQL Linux 数据库
YashanDB客户端安装
YashanDB客户端安装
|
7月前
|
SQL 数据库
YashanDB实例启停
YashanDB实例启停
|
7月前
|
网络协议 安全 Linux
YashanDB安装前准备
YashanDB安装前准备
|
7月前
|
运维 安全 数据库
YashanDB访问控制
YashanDB访问控制
|
7月前
|
存储 缓存 运维
YashanDB文件系统
YashanDB文件系统
|
7月前
|
存储 安全 数据库
YashanDB用户管理
YashanDB用户管理
|
7月前
|
存储 监控 数据库
YashanDB集群服务
YashanDB集群服务
|
7月前
|
SQL 监控 数据库
|
7月前
|
存储 网络安全 数据库
YashanDB加密方法
YashanDB加密方法