FAIRYFAR-INTERNAL
 
  FAIRYFAR-INTERNAL  |  SITEMAP  |  ABOUT-ME  |  HOME  
您的足迹: 编译安装openGauss
编译安装openGauss

本文适用于openGauss1.1.0

环境:centos7.6_x86_64

一、官方参考

二、步骤

假设文件路径全部在:/opt/openGauss/

准备文件

  • /opt/openGauss/openGauss-server/ :server源码,下载
  • /opt/openGauss/binarylibs/:二进制的第三方库(必须是与server源码配套的版本),下载后解压到此目录,下载
  • /opt/openGauss/gauss_data/:openGauss数据目录。

编译

以下编译debug版本:

snippet.bash
[yz@test ~]$ cd /opt/openGauss/openGauss-server
[yz@test openGauss-server]$ sh build.sh -m debug -3rd /opt/openGauss/binarylibs
ROOT_DIR : /opt/openGauss/openGauss-server
Everything is ready.
begin to make distclean
Begin configure, Please wait a few minutes...
End configure
Begin make compile database, Please wait a few minutes...
make compile sucessfully!

当看到“make compile sucessfully!”提示时,表示编译成功,如果编译失败,可以查看make_compile.log分析失败原因。

编译后,二进制文件在:

/opt/openGauss/openGauss-server/dest

初始化

snippet.bash
[yz@test ~]$ export LD_LIBRARY_PATH=/opt/openGauss/openGauss-server/dest/lib/:$LD_LIBRARY_PATH
[yz@test ~]$ cd /opt/openGauss/openGauss-server/dest/bin
[yz@test bin]$ ./gs_initdb -D /opt/openGauss/gauss_data/ --nodename=gauss
……
Success. You can now start the database server of single node using:
 
    ./gaussdb -D /opt/openGauss/gauss_data
or
    ./gs_ctl start -D /opt/openGauss/gauss_data -l logfile

启动与客户端连接

snippet.bash
[yz@test ~]$ cd /opt/openGauss/openGauss-server/dest/bin
[yz@test bin]$ ./gs_ctl start -D /opt/openGauss/gauss_data -l logfile
[yz@test bin]$ ./gsql postgres
gsql ((openGauss 1.0.1 build ) compiled at 2021-03-10 10:23:33 commit 0 last mr  debug)
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
 
postgres=# 

加载

加载方法参考PostgreSQL,但是要求数据文件必须放到数据目录下的pg_copydir子目录中,对应上述示例,即:

/opt/openGauss/gauss_data/gauss_data/pg_copydir/

三、问题

Redhat

openGauss目前仅支持以下操作系统:

  • CentOS 7.6(x86架构)
  • openEuler-20.03-LTS(aarch64架构)

尝试在其它系统上编译,请先修改:/opt/openGauss/openGauss-server/src/get_PlatForm_str.sh,绕过系统检查。



打赏作者以资鼓励: