1. 首页 > GBase教程 > 正文

GBase教程FG028-GBase运行平台与环境

本文档详细介绍GBase数据库的运行平台与环境,包括硬件平台、操作系统、网络环境、存储环境、虚拟化环境、云环境等内容。风哥教程参考GBase官方文档GBase运行环境要求、GBase平台支持指南等。

通过本文档,您将了解GBase数据库在不同平台和环境下的运行要求和最佳实践,为GBase数据库的部署和运行提供指导。

本文档适用于数据库管理员、系统工程师和IT运维人员,帮助您为GBase数据库选择和配置合适的运行平台与环境。

目录大纲

Part01-基础概念与理论知识

1.1 运行平台概述

GBase数据库的运行平台包括:

  • 硬件平台
    • x86服务器:Intel或AMD架构的服务器
    • ARM服务器:基于ARM架构的服务器
    • 小型机:如IBM Power、HP Integrity等
  • 操作系统平台
    • Linux:Red Hat Enterprise Linux、CentOS、Oracle Linux、麒麟操作系统、欧拉操作系统等
    • Windows:Windows Server等
    • Unix:AIX、HP-UX、Solaris等
  • 虚拟化平台
    • VMware ESXi
    • KVM
    • Xen
    • Hyper-V
  • 云平台
    • 公有云:阿里云、腾讯云、华为云等
    • 私有云:OpenStack、VMware vSphere等
    • 混合云:公有云与私有云的结合
  • 风哥提示:

1.2 环境要求

GBase数据库的环境要求:

  • 硬件要求
    • CPU
      • GBase 8a MPP Cluster:至少8核,推荐16核或更多
      • GBase 8s:至少4核,推荐8核或更多
      • GBase 8c:至少8核,推荐16核或更多
    • 内存
      • GBase 8a MPP Cluster:至少32GB,推荐64GB或更多
      • GBase 8s:至少16GB,推荐32GB或更多
      • GBase 8c:至少32GB,推荐64GB或更多
    • 存储
      • GBase 8a MPP Cluster:至少500GB,推荐1TB或更多,使用SSD或高速SAS硬盘
      • GBase 8s:至少200GB,推荐500GB或更多,使用SSD或高速SAS硬盘
      • GBase 8c:至少500GB,推荐1TB或更多,使用SSD或高速SAS硬盘
    • 网络:,学习交流加群风哥微信: itpux-com
      • GBase 8a MPP Cluster:至少10Gbps,推荐25Gbps或更高
      • GBase 8s:至少1Gbps,推荐10Gbps或更高
      • GBase 8c:至少10Gbps,推荐25Gbps或更高
  • 操作系统要求
    • Linux
      • Red Hat Enterprise Linux 7.x/8.x/9.x
      • CentOS 7.x/8.x
      • Oracle Linux 7.x/8.x/9.x
      • 麒麟操作系统 v10 SP3
      • 欧拉操作系统 20.03 LTS
    • Windows
      • Windows Server 2012 R2/2016/2019/2022
    • Unix
      • AIX 7.1/7.2
      • HP-UX 11i v3
      • Solaris 11
  • 网络环境要求
    • 网络带宽:根据数据库类型和规模选择合适的带宽
    • 网络延迟:尽量低,特别是对于集群环境
    • 网络稳定性:高可靠性,避免网络中断
    • 网络安全:配置防火墙,限制网络访问

    学习交流加群风哥QQ113257174

  • 存储环境要求
    • 存储类型:根据性能需求选择合适的存储类型
    • 存储容量:根据数据量和增长预期规划足够的容量
    • 存储性能:满足数据库的I/O需求
    • 存储可靠性:使用RAID技术,提高存储可靠性

1.3 平台兼容性

