在【甜甜老师的DB Fun圈】第一讲的分享中,我们揭开了华为GuassDB数据库的神秘面纱,那么本期我们继续分享【甜甜老师的DB Fun圈】第二讲——GaussDB 100 OLTP 单机在RHEL7.6上的安装。
你需要知道的
-
GaussDB 100 OLTP x86 版本请自行向官方申请,目前暂未对外公开(申请)
-
GaussDB 100 OLTP x86_64 基于 RedHat 7.6 安装(Host IP:192.168.43.175)
-
DataStudio 基于 Windows 7 安装(Host IP:192.168.43.147)
RHEL7.6 操作系统安装
-
参考 RHEL 7.6 安装
GaussDB 100安装
环境设置
-
关闭Selinux
vim /etc/selinux/config
修改 SELINUX=enforcing 为 SELINUX=disabled
-
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
-
编辑环境变量
[root@henry ~]# vim /etc/profile
添加 ulimit -c unlimited
-
刷新环境变量
[root@henry ~]# source /etc/profile
-
编辑内核参数
[root@henry ~]# vim /etc/sysctl.conf
添加 kernel.core_pattern = /corefile/core-%e-%p-%t
-
刷新内核参数
[root@henry ~]# sysctl -p
创建用户组/用户/文件夹
-
创建用户组用户
[root@henry ~]# groupadd dbgrp
[root@henry ~]# useradd -g dbgrp -d /home/omm -m -s /bin/bash omm
-
修改用户密码
[root@henry ~]# passwd omm
Changing password for user omm.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
-
创建文件夹
[root@henry ~]# mkdir -p /opt/software/gaussdb
软件上传/解压/安装
-
上传(略)
-
解压
[root@henry ~]# cd /opt/software/gaussdb/
[root@henry gaussdb]# tar -zxvf GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/install.py
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/upgrade.py
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/funclib.py
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/sshexkey.py
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/GaussDB_100_1.0.1-RUN-REDHAT-64bit.tar.gz
GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/GaussDB_100_1.0.1-RUN-REDHAT-64bit.sha256
-
安装
[root@henry gaussdb]# cd GaussDB_100_1.0.1-DATABASE-REDHAT-64bit/
[root@henry GaussDB_100_1.0.1-DATABASE-REDHAT-64bit]# python
install.py -U omm:dbgrp -R /opt/gaussdb/app -D
/opt/gaussdb/data -C
LSNR_ADDR=127.0.0.1,192.168.43.175 -C
LSNR_PORT=1888Checking runner.
Checking parameters.End check parameters.
Checking user.End check user.
Checking old install.End check old install.
Checking kernel parameters.
Checking directory.
Checking integrality of run file...Decompressing run file.Setting user env.
Checking data dir and config fileInitialize db instance.Creating database.Creating databasesucceed.Changing file permission due to security audit.Install successfully, for more detail information see
/home/omm/zengineinstall.log.
启动数据库
-
切换用户
[root@henry GaussDB_100_1.0.1-DATABASE-REDHAT-64bit]# su - omm
Last login: Thu Dec 5 14:18:19 CST 2019
-
启动数据库并登陆
[omm@henry ~]$ cd /opt/gaussdb/app/bin/
[omm@henry bin]$ python zctl.py -t startZengine instance has already started.
[omm@henry bin]$ zsql SYS/Changeme_123@127.0.0.1:1888Warning:
SSL connection to server without CA certificate is insecure.
Continue anyway? (y/n):y
connected.SQL> select count(1) from sys_tables;
COUNT(1) --------------------86
1 rows fetched.
DataStudio 连接
服务器环境设置
-
添加白名单
[root@henry ~]# cd /opt/gaussdb/data/cfg/
[root@henry cfg]# vim zhba.conf
# 尾行添加客户端IP地址 host * 192.168.43.147,::1
# 最终显示
[root@henry cfg]# cat zhba.conf
host * 127.0.0.1,::1
host * 192.168.43.147,::1
-
重启数据库
[root@henry ~]# su - omm
Last login: Thu Dec 5 14:29:17 CST 2019 on pts/3
[omm@henry ~]$ cd /opt/gaussdb/app/bin/
[omm@henry bin]$ python zctl.py -t stopSuccessfully stopped instance.
[omm@henry bin]$ python zctl.py -t startSuccessfully started instance.
-
创建数据库用户(默认无法通过SYS用户登录)
[omm@henry bin]$ zsql SYS/Changeme_123@127.0.0.1:1888
Warning: SSL connection to server without CA certificate is insecure. Continue anyway? (y/n):y
connected.
SQL> create user henry identified by 'Henry@123';Succeed.
SQL> grant dba to henry;
Succeed.
DataStudio连接及操作
-
注意:DataStudio开发工具需要JDK支持(请自行安装JDK)
-
create table henry (id number);insert into henry values
(1);insert into henry values (2);commit;select * from henry;
-
好了,我们今天的课就先讲到这。同学们可以自己实操下,增强动手能力才是掌握技术的关键。欢迎大家留言区讨论探讨~