Yashandb安装
环境准备
虚拟机环境说明
虚拟机系统:centos 7.9,2c,8g,100GB;内存至少4G+,否则无法安装;
安装用户:yashan
软件目录:/app/install
安装目录:/app/yasdb_home
数据目录:/app/yasdb_data
修改主机名称
hostnamectl set-hostname yashan && bash
依赖项确认–openssl版本
openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017 --版本必须要1.1以上
find / -name openssl
mv /usr/bin/openssl /usr/bin/openssl_old
mv /usr/lib64/openssl/ /usr/lib64/openssl_old
- 安装openssl-1.1.1
$ tar xzf openssl-1.1.1l.tar.gz
$ cd openssl-1.1.1l/
$ ./config --prefix=/usr/local/openssl
$ make && make install
$ ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
$ ln -s /usr/local/openssl/include/openssl/ /usr/include/openssl
$ echo "/usr/local/openssl/lib/" >> /etc/ld.so.conf
$ ldconfig -v
$ openssl version -a
系统环境配置
系统参数配置
echo "vm.swappiness = 0">> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 32768 60999" >> /etc/sysctl.conf
echo "vm.max_map_count=2000000" >> /etc/sysctl.conf
sysctl -p
资源配置
cat >> /etc/security/limits.conf << EOF
yashan soft nofile 65536
yashan hard nofile 65536
yashan soft nproc 65536
yashan hard nproc 65536
yashan soft rss unlimited
yashan hard rss unlimited
yashan soft stack 8192
yashan hard stack 8192
EOF
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
添加用户及用户组
useradd yashan
echo "Asdf123." |passwd --stdin yashan
groupadd YASDBA
usermod -a -G YASDBA yashan
创建目录并授权
mkdir -p /app/yasdb_home
mkdir -p /app/yasdb_data
mkdir -p /app/install
chown -R yashan:yashan /app
配置sudo
chmod +w /etc/sudoers
cat >> /etc/sudoers << EOF
yashan ALL=(ALL)NOPASSWD:ALL
EOF
执行安装
上传安装包到install目录并解压:yashandb-personal-23.2.3.100-linux-x86_64.tar.gz
su yashan
tar -zxf yashandb-personal-23.2.3.100-linux-x86_64.tar.gz
生成参数文件
[yashan@yashan install]$ ./bin/yasboot package se gen --cluster yashandb -u yashan -p Asdf123. --ip 192.168.50.183 --port 22 --install-path /app/yasdb_home --data-path /app/yasdb_data --begin-port 1688
host host0001 openssl version: OpenSSL 1.1.1l 24 Aug 2021
OpenSSL version is 1.1.1 or greater
192.168.50.183
ip:192.168.50.183 memory is less than 4096MB --我这里的内存是4G,安装失败,后面改成8G安装就可以了。
hostid | group | node_type | node_name | listen_addr | replication_addr | data_path
--------------------------------------------------------------------------------------------------------
host0001 | dbg1 | db | 1-1 | 192.168.50.183:1688 | 192.168.50.183:1689 | /app/yasdb_data
----------+-------+-----------+-----------+---------------------+---------------------+-----------------
Generate config success
执行安装
yashandb-personal-23.1.1.100-linux-x86_64.tar.gz
[yashan@yashan 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.1.1l 24 Aug 2021
OpenSSL version is 1.1.1 or greater
checking install package...
install version: yashandb 23.2.3.100
host0001 100% [====================================================================] 1m0s
update host to yasom...
执行部署
[yashan@yashan install]$ ./bin/yasboot cluster deploy -t yashandb.toml
type | uuid | name | hostid | index | status | return_code | progress | cost
------------------------------------------------------------------------------------------------------------
task | 24ef82d552d93233 | DeployYasdbCluster | - | yashandb | SUCCESS | 0 | 100 | 138
------+------------------+--------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
配置环境变量:
[yashan@yashan install]$ cd /app/yasdb_home/yashandb/23.2.3.100/conf/
[yashan@yashan conf]$ cat yashandb.bashrc -- 不用改变
export YASDB_HOME=/app/yasdb_home/yashandb/23.2.3.100
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=/app/yasdb_data/db-1-1
---------------------------------------------------------------------
[yashan@yashan conf]$ cat yashandb.bashrc >> ~/.bashrc
[yashan@yashan conf]$ source ~/.bashrc
[yashan@yashan conf]$ env|grep YAS
YASDB_HOME=/app/yasdb_home/yashandb/23.2.3.100
YASDB_DATA=/app/yasdb_data/db-1-1
或者直接执行下面这个,配置环境变量
cd /app/yasdb_home/yashandb/23.2.3.100/conf/
source yashandb.bashrc
cat yashandb.bashrc >> ~/.bashrc
设置sys用户密码:
至少8位,至少包含1个特殊字符,好像没有限制大写字母
[yashan@yashan instance]$ yasboot cluster password set -n yasdb_123 -c yashandb
type | uuid | name | hostid | index | status | return_code | progress | cost
----------------------------------------------------------------------------------------------------------
task | 956c8f977ef3ef86 | YasdbPasswordSet | - | yashandb | SUCCESS | 0 | 100 | 2
------+------------------+------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS
使用YasBoot查看YashanDB数据库状态,显示以下信息表示安装成功
[yashan@yashan instance]$ yasboot cluster status -c yashandb
host_id | node_type | nodeid | pid
--------------------------------------
host0001 | db | 1-1:1 | 7590
----------+-----------+--------+------
登陆验证,显示以下信息表示登陆成功
[yashan@yashan instance]$ yasql sys/yasdb_123
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>
SQL> select database_name,open_mode from v$database;
DATABASE_NAME OPEN_MODE
---------------------------------------------------------------- -----------------
yashandb READ_WRITE
1 row fetched.
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------------------------------------------------------- -------------
yasdb OPEN
1 row fetched.
关闭与开启
yasboot cluster stop -c yashandb
yasboot cluster start -c yashandb
卸载
yasboot cluster clean --cluster yashandb --purge
yasboot package uninstall --cluster yashandb
清理环境变量
使用图形工具连接数据库
添加yanshandb驱动器:
下载崖山数据库的驱动包(官网或者文末网盘):
连接数据库,测试成功。
通过百度网盘分享的文件:Yashandb 23.2.3.100 (openssl-1.1.1l.tar.gz、yashandb-personal-23.2.3.100-linux-x86_64.tar.gz、yashandb-jdbc-1.6.9.jar)
链接:https://pan.baidu.com/s/1v9NJe5QIj0RqWnI-FmVTRA
提取码:9p4y