GBase数据库的平台兼容性:

  • 硬件平台兼容性
    • x86架构:完全兼容,是GBase数据库的主要运行平台
    • ARM架构:部分版本支持,如GBase 8s和GBase 8c
    • 小型机:部分版本支持,如GBase 8s
  • 操作系统兼容性
    • Linux:完全兼容,是GBase数据库的主要运行平台
    • Windows:部分版本支持,如GBase 8s
    • Unix:部分版本支持,如GBase 8s
  • 虚拟化平台兼容性
    • VMware ESXi:完全兼容
    • KVM:完全兼容
    • Xen:部分兼容
    • Hyper-V:部分兼容
  • 云平台兼容性
    • 阿里云:完全兼容,提供GBase数据库云服务
    • 腾讯云:完全兼容,提供GBase数据库云服务
    • 更多视频教程www.fgedu.net.cn

    • 华为云:完全兼容,提供GBase数据库云服务
    • 其他云平台:部分兼容,需要根据具体情况测试

风哥提示:GBase数据库的平台兼容性是选择运行环境的重要考虑因素。在选择平台时,应风哥教程参考GBase官方文档的平台支持列表,确保所选平台与GBase数据库版本兼容。

Part02-生产环境规划与建议

2.1 硬件平台规划

硬件平台规划建议:

  • 服务器类型选择
    • 根据业务需求选择合适的服务器类型,如机架式、刀片式或塔式服务器
    • 考虑服务器的扩展性,预留足够的升级空间
    • 选择具有良好可靠性和售后服务的服务器品牌
  • CPU规划
    • 根据数据库类型和规模选择合适的CPU核心数和主频
    • GBase 8a MPP Cluster推荐使用高核心数的CPU,如Intel Xeon Gold或AMD EPYC
    • GBase 8s推荐使用高性能的CPU,如Intel Xeon或AMD EPYC
  • 内存规划
    • 根据数据库类型和数据量选择合适的内存容量
    • GBase 8a MPP Cluster推荐64GB或更多内存
    • GBase 8s推荐32GB或更多内存
    • 确保内存与CPU的比例合理,避免内存瓶颈
  • 存储规划
    • 根据数据量和性能需求选择合适的存储类型和容量
    • 使用SSD存储提高I/O性能,特别是对于OLTP场景
    • 更多学习教程公众号风哥教程itpux_com

    • 配置RAID 10提高存储可靠性和性能
    • 预留足够的存储空间,考虑数据增长和备份需求
  • 网络规划
    • 根据数据库类型和规模选择合适的网络带宽
    • GBase 8a MPP Cluster推荐使用25Gbps或更高的网络
    • 配置冗余网络链路,提高网络可靠性
    • 使用网络绑定(bonding)或团队(team)提高网络带宽和可靠性

2.2 操作系统规划

操作系统规划建议:

  • 操作系统选择
    • 优先选择Linux操作系统,如Red Hat Enterprise Linux或Oracle Linux
    • 考虑使用国产操作系统,如麒麟操作系统或欧拉操作系统
    • 选择GBase数据库支持的操作系统版本
    • 优先选择长期支持(LTS)版本,确保系统稳定性
  • 操作系统配置
    • 优化内核参数,如内存管理、网络配置和文件系统参数
    • 关闭不必要的系统服务,减少系统开销
    • from DB视频:www.itpux.com

    • 配置合适的文件系统,如xfs
    • 启用大内存页,提高内存访问性能
    • 关闭透明大页和NUMA,避免性能问题
  • 安全配置
    • 配置防火墙,限制网络访问
    • 调整SELinux模式,平衡安全性和可用性
    • 定期更新系统补丁,修复安全漏洞
    • 配置系统日志,便于故障排查
  • 时间同步配置
    • 配置NTP服务,确保系统时间准确
    • 选择可靠的NTP服务器
    • 定期检查时间同步状态

2.3 网络环境规划

网络环境规划建议:

  • 网络架构设计
    • 设计合理的网络拓扑结构,如核心-汇聚-接入三层架构
    • 将网络分为不同的网段,如业务网段、管理网段和存储网段
    • 配置VLAN,隔离不同类型的流量
  • 网络设备选择
    • 选择高性能、高可靠性的网络设备,如交换机和路由器
    • GBase 8a MPP Cluster推荐使用25Gbps或更高的交换机
    • 配置冗余网络设备,提高网络可靠性
  • 网络参数配置
    • 优化网络参数,如MTU、TCP窗口大小等
    • 配置QoS,优先保障数据库流量
    • 启用jumbo frames,提高网络传输效率
  • 网络安全
    • 配置防火墙规则,限制网络访问
    • 使用加密传输,保护数据安全
    • 部署入侵检测系统,监控网络安全

