Skip to content

Commit

Permalink
docs: update install script
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdrivingduck authored and polardb-bot[bot] committed Mar 12, 2024
1 parent a2f0d52 commit f038dfd
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 116 deletions.
144 changes: 144 additions & 0 deletions deps/deps-centos7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#!/bin/bash
#
# The script is based on a clean CentOS 7 system.
#
# Copyright (c) 2020, Alibaba Group Holding Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Executed by root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi

# avoid missing locale
sed -i 's/override_install_langs/# &/' /etc/yum.conf
# for su postgres
sed -i 's/4096/unlimited/g' /etc/security/limits.d/20-nproc.conf

# extra yum software source
# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum install -y epel-release centos-release-scl
rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
yum update -y

# compile tools
yum install -y \
devtoolset-9-gcc \
devtoolset-9-gcc-c++ \
devtoolset-9-gdb \
devtoolset-9-libstdc++-devel \
devtoolset-9-make \
llvm-toolset-7.0-llvm-devel \
llvm-toolset-7.0-clang-devel \
cmake3

# dependencies
yum install -y \
libicu-devel \
pam-devel \
readline-devel \
libxml2-devel \
libxslt-devel \
openldap-devel \
openldap-clients \
openldap-servers \
openssl-devel \
libuuid-devel \
xerces-c-devel \
bison \
flex \
gettext \
tcl-devel \
python-devel \
perl-IPC-Run \
perl-Expect \
perl-Test-Simple \
perl-DBD-Pg \
perl-ExtUtils-Embed \
perl-ExtUtils-MakeMaker \
zlib-devel \
krb5-devel \
krb5-workstation \
krb5-server \
protobuf-devel \
libaio-devel \
fuse-devel

ln /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so

# yum install -y
# git lcov psmisc sudo vim \
# less \
# net-tools \
# python2-psycopg2 \
# python2-requests \
# tar \
# shadow-utils \
# which \
# binutils\
# libtool \
# perf \
# make sudo \
# wget \
# util-linux

# enable GCC9 and LLVM7
echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc && \
echo "source /opt/rh/llvm-toolset-7.0/enable" >> /etc/bashrc && \
ln -s /usr/bin/cmake3 /usr/bin/cmake
source /etc/bashrc

# install Node.js repo
# curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
# install Yarn
# curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
# yum install -y yarn

GITHUB_PROXY=
# GITHUB_PROXY=https://ghproxy.com

cd /usr/local

ZLOG_VERSION=1.2.14
PFSD_VERSION=pfsd4pg-release-1.2.42-20220419

# download zlog for PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/HardySimpson/zlog/archive/refs/tags/${ZLOG_VERSION}.tar.gz"
# download PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/ApsaraDB/PolarDB-FileSystem/archive/refs/tags/${PFSD_VERSION}.tar.gz"

# unzip and install zlog
gzip -d $ZLOG_VERSION.tar.gz && \
tar xpf $ZLOG_VERSION.tar && \
cd zlog-$ZLOG_VERSION && \
make && make install && \
echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig && \
cd .. && \
rm -rf $ZLOG_VERSION* && \
rm -rf zlog-$ZLOG_VERSION && \
# unzip and install PFSD
gzip -d $PFSD_VERSION.tar.gz && \
tar xpf $PFSD_VERSION.tar && \
cd PolarDB-FileSystem-$PFSD_VERSION && \
sed -i 's/-march=native //' CMakeLists.txt && \
./autobuild.sh && ./install.sh && \
cd .. && \
rm -rf $PFSD_VERSION* && \
rm -rf PolarDB-FileSystem-$PFSD_VERSION* && \
ldconfig
6 changes: 3 additions & 3 deletions docs/development/customize-dev-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ cd ~

### 依赖安装

在 PolarDB for PostgreSQL 的源码库根目录下,有一个 `install_dependencies.sh` 脚本,包含了 PolarDB 和 PFS 需要运行的所有依赖。因此,首先需要克隆 PolarDB 的源码库。
在 PolarDB for PostgreSQL 源码库根目录的 `deps/` 子目录下,放置了在各个 Linux 发行版上编译安装 PolarDB 和 PFS 需要运行的所有依赖。因此,首先需要克隆 PolarDB 的源码库。

PolarDB for PostgreSQL 的代码托管于 [GitHub](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) 上,稳定分支为 `POLARDB_11_STABLE`。如果因网络原因不能稳定访问 GitHub,则可以访问 [Gitee 国内镜像](https://gitee.com/mirrors/PolarDB-for-PostgreSQL)

Expand All @@ -220,9 +220,9 @@ git clone -b POLARDB_11_STABLE https://gitee.com/mirrors/PolarDB-for-PostgreSQL
:::
::::

源码下载完毕后,使用 `sudo` 执行源代码根目录下的依赖安装脚本 `install_dependencies.sh` 自动完成所有的依赖安装。如果有定制的开发需求,请自行修改 `install_dependencies.sh`
源码下载完毕后,使用 `sudo` 执行 `deps/` 目录下的相应脚本 `deps-***.sh` 自动完成所有的依赖安装。比如:

```bash
cd PolarDB-for-PostgreSQL
sudo ./install_dependencies.sh
sudo ./deps/deps-centos7.sh
```
6 changes: 3 additions & 3 deletions docs/zh/development/customize-dev-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ cd ~

### 依赖安装

在 PolarDB for PostgreSQL 的源码库根目录下,有一个 `install_dependencies.sh` 脚本,包含了 PolarDB 和 PFS 需要运行的所有依赖。因此,首先需要克隆 PolarDB 的源码库。
在 PolarDB for PostgreSQL 源码库根目录的 `deps/` 子目录下,放置了在各个 Linux 发行版上编译安装 PolarDB 和 PFS 需要运行的所有依赖。因此,首先需要克隆 PolarDB 的源码库。

PolarDB for PostgreSQL 的代码托管于 [GitHub](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) 上,稳定分支为 `POLARDB_11_STABLE`。如果因网络原因不能稳定访问 GitHub,则可以访问 [Gitee 国内镜像](https://gitee.com/mirrors/PolarDB-for-PostgreSQL)

Expand All @@ -220,9 +220,9 @@ git clone -b POLARDB_11_STABLE https://gitee.com/mirrors/PolarDB-for-PostgreSQL
:::
::::

源码下载完毕后,使用 `sudo` 执行源代码根目录下的依赖安装脚本 `install_dependencies.sh` 自动完成所有的依赖安装。如果有定制的开发需求,请自行修改 `install_dependencies.sh`
源码下载完毕后,使用 `sudo` 执行 `deps/` 目录下的相应脚本 `deps-***.sh` 自动完成所有的依赖安装。比如:

```bash
cd PolarDB-for-PostgreSQL
sudo ./install_dependencies.sh
sudo ./deps/deps-centos7.sh
```
110 changes: 0 additions & 110 deletions install_dependencies.sh

This file was deleted.

0 comments on commit f038dfd

Please sign in to comment.