麒麟系统配置gbase8s ssl环境

生成数字证书

​ 1.下载官方ssl证书

​ 下载 https://gbasedbt.com/dl/GBase8s-Certs/gbasedbt_certs.tar

​ 2.通过openssl 生成

​ 参考地址:https://www.gbase.cn/community/post/4535

下面使用官方ssl证书

解压文件官方ssl证书到 /home/gbasedbt/hdr35/certs

1.里面有sysdba用户数据证书, 后续测试可以创建此用户进行验证使用. 验证密码: 11111111

数据库服务端配置项

配置 /home/gbasedbt/hdr35/etc/sqlhosts.gbaseserver.ext

完整示例如下

#**************************************************************************
#
#                          GBASE.
#
#                             PROPRIETARY DATA
#
#       THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
#       GBASE.  THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
#       CONFIDENCE.  INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
#       DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
#       SIGNED BY AN OFFICER OF GBASE.
#
#       THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
#       SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
#       UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
#
#
#   Title:      sqlhosts.ext.std
#   Description:
#               Sample sqlhosts.ext file
#
#**************************************************************************

#**************************************************************************
# Content
# Introduction
# Chapter 1, IDS <-> CSDK
#         1.1, IDS's sqlhosts.***.ext
#         1.2, CSDK's sqlhosts.***.ext
#
# Chapter 2, HA(include HDR, SDS, RSS). Here, take RSS as an example.
#         2.1, rss1's sqlhosts.***.ext
#         2.2, rss2's sqlhosts.***.ext
#         2.3, CSDK's sqlhosts.***.ext
#
# Chapter 3, HA + CM
#         3.1, cm1's sqlhosts.***.ext
#         3.2, cm2's sqlhosts.***.ext
#         3.3, rss1's sqlhosts.***.ext
#         3.4, rss2's sqlhosts.***.ext
#         3.5, CSDK's sqlhosts.***.ext 
#**************************************************************************

#**************************************************************************
# Introduction
#
# Each computer that hosts a database server or a client must include connectivity
# information. The sqlhosts information contains connectivity information for 
# each database server. For the detail of sqlhosts, please reference to 
# Administrator's Guide.
#
# If the nettype of sqlhosts item is onsocssl, we should add ssl information for
# the connection. Now, the information should be written in $(GBASEDBTSQLHOSTS).ext.
#**************************************************************************

#**************************************************************************
# Chapter 1, IDS <-> CSDK
#
# The ids's sqlhosts is sqlhosts.ids_instance_name. The file's content is:
#   ids_instance_name onsocssl 172.16.2.104 27001

     gbaseserver_ssl onsocssl 192.168.1.221 9089
#
# The csdk's sqlhosts is sqlhosts.csdk. The file's content is same with
# sqlhosts.ids_instance_name.
#**************************************************************************

#**************************************************************************
#         1.1, IDS's sqlhosts.***.ext
#
# The file's name should be sqlhosts.ids_instance_name.ext. 
# In the file, TLSCertificateKeyFilePasswd is in cipher text. Use gbspwdenc 
# can convert TLSCertificateKeyFilePasswd from plain text into cipher text.
#
# The file's content is:
[config]
GBS_TYPE=gbasessl

[gbaseserver_ssl]
server=gbaseserver_ssl_server
client=gbaseserver_ssl_client

[gbaseserver_ssl_server]
TLSCACertificateFile=/home/gbasedbt/hdr35/certs/ca/ca-cert.pem
TLSCertificateFile=/home/gbasedbt/hdr35/certs/server/server-cert.pem
TLSCertificateKeyFile=/home/gbasedbt/hdr35/certs/server/server-key.pem
TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
TLSVerifyCert=never

[gbaseserver_ssl_client]
TLSCACertificateFile=/home/gbasedbt/hdr35/certs/ca/ca-cert.pem
TLSCertificateFile=/home/gbasedbt/hdr35/certs/dba1/dba1-cert.pem
TLSCertificateKeyFile=/home/gbasedbt/hdr35/certs/dba1/dba1-key.pem
TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
TLSVerifyCert=never

#**************************************************************************

#**************************************************************************
#         1.2, CSDK's sqlhosts.***.ext
#
# The file's name should be sqlhosts.csdk.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
#
# [ids_instance_name]
# client=client_cfg
#
# [client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=verify
#
#**************************************************************************