2.4 存储环境规划

存储环境规划建议:

  • 存储类型选择
    • 根据性能需求选择合适的存储类型,如SSD、SAS或NL-SAS
    • OLTP场景推荐使用SSD存储,提高I/O性能
    • OLAP场景可以使用SAS存储,平衡性能和成本
  • 存储架构选择
    • 小型部署可以使用直连存储(DAS)
    • 中大型部署推荐使用存储区域网络(SAN)或网络附加存储(NAS)
    • 云环境可以使用云存储服务
  • RAID配置
    • 推荐使用RAID 10,提高存储性能和可靠性
    • 根据存储容量和性能需求选择合适的RAID级别
    • 配置热备盘,提高存储可靠性
  • 存储分区规划
    • 合理规划存储分区,分离系统、数据和日志
    • 为数据库数据和日志分配独立的分区
    • 预留足够的存储空间,考虑数据增长和备份需求
  • 存储监控
    • 部署存储监控工具,实时监控存储状态
    • 配置存储告警机制,及时发现和处理存储问题
    • 定期检查存储性能和健康状态

Part03-生产环境项目实施方案

3.1 平台搭建

平台搭建步骤:

# 平台搭建
## 1. 物理服务器平台搭建
– 服务器硬件准备:
– 选择合适的服务器硬件
– 安装服务器到机柜
– 连接电源、网络和存储 cables

– 服务器初始化:
– 配置服务器BIOS/UEFI
– 配置RAID阵列
– 安装操作系统

– 网络配置:
– 配置网络接口
– 配置网络设备
– 测试网络连通性

## 2. 虚拟化平台搭建
– 虚拟化环境准备:
– 选择合适的虚拟化平台,如VMware ESXi或KVM
– 安装虚拟化软件
– 配置虚拟化环境

– 虚拟机创建:
– 创建虚拟机,配置CPU、内存和存储
– 安装操作系统
– 配置网络

– 虚拟机优化:
– 优化虚拟机参数
– 配置虚拟机资源限制
– 测试虚拟机性能

## 3. 云平台搭建
– 云环境准备:
– 选择合适的云平台,如阿里云、腾讯云或华为云
– 注册云服务账号
– 配置云资源

– 云服务器创建:
– 创建云服务器实例
– 配置服务器参数
– 安装操作系统

– 云服务配置:
– 配置云存储
– 配置云网络
– 配置云安全

## 4. 平台验证
– 硬件平台验证:
– 测试服务器硬件状态
– 测试服务器性能
– 测试服务器可靠性

– 操作系统验证:
– 测试操作系统功能
– 测试操作系统性能
– 测试操作系统稳定性

– 网络环境验证:
– 测试网络连通性
– 测试网络性能
– 测试网络可靠性

– 存储环境验证:
– 测试存储连接
– 测试存储性能
– 测试存储可靠性

3.2 环境配置

环境配置步骤:

# 环境配置
## 1. 操作系统配置
– 内核参数配置:
– 编辑/etc/sysctl.conf文件
– 添加或修改内核参数
– 应用内核参数更改

– 文件系统配置:
– 配置磁盘分区
– 格式化文件系统
– 挂载文件系统
– 配置文件系统参数

– 系统服务配置:
– 启用必要的系统服务
– 禁用不必要的系统服务
– 配置服务启动顺序

– 安全配置:
– 配置防火墙
– 调整SELinux模式
– 配置用户和权限

## 2. 网络配置
– 网络接口配置:
– 配置网络接口IP地址
– 配置默认网关和DNS服务器
– 配置网络接口参数

– 网络设备配置:
– 配置交换机端口和VLAN
– 配置路由器路由表
– 配置防火墙规则

