当前位置: 首页 > news >正文

openGauss在龙芯平台部署的实践

image.png

服务器环境

系统信息

NAME="Loongnix-Server Linux"
VERSION="8"
ID="loongnix-server"
ID_LIKE="rhel fedora centos"
VERSION_ID="8"
PLATFORM_ID="platform:lns8"
PRETTY_NAME="Loongnix-Server Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:loongnix-server:loongnix-server:8"
HOME_URL="http://www.loongnix.cn/"
BUG_REPORT_URL="http://bugs.loongnix.cn/"
CENTOS_MANTISBT_PROJECT="Loongnix-server-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

处理器架构

Architecture:        loongarch64
Byte Order:          Little Endian
CPU(s):              32
On-line CPU(s) list: 0-31
Thread(s) per core:  1
Core(s) per socket:  16
Socket(s):           2
NUMA node(s):        2
CPU family:          Loongson-64bit
Model name:          Loongson-3C5000
BogoMIPS:            4400.00
L1d cache:           64K
L1i cache:           64K
L2 cache:            256K
L3 cache:            16384K
NUMA node0 CPU(s):   0-15
NUMA node1 CPU(s):   16-31
Flags:               cpucfg lam ual fpu lsx lasx complex crypto lvz lbt_x86 lbt_arm lbt_mips

image.png

openGauss描述

openGauss-5.0.2 迁移说明:
openGauss-5.0.2-loongarch64-all.tar.gz包含了官网 https://opengauss.org/zh/download/
openGauss Server 部分的 openGauss_5.0.2 企业版 的全部内容
openGauss-5.0.2-loongarch64-connectors.tar.gz包含了官网 https://opengauss.org/zh/download/
openGauss Connectors部分的全部 4 个驱动程序的内容。
其中 bbox (程序崩溃时生成 coredump 的功能), llvm ( jit 功能) 2 个功能模块没有迁移, 应该不影响正常使用。
缺少 128 原子指令,使用自旋锁软实现。
image.png

部署

单机版安装

参考文档:https://docs-opengauss.osinfra.cn/zh/docs/5.0.0/docs/InstallationGuide/%E5%8D%95%E8%8A%82%E7%82%B9%E5%AE%89%E8%A3%85.html

安装步骤

tar -zxvf openGauss-5.0.2-loongarch64-all.tar.gz
cd openGauss-5.0.2-loongarch64-alltar -jxf openGauss-5.0.2-loongnix-64bit.tar.bz2 -C /mnt/openGauss
cd /mnt/openGauss/simpleInstall
sh install.sh -w "数据库密码" &&source ~/.bashrc

数据库操作

-- 连接数据库
gsql -d postgres -p 5432
-- 停止数据库
gs_ctl stop -D $GAUSSHOME/data/single_node -Z single_node
-- 启动数据库
gs_ctl start -D $GAUSSHOME/data/single_node -Z single_node

远程访问设置

  1. 停止数据库
  2. 修改 postgresql.conf 里面的 listen_addresses
vim $GAUSSHOME/data/single_node postgresql.conf
listen_addresses = '*'
  1. 启动数据库

集群方式安装

参考文档:https://docs-opengauss.osinfra.cn/zh/docs/5.0.0/docs/InstallationGuide/%E4%BC%81%E4%B8%9A%E7%89%88%E5%AE%89%E8%A3%85.html

安装步骤

mkdir -p /mnt/openGauss
chmod 755 -R /mnt/openGausstar -zxvf openGauss-5.0.2-loongarch64-all.tar.gz -C /mnt/openGauss
cd /mnt/openGauss/script/openGauss-5.0.2-loongarch64-alltar -zxvf openGauss-5.0.2-loongnix-64bit-om.tar.gzcd script
cp gspylib/etc/conf/cluster_config_template.xml ./cluster_config.xml

根据实际情况修改 cluster_config.xml 中机器的 ip数据库安装目录
集群需要 ssh 互信,提前安装 expect

yum install expect./gs_preinstall -U omm -G dbgrp -X /mnt/openGauss/openGauss-5.0.2-loongarch64-all/script/cluster_config.xmlsu - omm
gs_install -X /mnt/openGauss/openGauss-5.0.2-loongarch64-all/script/cluster_config.xml# 查看集群信息
gs_om -t status --detail# 连接数据库
gsql -d postgres -p 15400