#**************************************************************************
# Chapter 2, HA(include HDR, SDS, RSS). Here, take RSS as an example.
#
# The rss1's sqlhosts is sqlhosts.rss1. The file's content is:
#   rss1 onsocssl 172.16.2.104 25881
#   rss2 onsocssl 192.168.6.231 26881
#
# The rss2's sqlhosts is sqlhosts.rss2. The file's content is same with
# sqlhosts.rss1
#
# The csdk's sqlhosts is sqlhosts.csdk. The file's content is same with
# sqlhosts.rss1
#
#**************************************************************************

#**************************************************************************
#         2.1, rss1's sqlhosts.***.ext
# The file's name should be sqlhosts.rss1.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl

# [rss1]
# server=rss1_server_cfg
# client=rss1_client_cfg

# [rss1_server_cfg]
# TLSCertificateFile=/opt/rss1/security/server.pem
# TLSCertificateKeyFile=/opt/rss1/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never

# [rss1_client_cfg]
# TLSCACertificateFile=/opt/rss1/security/total.pem
# TLSVerifyCert=verify

# [rss2]
# client=rss2_client

# [rss2_client]
# TLSCACertificateFile=/opt/rss1/security/total.pem
# TLSVerifyCert=verify
#**************************************************************************

#**************************************************************************
#         2.2, rss2's sqlhosts.***.ext
# The file's name should be sqlhosts.rss2.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
#
# [rss2]
# server=rss2_server_cfg
# client=rss2_client_cfg
#
# [rss2_server_cfg]
# TLSCertificateFile=/opt/rss2/security/server.pem
# TLSCertificateKeyFile=/opt/rss2/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never
#
# [rss2_client_cfg]
# TLSCACertificateFile=/opt/rss2/security/total.pem
# TLSVerifyCert=verify
#
# [rss1]
# client=rss1_client_cfg
#
# [rss1_client_cfg]
# TLSCACertificateFile=/opt/rss2/security/total.pem
# TLSVerifyCert=verify
#**************************************************************************

#**************************************************************************
#         2.3, CSDK's sqlhosts.***.ext
# The file's name should be sqlhosts.csdk.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
#
# [rss1]
# client=rss1_client_cfg
#
# [rss1_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=verify
#
# [rss2]
# client=rss2_client_cfg
#
# [rss2_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=verify
#**************************************************************************

#**************************************************************************
# Chapter 3, HA + CM
#
# The cm1's sqlhosts is sqlhosts.cm1. The file's content is:
#   db_group  group         -       -       i=10,c=1
#   rss1 onsoctcp 172.16.2.104 25881 g=db_group
#   rss2 onsocssl 192.168.6.231 26881 g=db_group
#
#   cm1 onsocssl  172.16.2.104  15881 g=cm_group
#
# The cm2's sqlhosts is sqlhosts.cm2. The file's content is:
#   db_group  group         -       -       i=10,c=1
#   rss1 onsoctcp 172.16.2.104 25881 g=db_group
#   rss2 onsocssl 192.168.6.231 26881 g=db_group
#
#   cm2 onsocssl  172.16.2.104  15882 g=cm_group
#
# The rss1's sqlhosts is sqlhosts.rss1. The file's content is:
#   rss1 onsocssl 172.16.2.104 25881
#   rss2 onsocssl 192.168.6.231 26881
#
# The rss2's sqlhosts is sqlhosts.rss2. The file's content is same with
# sqlhosts.rss1.
#
# The csdk's sqlhosts is sqlhosts.csdk. The file's content is:
#   db_group  group         -       -       i=10,c=1
#   rss1 onsoctcp 172.16.2.104 25881 g=db_group
#   rss2 onsocssl 192.168.6.231 26881 g=db_group
#    
#   cm_group  group         -       -       i=10,c=1
#   cm1 onsocssl  172.16.2.104  15881 g=cm_group
#   cm2 onsocssl  172.16.2.104  15882 g=cm_group
#
#**************************************************************************

#**************************************************************************
#         3.1, cm1's sqlhosts.***.ext
# The file's name should be sqlhosts.cm1.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
# 
# [rss1]
# client=rss1_client_cfg
# 
# [rss1_client_cfg]
# TLSCACertificateFile=/opt/cm1/security/total.pem
# TLSVerifyCert=verify

# [rss2]
# client=rss2_client_cfg

# [rss2_client_cfg]
# TLSCACertificateFile=/opt/cm1/security/total.pem
# TLSVerifyCert=verify

# [cm1]
# server=cm1_server_cfg
# client=cm1_client_cfg

# [cm1_server_cfg]
# TLSCertificateFile=/opt/cm1/security/server.pem
# TLSCertificateKeyFile=/opt/cm1/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never