– 网络性能优化:
– 调整网络参数
– 配置QoS
– 启用jumbo frames

## 3. 存储配置
– 存储设备配置:
– 配置存储阵列
– 创建存储卷
– 配置RAID级别

– 存储连接配置:
– 连接服务器到存储设备
– 配置存储多路径
– 测试存储连接

– 存储性能优化:
– 调整存储参数
– 配置存储缓存
– 测试存储性能

## 4. 监控配置
– 系统监控配置:
– 安装系统监控工具
– 配置监控指标和阈值
– 配置告警机制

– 网络监控配置:
– 安装网络监控工具
– 配置网络监控指标
– 配置网络告警

– 存储监控配置:
– 安装存储监控工具
– 配置存储监控指标
– 配置存储告警

## 5. 环境验证
– 系统验证:
– 测试系统功能
– 测试系统性能
– 测试系统稳定性

– 网络验证:
– 测试网络连通性
– 测试网络性能
– 测试网络可靠性

– 存储验证:
– 测试存储连接
– 测试存储性能
– 测试存储可靠性

3.3 平台验证

平台验证步骤:

# 平台验证
## 1. 硬件平台验证
– 服务器硬件测试:
– 使用硬件诊断工具测试服务器硬件
– 测试CPU性能
– 测试内存性能
– 测试存储性能
– 测试网络性能

– 硬件可靠性测试:
– 长时间运行测试
– 压力测试
– 故障注入测试

## 2. 操作系统验证
– 操作系统功能测试:
– 测试系统启动和关闭
– 测试系统服务
– 测试系统命令

– 操作系统性能测试:
– 测试CPU使用率
– 测试内存使用率
– 测试磁盘I/O
– 测试网络吞吐量

– 操作系统稳定性测试:
– 长时间运行测试
– 压力测试
– 系统更新测试

## 3. 网络环境验证
– 网络连通性测试:
– 测试服务器之间的连通性
– 测试服务器与外部网络的连通性
– 测试网络设备的连通性

– 网络性能测试:
– 测试网络带宽
– 测试网络延迟
– 测试网络吞吐量

– 网络可靠性测试:
– 长时间运行测试
– 网络故障切换测试
– 网络压力测试

## 4. 存储环境验证
– 存储连接测试:
– 测试服务器与存储设备的连接
– 测试存储设备的状态
– 测试存储多路径功能

– 存储性能测试:
– 测试存储读写速度
– 测试存储IOPS
– 测试存储延迟

– 存储可靠性测试:
– 长时间运行测试
– 存储故障切换测试
– 存储压力测试

## 5. 平台整体验证
– 集成测试:
– 测试平台各组件的协同工作
– 测试平台的整体性能
– 测试平台的整体可靠性

– 负载测试:
– 模拟实际业务负载
– 测试平台在负载下的表现
– 测试平台的扩展性

– 故障恢复测试:
– 模拟各种故障场景
– 测试平台的故障恢复能力
– 测试平台的灾难恢复能力

Part04-生产案例与实战讲解

4.1 物理服务器环境实战

物理服务器环境实战:

