0
点赞
收藏
分享

微信扫一扫

YashanDB单实例安装部署

实施步骤

一、操作系统参数修改

参考官网:
http://doc.yashandb.com/yashandb/23.1/zh/%E5%AE%89%E8%A3%85%E5%92%8C%E5%8D%87%E7%BA%A7/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/%E5%AE%89%E8%A3%85%E5%89%8D%E5%87%86%E5%A4%87/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%8F%82%E6%95%B0%E8%B0%83%E6%95%B4.html

二、关闭防火墙

##关闭防火墙
# systemctl stop firewalld 
##关闭开机自启
# systemctl disable firewalld

三、创建用户

3.1 创建用户和组

useradd -d /home/yashan -m yashan
passwd yashan
groupadd YASDBA
usermod -a -G YASDBA yashan

3.2 配置sudo免密

cd /etc
ll sudoers
chmod +w sudoers
vim /etc/sudoers

在文件的最后添加如下内容后保存退出:
yashan  ALL=(ALL)NOPASSWD:ALL

恢复文件属性:
chmod -w sudoers

四、创建目录

mkdir -p /data/yashan
chmod -R 777 /data/yashan

五、下载并上传软件安装包

5.1 创建解压目录

su - yashan
mkdir install
cd install

5.2 解压文件

tar -xzvf yashandb-personal-23.1.1.100-linux-x86_64.tar.gz

六、安装部署数据库

6.1 生成部署文件

[yashan@yas1 install]$ ./bin/yasboot package se gen --cluster yashandb -u yashan -p root123 --ip 172.16.166.121 --port 22 --install-path /data/yashan/yasdb_home  --data-path /data/yashan/yasdb_data --begin-port 1688
172.16.166.121
  ip:172.16.166.121 cpu cores is less than 2
  ip:172.16.166.121 memroy is less than 4096MB
 hostid   | group | node_type | node_name | listen_addr         | replication_addr    | data_path               
----------------------------------------------------------------------------------------------------------------
 host0001 | dbg1  | db        | 1-1       | 172.16.166.121:1688 | 172.16.166.121:1689 | /data/yashan/yasdb_data 
----------+-------+-----------+-----------+---------------------+---------------------+-------------------------

Generate config success

6.2 执行安装

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

注:此处对操作系统资源有最低要求:2核CPU和4GB内存。否则报错提示如下:

172.16.166.121
  ip:172.16.166.121 cpu cores is less than 2
  ip:172.16.166.121 memroy is less than 4096MB
config check failed

6.3 数据库部署

1.执行部署命令
[yashan@yas1 install]$ ./bin/yasboot cluster deploy -t yashandb.toml
 type | uuid             | name               | hostid | index    | status  | return_code | progress | cost 
------------------------------------------------------------------------------------------------------------
 task | 1b86f3a0c7805118 | DeployYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 9    
------+------------------+--------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

2.生效环境变量
[yashan@yas1 install]$ cd /data/yashan/yasdb_home/yashandb/23.1.1.100/conf/
[yashan@yas1 conf]$ cat yashandb.bashrc >> ~/.bashrc
[yashan@yas1 conf]$ source  ~/.bashrc

6.4 修改sys用户口令

YashanDB不提供系统初始口令,需要通过yasboot工具设置集群内所有节点sys用户的密码。

[yashan@yas1 conf]$ yasboot cluster password set -n root#1234 -c yashandb 
 type | uuid             | name             | hostid | index    | status  | return_code | progress | cost 
----------------------------------------------------------------------------------------------------------
 task | 23ec6734d579a48c | YasdbPasswordSet | -      | yashandb | SUCCESS | 0           | 100      | 2    
------+------------------+------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

注:YashanDB初始对密码有一定的复杂性要求:至少8个字符并至少有一个特殊符号。否则,报错如下:

type | uuid             | name             | hostid | index    | status | return_code | progress | cost 
---------------------------------------------------------------------------------------------------------
 task | 1be8aaf4bfd467e1 | YasdbPasswordSet | -      | yashandb | FAILED | 1           | 100      | 1    
------+------------------+------------------+--------+----------+--------+-------------+----------+------
task completed, status: FAILED
retcode: 1
stdout: generate password file
stderr: generate yaspwd file failed, YASPW-00002 password complexity failed for SYS user : password must contain at least 8 characters
 err:
 
 或
 
  type | uuid             | name             | hostid | index    | status | return_code | progress | cost 
---------------------------------------------------------------------------------------------------------
 task | f859169200501225 | YasdbPasswordSet | -      | yashandb | FAILED | 1           | 100      | 1    
------+------------------+------------------+--------+----------+--------+-------------+----------+------
task completed, status: FAILED
retcode: 1
stdout: generate password file
stderr: generate yaspwd file failed, YASPW-00002 password complexity failed for SYS user : password must contain at least 1 special character
 err:

七、登录并使用数据库

方法一:
[yashan@yas1 install]$ yasboot sql -d sys/root#1234@172.16.166.121:1688
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;
select status from v$instance;

STATUS        
------------- 
OPEN         

1 row fetched.

方法二:
[yashan@yas1 install]$ yasql / as sysdba
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.

参考文档

http://doc.yashandb.com/yashandb/23.1/zh/%E5%AE%89%E8%A3%85%E5%92%8C%E5%8D%87%E7%BA%A7/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/YashanDB%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%AE%89%E8%A3%85/%E5%8D%95%E6%9C%BA%E4%B8%BB%E5%A4%87%E9%83%A8%E7%BD%B2.html

举报

相关推荐

0 条评论