# [cm1_client_cfg]
# TLSCACertificateFile=/opt/cm1/security/total.pem
# TLSVerifyCert=never
#
#**************************************************************************

#**************************************************************************
#         3.2, cm2's sqlhosts.***.ext
# The file's name should be sqlhosts.cm2.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
# 
# [rss1]
# client=rss1_client_cfg
# 
# [rss1_client_cfg]
# TLSCACertificateFile=/opt/cm2/security/total.pem
# TLSVerifyCert=verify

# [rss2]
# client=rss2_client_cfg

# [rss2_client_cfg]
# TLSCACertificateFile=/opt/cm2/security/total.pem
# TLSVerifyCert=verify

# [cm2]
# server=cm2_server_cfg
# client=cm2_client_cfg

# [cm2_server_cfg]
# TLSCertificateFile=/opt/cm2/security/server.pem
# TLSCertificateKeyFile=/opt/cm2/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never

# [cm2_client_cfg]
# TLSCACertificateFile=/opt/cm2/security/total.pem
# TLSVerifyCert=never
#
#**************************************************************************

#**************************************************************************
#         3.3, rss1's sqlhosts.***.ext
# The file's name should be sqlhosts.rss1.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl

# [rss1]
# server=rss1_server_cfg
# client=rss1_client_cfg

# [rss1_server_cfg]
# TLSCertificateFile=/opt/rss1/security/server.pem
# TLSCertificateKeyFile=/opt/rss1/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never

# [rss1_client_cfg]
# TLSCACertificateFile=/opt/rss1/security/total.pem
# TLSVerifyCert=verify

# [rss2]
# client=rss2_client

# [rss2_client]
# TLSCACertificateFile=/opt/rss1/security/total.pem
# TLSVerifyCert=verify
#**************************************************************************

#**************************************************************************
#         3.4, rss2's sqlhosts.***.ext
# The file's name should be sqlhosts.rss2.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl

# [rss2]
# server=rss2_server_cfg
# client=rss2_client_cfg

# [rss2_server_cfg]
# TLSCertificateFile=/opt/rss2/security/server.pem
# TLSCertificateKeyFile=/opt/rss2/security/server.key
# TLSCertificateKeyFilePasswd=DqOUlNa1c2OMcEEbvTG30w==
# TLSVerifyCert=never

# [rss2_client_cfg]
# TLSCACertificateFile=/opt/rss2/security/total.pem
# TLSVerifyCert=verify

# [rss1]
# client=rss1_client_cfg

# [rss1_client_cfg]
# TLSCACertificateFile=/opt/rss2/security/total.pem
# TLSVerifyCert=verify
#**************************************************************************

#**************************************************************************
#         3.5, CSDK's sqlhosts.***.ext 
# The file's name should be sqlhosts.csdk.ext. The file's content is:
# [config]
# GBS_TYPE=gbasessl
#
# [rss1]
# client=rss1_client_cfg
#
# [rss1_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=verify
#
# [rss2]
# client=rss2_client_cfg
#
# [rss2_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=verify
#
# [cm1]
# client=cm1_client_cfg
#
# [cm2_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=never
#
# [cm2]
# client=cm2_client_cfg
#
# [cm2_client_cfg]
# TLSCACertificateFile=/opt/csdk/security/total.pem
# TLSVerifyCert=never
#**************************************************************************


配置 /home/gbasedbt/hdr35/etc/sqlhosts.gbaseserver

gbaseserver onsoctcp 192.168.1.221 9088
gbaseserver_ssl onsocssl 192.168.1.221 9089

配置 /home/gbasedbt/hdr35/etc/onconfig.gbaseserver

修改 G B A S E D B T D I R / e t c / GBASEDBTDIR/etc/ GBASEDBTDIR/etc/ONCONFIG 配置文件,配置参数。
1)使 同 一 实 例 同 时 支 持 普 通 通 讯 方 式 和 加 密 通 讯 方 式 : 通 过 设 置DBSERVERALIASES 来增加服务的别名,这样可以在 sqlhosts 配置文件中设
置当前服务支持多种类型的连接,如下示例中实例名 gbase01、gbase01_ssl都为当前数据库服务实例名,但是在 sqlhosts 配置文件中可以配置为不同的
连接类型,这样客户端就可以通过多种通信方式与数据库服务通信:

DBSERVERNAME gbaseserver
DBSERVERALIASES gbaseserver_ssl

