第二講:GaussDB 100 OLTP 單機在RHEL7.6上的安裝

在第一講的分享中,我們揭開了華為GuassDB數(shù)據(jù)庫的神秘面紗,那么本期我們繼續(xù)分享第二講——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 操作系統(tǒng)安裝

參考?RHEL 7.6 安裝

GaussDB 100安裝

01

環(huán)境設(shè)置

關(guān)閉Selinux

vim /etc/selinux/config

修改 SELINUX=enforcing 為 SELINUX=disabled

關(guān)閉防火墻

systemctl?stop?firewalld.service

systemctl?disable?firewalld.service

編輯環(huán)境變量

[root@henry ~]# vim /etc/profile

添加 ulimit -c unlimited

刷新環(huán)境變量

[root@henry ~]# source /etc/profile

編輯內(nèi)核參數(shù)

[root@henry ~]# vim /etc/sysctl.conf?

添加 kernel.core_pattern = /corefile/core-%e-%p-%t

刷新內(nèi)核參數(shù)

[root@henry ~]# sysctl -p

02

創(chuàng)建用戶組/用戶/文件夾

創(chuàng)建用戶組用戶

[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.

創(chuàng)建文件夾

[root@henry ~]# mkdir -p /opt/software/gaussdb

03

軟件上傳/解壓/安裝

上傳(略)

解壓

[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?database?succeed.Changing?file?permission due?to?security?audit.Install?successfully,?for?more detail information see

/home/omm/zengineinstall.log.

04

啟動數(shù)據(jù)庫

切換用戶

[root@henry GaussDB_100_1.0.1-DATABASE-REDHAT-64bit]# su - omm?

Last login: Thu Dec ?5 14:18:19 CST 2019

啟動數(shù)據(jù)庫并登陸

[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 連接

01

服務(wù)器環(huán)境設(shè)置

添加白名單

[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

重啟數(shù)據(jù)庫

[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.

創(chuàng)建數(shù)據(jù)庫用戶(默認無法通過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.

02

DataStudio連接及操作

注意:DataStudio開發(fā)工具需要JDK支持(請自行安裝JDK)

create?table?henry (id?number);insert?into?henry?values

(1);insert?into?henry?values?(2);commit;select?*?from?henry;

好了,我們今天的課就先講到這。同學(xué)們可以自己實操下,增強動手能力才是掌握技術(shù)的關(guān)鍵。歡迎大家留言區(qū)討論探討~

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容