# GBase 8a MPP集群物理服务器环境实战
# 1. 服务器硬件配置
# 服务器型号:Dell PowerEdge R750
# CPU:Intel Xeon Gold 6330 20核
# 内存:256GB DDR4
# 存储:4×1.92TB SSD + 2×4TB SAS
# 网络:2×25Gbps NIC
# 2. 存储配置
# 配置RAID 10:4×1.92TB SSD
# 配置RAID 1:2×4TB SAS
# 3. 操作系统安装
# 安装Oracle Linux 8.9
# 分区方案:
# /boot:500MB
# /:50GB
# /gbase:剩余空间(用于GBase数据库)
# 4. 内核参数配置
# 编辑/etc/sysctl.conf文件
vi /etc/sysctl.conf
# 添加以下内核参数
cat >> /etc/sysctl.conf
<< EOF # GBase数据库内核参数 net.core.somaxconn=65535 net.ipv4.tcp_max_syn_backlog=65535 net.ipv4.tcp_fin_timeout=30 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_tw_recycle=1 net.ipv4.ip_local_port_range=1024 65535 vm.swappiness=10 vm.max_map_count=262144 fs.file-max=6815744 kernel.sem=250 32000 100 128 kernel.shmmni=4096 kernel.shmall=1073741824 kernel.shmmax=4398046511104 EOF # 应用内核参数 sysctl -p # 5. 网络配置 # 配置网络接口 vi /etc/sysconfig/network-scripts/ifcfg-ens192 # 添加以下配置 cat> /etc/sysconfig/network-scripts/ifcfg-ens192
<< EOF TYPE=Ethernet BOOTPROTO=static NAME=ens192 DEVICE=ens192 ONBOOT=yes IPADDR=192.168.1.10 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=192.168.1.5 EOF # 配置网络绑定 # 创建bond接口 cat> /etc/sysconfig/network-scripts/ifcfg-bond0
<< EOF TYPE=Bond NAME=bond0 DEVICE=bond0 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.2.10 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 BONDING_OPTS="mode=4 miimon=100" EOF # 配置物理接口 cat> /etc/sysconfig/network-scripts/ifcfg-ens224
<< EOF TYPE=Ethernet BOOTPROTO=none NAME=ens224 DEVICE=ens224 ONBOOT=yes MASTER=bond0 SLAVE=yes EOF cat> /etc/sysconfig/network-scripts/ifcfg-ens256
<< EOF TYPE=Ethernet BOOTPROTO=none NAME=ens256 DEVICE=ens256 ONBOOT=yes MASTER=bond0 SLAVE=yes EOF # 重启网络服务 nmcli connection reload nmcli connection up bond0 # 6. 平台验证 # 测试服务器硬件性能 # 测试CPU性能 stress-ng --cpu 20 --cpu-method all --metrics-brief --timeout 60s # 测试内存性能 sysbench memory --memory-block-size=1K --memory-total-size=100G --memory-access-mode=rnd run # 测试存储性能 sysbench fileio --file-total-size=100G --file-test-mode=seqwr --file-num=64 --file-extra-flags=direct --time=60 run # 测试网络性能 iperf3 -s & iperf3 -c 192.168.1.10 -t 60 -P 16 # 测试操作系统功能 # 测试系统服务 systemctl status sshd ntpd # 测试系统命令 ls -la / df -h free -h # 测试网络连通性 ping -c 5 192.168.1.1 ping -c 5 192.168.2.1 ping -c 5 www.baidu.com

# 应用内核参数输出
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65535
vm.swappiness = 10
vm.max_map_count = 262144
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104

# 网络接口配置输出
# ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: mtu 1500 qdisc mq state UP
group default qlen 1000
link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 fe80::211:22ff:fe33:4455/64 scope link
valid_lft forever preferred_lft forever
3: ens224: mtu 1500 qdisc mq
master bond0 state UP group default qlen 1000
link/ether 00:11:22:33:44:66 brd ff:ff:ff:ff:ff:ff
4: ens256: mtu 1500 qdisc mq
master bond0 state UP group default qlen 1000
link/ether 00:11:22:33:44:66 brd ff:ff:ff:ff:ff:ff
5: bond0: mtu 1500
qdisc noqueue state UP group default qlen 1000
link/ether 00:11:22:33:44:66 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.10/24 brd 192.168.2.255 scope global
noprefixroute bond0
valid_lft forever preferred_lft forever
inet6 fe80::211:22ff:fe33:4466/64 scope link
valid_lft forever preferred_lft forever

# 测试CPU性能输出
stress-ng: info: [12345] dispatching hogs: 20 cpu
stress-ng: info: [12345] successful run completed in 60.01s
stress-ng: info: [12345] metrics: 20 cpu, 60.01s,
2000.00ms/cpu, 40000.00ms total

# 测试内存性能输出
sysbench 1.0.20 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Running memory speed test with the following options:
block size: 1K
total size: 100G
access mode: random
memory type: RAM
scope: global