2)配置支持通讯加密的 VP:数据库加密和解密操作将由 Encrypt VP 执行。通过 VPCLASS 来配置该类型 VP 的属性;

如果未配置 VPCLASS,则 Server会默认启动一个 Encrypt VP。

VPCLASS encrypt,num=1

3)配置支持通讯加密的连接方式:设置 NETTYPE 来配置数据库连接的轮询线程和每个线程的连接数。

如果未配置轮询线程,则 Server 将启动一个轮询线程。

NETTYPE socssl,1,50,NET

完整示例如下

##################################################################
# Licensed Material - Property Of GBASE 
#
# "Restricted Materials of GBASE"
#
# GBase
# Copyright General Data Corp. 2014, 2015. All rights reserved.
#
# Title: onconfig.std
# Description: GBase Configuration Parameters
#
# Important: $GBASEDBTDIR now resolves to the environment
# variable GBASEDBTDIR. Replace the value of the GBASEDBTDIR  
# environment variable only if the path you want is not under 
# $GBASEDBTDIR.
#
# For additional information on the parameters:
# http://www.gbase.cn
###################################################################

###################################################################
# Root Dbspace Configuration Parameters
###################################################################
# ROOTNAME     - The root dbspace name to contain reserved pages and
#                internal tracking tables.
# ROOTPATH     - The path for the device containing the root dbspace
# ROOTOFFSET   - The offset, in KB, of the root dbspace into the 
#                device. The offset is required for some raw devices. 
# ROOTSIZE     - The size of the root dbspace, in KB.  The value of 
#                200000 allows for a default user space of about 
#                100 MB and the default system space requirements.
# MIRROR       - Enable (1) or disable (0) mirroring
# MIRRORPATH   - The path for the device containing the mirrored 
#                root dbspace
# MIRROROFFSET - The offset, in KB, into the mirrored device 
#
# Warning: Always verify ROOTPATH before performing
#          disk initialization (oninit -i or -iy) to
#          avoid disk corruption of another instance
###################################################################

ROOTNAME rootdbs
ROOTPATH /home/gbasedbt/hdr35/gbaseserver_dbs/rootdbs 
ROOTOFFSET 0
ROOTSIZE 204800 
MIRROR 0
MIRRORPATH $GBASEDBTDIR/tmp/demo_on.root_mirror
MIRROROFFSET 0

###################################################################
# Physical Log Configuration Parameters
###################################################################
# PHYSFILE           - The size, in KB, of the physical log on disk.
#                      If RTO_SERVER_RESTART is enabled, the 
#                      suggested formula for the size of PHSYFILE 
#                      (up to about 1 GB) is:
#                          PHYSFILE = Size of BUFFERS * 1.1
# PLOG_OVERFLOW_PATH - The directory for extra physical log files
#                      if the physical log overflows during recovery
#                      or long transaction rollback
# PHYSBUFF           - The size of the physical log buffer, in KB
###################################################################

PHYSFILE        1017856         
PLOG_OVERFLOW_PATH  $GBASEDBTDIR/tmp
PHYSBUFF 2048 

###################################################################
# Logical Log Configuration Parameters
###################################################################
# LOGFILES 3 
# LOGSIZE      - The size of each logical log, in KB
# DYNAMIC_LOGS - The type of dynamic log allocation.
#                Acceptable values are:
#                2 Automatic. GBase adds a new logical log to the
#                  root dbspace when necessary.
#                1 Manual. GBase notifies the DBA to add new logical
#                  logs when necessary.
#                0 Disabled
# LOGBUFF      - The size of the logical log buffer, in KB
###################################################################

LOGFILES        40              
LOGSIZE 10000
DYNAMIC_LOGS 2
LOGBUFF 1024 

###################################################################
# Long Transaction Configuration Parameters
###################################################################
# If GBase cannot roll back a long transaction, the server hangs
# until more disk space is available.
#
# LTXHWM       - The percentage of the logical logs that can be
#                filled before a transaction is determined to be a
#                long transaction and is rolled back
# LTXEHWM      - The percentage of the logical logs that have been
#                filled before the server suspends all other
#                transactions so that the long transaction being 
#                rolled back has exclusive use of the logs
#
# When dynamic logging is on, you can set higher values for
# LTXHWM and LTXEHWM because the server can add new logical logs
# during long transaction rollback. Set lower values to limit the 
# number of new logical logs added.
#
# If dynamic logging is off, set LTXHWM and LTXEHWM to
# lower values, such as 50 and 60 or lower, to prevent long 
# transaction rollback from hanging the
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值