openGauss3.0源码安装

openGauss3.0源码安装

1.安装依赖包
yum install -y libaio-devel ncurses-devel pam-devel libffi-devel python3-devel libtool libtool-ltdl openssl-devel bison flex glibc-devel patch readline-devel lsb_release
2.添加openGauss用户并设置密码
useradd openGauss
passwd openGauss
3.下载第三方依赖包
# 切换到openGauss用户
su - openGauss
# 下载三方依赖包
wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.0.0/openGauss-third_party_binarylibs.tar.gz
# 解压三方包并重命名
tar -zxf openGauss-third_party_binarylibs.tar.gz 
mv openGauss-third_party_binarylibs binarylibs
4.下载openGauss-server源码
# 下载openGauss-server源码,如果没有git,可以执行 yum -y install git
git clone https://gitee.com/opengauss/openGauss-server.git
# 切换到3.0.0版本的tag
git checkout 3.0.0
5.在~/.bashrc中添加如下环境变量
vim ~/.bashrc

export CODE_BASE=/home/openGauss/openGauss-server
export BINARYLIBS=/home/openGauss/binarylibs
export GAUSSHOME=/home/openGauss/install/
export GCC_PATH=$BINARYLIBS/buildtools/centos7.6_x86_64/gcc7.3/
export CC=$GCC_PATH/gcc/bin/gcc
export CXX=$GCC_PATH/gcc/bin/g++
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$GCC_PATH/gcc/lib64:$GCC_PATH/isl/lib:$GCC_PATH/mpc/lib/:$GCC_PATH/mpfr/lib/:$GCC_PATH/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$GAUSSHOME/bin:$GCC_PATH/gcc/bin:$PATH
6.执行如下命令使环境变量生效
source ~/.bashrc
7.进入openGauss-server目录,执行以下命令,进行配置编译
./configure --gcc-version=7.3.0 CC=g++ CFLAGS='-O0' --prefix=$GAUSSHOME --3rd=$BINARYLIBS --enable-debug --enable-cassert --enable-thread-safety --with-readline --without-zlib

make -sj 8
8.执行如下命令开始安装
make install
9.创建数据目录,并初始化数据库
mkdir /home/openGauss/install/data
gs_initdb -D /home/openGauss/install/data/datanode1  --nodename=datanode1
10.初始化成功之后,会显示如下信息
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.

Success. You can now start the database server of single node using:

    gaussdb -D /home/openGauss/install/data/datanode1 --single_node
or
    gs_ctl start -D /home/openGauss/install/data/datanode1 -Z single_node -l logfile
11.现在可以启动数据库了,启动和停止的命令如下
gs_ctl start -D /home/openGauss/install/data/datanode1 -Z single_node -l /home/openGauss/gauss.log
gs_ctl stop -D /home/openGauss/install/data/datanode1

第一次登陆数据库需要进到“postgresql.conf”配置文件中将端口5432打开,然后使用“gsql -d postgres -p 5432”登陆进数据库。登录数据库之后的第一件事是将openGauss用户改个密码“ALTER ROLE “openGauss” PASSWORD ‘Vastdata#0730’;”
配置文件目录:/home/openGauss/install/data/datanode1/postgresql.conf

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值