Initializing worker threads…

Threads started!

Total operations: 104857600 (1747627.37 ops/sec)

102400.00 MB transferred (1706.67 MB/sec)

Test execution summary:
total time: 60.0015s
total number of events: 104857600
total time taken by event execution: 59.9998
per-request statistics:
min: 0.00ms
avg: 0.00ms
max: 0.10ms
approx. 95th percentile: 0.00ms

Threads fairness:
events (avg/stddev): 104857600.0000/0.00
execution time (avg/stddev): 59.9998/0.00

# 测试存储性能输出
sysbench 1.0.20 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Extra file open flags: direct
128 files, 8192Kb each, 1024Mb total
Creating files for the test…
Extra file open flags: direct
Creating file test_file.0

Creating file test_file.127
1024Mb written in 0.95 seconds (1073.68 MB/sec)

Running file I/O test with the following options:
file size: 1024Mb
number of files: 128
block size: 16Kb
number of IO requests: 10000
read/write ratio: 0.50
periodic FSYNC enabled, calling fsync() each 100 requests
using synchronous I/O mode
doing sequential write test

Initializing worker threads…

Threads started!

File operations:
reads/s: 0.00
writes/s: 12500.00
fsyncs/s: 125.00

Throughput:
read, MiB/s: 0.00
written, MiB/s: 195.31

General statistics:
total time: 0.8000s
total number of events: 10000
total time taken by event execution: 0.7996
per-request statistics:
min: 0.05ms
avg: 0.08ms
max: 0.20ms
approx. 95th percentile: 0.10ms

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 0.7996/0.00

# 测试网络性能输出
Connecting to host 192.168.1.10, port 5201
[ 5] local 192.168.1.11 port 56789 connected to 192.168.1.10
port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 2.84 GBytes 24.5 Gbits/sec 0 849 KBytes
[ 5] 1.00-2.00 sec 2.85 GBytes 24.6 Gbits/sec 0 849 KBytes

[ 5] 59.00-60.00 sec 2.85 GBytes 24.6 Gbits/sec 0 849 KBytes
– – – – – – – – – – – – – – – – – – – – – – – – – –
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-60.00 sec 171 GBytes 24.5 Gbits/sec 0 sender
[ 5] 0.00-60.00 sec 171 GBytes 24.5 Gbits/sec receiver

iperf Done.

# 测试系统服务输出
# systemctl status sshd ntpd
● sshd.service – OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service;
enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-01-01 10:00:00 CST;
1h ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1234 (sshd)
Tasks: 1
Memory: 10.0M
CPU: 100ms
CGroup: /system.slice/sshd.service
└─1234 /usr/sbin/sshd -D

● ntpd.service – Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service;
enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-01-01 10:00:00 CST;
1h ago
Docs: man:ntpd(8)
Main PID: 5678 (ntpd)
Tasks: 1
Memory: 5.0M
CPU: 50ms
CGroup: /system.slice/ntpd.service
└─5678 /usr/sbin/ntpd -u ntp:ntp -g

# 测试网络连通性输出
# ping -c 5 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.500 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.450 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.420 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.480 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.430 ms

— 192.168.1.1 ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 0.420/0.456/0.500/0.030 ms

# ping -c 5 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.520 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.480 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.450 ms
64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=0.500 ms
64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=0.470 ms

— 192.168.2.1 ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 0.450/0.484/0.520/0.026 ms

# ping -c 5 www.baidu.com
PING www.a.shifen.com (180.101.49.11) 56(84) bytes of data.
64 bytes from 180.101.49.11 (180.101.49.11): icmp_seq=1
ttl=54 time=10.2 ms
64 bytes from 180.101.49.11 (180.101.49.11): icmp_seq=2
ttl=54 time=10.1 ms
64 bytes from 180.101.49.11 (180.101.49.11): icmp_seq=3
ttl=54 time=10.3 ms
64 bytes from 180.101.49.11 (180.101.49.11): icmp_seq=4
ttl=54 time=10.2 ms
64 bytes from 180.101.49.11 (180.101.49.11): icmp_seq=5
ttl=54 time=10.1 ms

— www.a.shifen.com ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 10.1/10.2/10.3/0.100 ms

4.2 虚拟化环境实战

虚拟化环境实战:

# GBase数据库虚拟化环境实战
# 1. 虚拟化平台搭建
# 安装VMware ESXi 7.0
# 配置ESXi主机
# 创建数据存储
# 2. 虚拟机创建
# 创建GBase 8a MPP集群虚拟机
# 虚拟机配置:
# 名称:gbase8a-coordinator1
# CPU:16核
# 内存:64GB
# 存储:500GB SSD
# 网络:2×10Gbps
# 3. 操作系统安装
# 安装Oracle Linux 8.9
# 分区方案:
# /boot:500MB
# /:50GB
# /gbase:剩余空间
# 4. 内核参数配置
# 编辑/etc/sysctl.conf文件
vi /etc/sysctl.conf
# 添加以下内核参数
cat >> /etc/sysctl.conf
<< EOF # GBase数据库内核参数 net.core.somaxconn=65535 net.ipv4.tcp_max_syn_backlog=65535 net.ipv4.tcp_fin_timeout=30 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_tw_recycle=1 net.ipv4.ip_local_port_range=1024 65535 vm.swappiness=10 vm.max_map_count=262144 fs.file-max=6815744 kernel.sem=250 32000 100 128 kernel.shmmni=4096 kernel.shmall=1073741824 kernel.shmmax=4398046511104 EOF # 应用内核参数 sysctl -p # 5. 虚拟化环境优化 # 优化VMware ESXi配置 # 编辑虚拟机配置文件 # 添加以下配置: # sched.cpu.units="mhz" # sched.cpu.latencySensitivity="high" # sched.mem.maxmemctl="0" # sched.mem.pin="TRUE" # 6. 平台验证 # 测试虚拟机性能 # 测试CPU性能 stress-ng --cpu 16 --cpu-method all --metrics-brief --timeout 60s # 测试内存性能 sysbench memory --memory-block-size=1K --memory-total-size=50G --memory-access-mode=rnd run # 测试存储性能 sysbench fileio --file-total-size=100G --file-test-mode=seqwr --file-num=64 --file-extra-flags=direct --time=60 run # 测试网络性能 iperf3 -s & iperf3 -c 192.168.1.100 -t 60 -P 8 # 测试虚拟机可靠性 # 长时间运行测试 # 虚拟机迁移测试 # 故障恢复测试

# 应用内核参数输出
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65535
vm.swappiness = 10
vm.max_map_count = 262144
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104

# 测试CPU性能输出
stress-ng: info: [12345] dispatching hogs: 16 cpu
stress-ng: info: [12345] successful run completed in 60.01s
stress-ng: info: [12345] metrics: 16 cpu, 60.01s, 1600.00ms/cpu,
25600.00ms total

# 测试内存性能输出
sysbench 1.0.20 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Running memory speed test with the following options:
block size: 1K
total size: 50G
access mode: random
memory type: RAM
scope: global

Initializing worker threads…

Threads started!

Total operations: 52428800 (873813.68 ops/sec)

51200.00 MB transferred (853.33 MB/sec)

Test execution summary:
total time: 60.0015s
total number of events: 52428800
total time taken by event execution: 59.9998
per-request statistics:
min: 0.00ms
avg: 0.00ms
max: 0.10ms
approx. 95th percentile: 0.00ms

Threads fairness:
events (avg/stddev): 52428800.0000/0.00
execution time (avg/stddev): 59.9998/0.00

# 测试存储性能输出
sysbench 1.0.20 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Extra file open flags: direct
128 files, 8192Kb each, 1024Mb total
Creating files for the test…
Extra file open flags: direct
Creating file test_file.0

Creating file test_file.127
1024Mb written in 1.50 seconds (682.45 MB/sec)

Running file I/O test with the following options:
file size: 1024Mb
number of files: 128
block size: 16Kb
nu

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息