注意:
openGauss 安装的时候在 /etc/profile 里面修改了系统的 LD_LIBRARY_PATH,或者是 ~/.bashrc 里面修改了LD_LIBRARY_PATH , 由于 openGauss 自带了 openssl.so , libcrypto.so 等动态库,可能会导致系统执行 sudo, su , yum 等命令的时候报错。
重置 LD_LIBRARY_PATH 后再次执行。
export LD_LIBRARY_PATH=

远程访问设置

与单机版安装中设置一样。

设置开机服务

设置gs_ctl工具的软连接

ln -s /mnt/openGauss/bin/gs_ctl /usr/local/bin

创建/etc/systemd/system/openGauss.service文件并添加服务配置

[Unit]
Description=華為openGauss數據庫服務...
After=network.target[Service]
Type=forking
User=omm
Group=dbgrpEnvironment="GAUSSHOME=/mnt/openGauss"
# 直接設置成LD_LIBRARY_PATH變量的值
Environment="LD_LIBRARY_PATH=/mnt/openGauss/lib"ExecStart=/usr/local/bin/gs_ctl start -D /mnt/openGauss/data/single_node 
ExecReload=/usr/local/bin/gs_ctl restart -D /mnt/openGauss/data/single_node
ExecStop=/usr/local/bin/gs_ctl stop -D /mnt/openGauss/data/single_node
SuccessExitStatus=143
Restart=always[Install]
WantedBy=multi-user.target

image.png
重新加载服务

sudo systemctl daemon-reload

重启服务

sudo systemctl start openGauss.service

查看服务状态

● openGauss.service - 華為openGauss數據庫服務...Loaded: loaded (/etc/systemd/system/openGauss.service; enabled; vendor preset: disabled)Active: active (running) since Mon 2024-08-26 23:33:27 EDT; 3h 1min agoProcess: 10875 ExecStart=/usr/local/bin/gs_ctl start -D /mnt/openGauss/data/single_node (code=exited, status=0/SUCCESS)Main PID: 10878 (gaussdb)Tasks: 36 (limit: 829805)Memory: 556.0MCGroup: /system.slice/openGauss.service└─10878 /mnt/openGauss/bin/gaussdb -D /mnt/openGauss/data/single_nodeAug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.296 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] DETAIL:  N/A
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.296 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] CAUSE:  Incorrect environment value.
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.296 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] ACTION:  Please refer to backend log for more details.
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.297 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] WARNING:  Failed to obtain environment value $GAUSSLOG!
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.297 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] DETAIL:  N/A
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.297 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] CAUSE:  Incorrect environment value.
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: 2024-08-26 23:33:27.297 [unknown] [unknown] localhost 1099036442640 0[0:0#0]  0 [EXECUTOR] ACTION:  Please refer to backend log for more details.
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: [2024-08-26 23:33:27.974][10875][][gs_ctl]:  done
Aug 26 23:33:27 localhost.localdomain gs_ctl[10875]: [2024-08-26 23:33:27.974][10875][][gs_ctl]: server started (/mnt/openGauss/data/single_node)
Aug 26 23:33:27 localhost.localdomain systemd[1]: Started 華為openGauss數據庫服務....

image.png
龙芯openGauss适配好的安装包,有需要的朋友关注后,发送龙芯openGauss关键词即可获得!


http://www.mrgr.cn/news/13586.html

相关文章:

  • 游戏开发设计模式之模板方法模式
  • Leetcode面试经典150题-122.买卖股票的最佳时机II
  • [LeetCode]139.单词拆分(C++)
  • 使用ffmpeg+node-media-server实现从rtsp服务器拉流再推送至rtmp服务器,实现http+flv进行web播放
  • 【Go语言成长之路】泛型入门
  • 【Linux】软硬链接和动静态库
  • 安美数字酒店宽带运营系统-任意文件读取
  • Python编码系列—Python CI/CD 实战:构建高效的自动化流程
  • Ai产品经理的探索:技能、机遇与未来展望
  • Django 框架中values和values_list的区别
  • 冒泡排序
  • uniapp-Vue项目如何实现国际化,实现多语言切换,拒绝多套开发,一步到位,看这篇就够
  • .NET 中的字符流、字节流和缓冲流
  • java 使用 jakarta.mail 发送邮件
  • Linux下TCP编程
  • error:0308010C:digital envelope routines::unsupported【超详细图解】
  • 数据结构(邓俊辉)学习笔记】串 09——BM_BC算法:以终为始
  • 基于大数据的电信诈骗行为可视化系统含预测研究【lightGBM,XGBoost,随机森林】
  • 景芯SoC A72实战反馈
  • 深度强化学习算法(三)(附带MATLAB程序)