華為高斯 GaussDB 100 OLTP 單機在 RHEL 7.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)

操作系統安裝

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=1888

Checking 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 file
Initialize db instance.
Creating database.
Creating database succeed.
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 start
Zengine instance has already started.
[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> 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 stop
Successfully stopped instance.
[omm@henry bin]$ python zctl.py -t start
Successfully 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;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM