安裝環境
系統資訊
NAME="Oracle Linux Server"
VERSION="9.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Oracle Linux Server 9.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:9:4:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 9"
ORACLE_BUGZILLA_PRODUCT_VERSION=9.4
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=9.4
軟體源
[root@a754fdf885ce data]# yum repolist
repo id repo name
ol9_appstream Oracle Linux 9 Application Stream Packages (x86_64)
ol9_baseos_latest Oracle Linux 9 BaseOS Latest (x86_64)
編譯演示路徑/data
GlusterFS安裝
1. 安裝所需軟體源
dnf install epel-release
dnf config-manager --set-enabled ol9_codeready_builder
2. 更新依賴
yum clean all && yum update -y && yum makecache
3. 安裝官網推薦的依賴
yum install -y autoconf automake bison dos2unix flex fuse-devel glib2-devel \
libacl-devel libaio-devel libattr-devel libcurl-devel libibverbs-devel \
librdmacm-devel libtirpc-devel libuuid-devel libtool libxml2-devel \
lvm2-devel make openssl-devel pkgconfig xz-devel python3-devel \
python3-netifaces python3-paste-deploy python3-simplejson python3-sphinx \
python3-webob python3-pyxattr readline-devel rpm-build sqlite-devel \
systemtap-sdt-devel tar userspace-rcu-devel rpcgen liburing-devel
#安裝git
yum install -y git
如果存在依賴衝突,單獨安裝即可
4. 透過git拉取官方原始碼
git clone https://github.com/gluster/glusterfs.git
cd glusterfs
git checkout v10.5
5. 開始編譯安裝
configure
./autogen.sh
./configure
configure: error: tcmalloc library needs to be present
yum install -y gperftools-devel
處理完問題之後,繼續執行./configure
輸出以下資訊,即為成功
GlusterFS configure summary
===========================
FUSE client : yes
epoll IO multiplex : yes
fusermount : yes
readline : yes
georeplication : yes
Linux-AIO : yes
Linux io_uring : yes
Use liburing : yes
Enable Debug : no
Run with Valgrind : no
Sanitizer enabled : none
XML output : yes
Unit Tests : no
Track priv ports : yes
POSIX ACLs : yes
SELinux features : yes
firewalld-config : no
Events : yes
EC dynamic support : x64 sse avx
Use memory pools : no
Nanosecond m/atimes : yes
Server components : yes
Legacy gNFS server : no
IPV6 default : no
Use TIRPC : yes
With Python : 3.9
Cloudsync : yes
Metadata dispersal : no
Link with TCMALLOC : yes
Enable Brick Mux : no
Building with LTO : yes
make
make
執行過程中無報錯,輸出以下資訊為成功
make[2]: Leaving directory '/data/glusterfs/events'
make[2]: Entering directory '/data/glusterfs'
make[2]: Leaving directory '/data/glusterfs'
make[1]: Leaving directory '/data/glusterfs'
開始make install
make install
執行過程中無報錯,輸出以下資訊為成功
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 glusterfs-api.pc libgfchangelog.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/data/glusterfs'
make[1]: Leaving directory '/data/glusterfs'
配置服務啟動
systemctl daemon-reload
systemctl start glusterd
NFS-Ganesha安裝
1.安裝所需的軟體源
yum install -y cmake gcc-c++ krb5-devel
2.透過git拉取原始碼
git clone https://github.com/nfs-ganesha/nfs-ganesha
cd nfs-ganesha
git submodule update --init --recursive
git checkout V5.9
3. 編譯安裝
cmake
mkdir build
cd build
cmake ../src -DNSL_LIBRARY=$(pwd)/../src/libntirpc/src \
-DUSE_FSAL_GLUSTER=on -DPKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
DPKG_CONFIG_PATH需要設定為包含glusterfs-api.pc檔案的路徑,可使用find / -name "glusterfs-api.pc"
輸出如下結果代表成功
-- Generating done (0.1s)
-- Build files have been written to: /data/nfs-ganesha/build
make
make && make install
輸出如下資訊代表make成功
[100%] Linking C shared module libfsalmem.so
[100%] Built target fsalmem
輸出如下資訊代表make install成功
-- Installing: /usr/lib64/libntirpc.so.5.8
-- Set runtime path of "/usr/lib64/libntirpc.so.5.8" to ""
-- Up-to-date: /usr/lib64/libntirpc.so
-- Installing: /usr/lib64/ganesha/libfsalnull.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalnull.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalvfs.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalvfs.so" to ""
-- Installing: /usr/lib64/ganesha/libfsaldummylustre.so
-- Set runtime path of "/usr/lib64/ganesha/libfsaldummylustre.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalproxy_v4.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalproxy_v4.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalproxy_v3.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalproxy_v3.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalsaunafs.so
-- Installing: /usr/lib64/ganesha/libfsalgpfs.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalgpfs.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalgluster.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalgluster.so" to ""
-- Installing: /usr/lib64/ganesha/libfsalmem.so
-- Set runtime path of "/usr/lib64/ganesha/libfsalmem.so" to ""
-- Installing: /usr/lib64/libganesha_nfsd.so.5.9
-- Set runtime path of "/usr/lib64/libganesha_nfsd.so.5.9" to ""
-- Up-to-date: /usr/lib64/libganesha_nfsd.so
4. 啟動服務
cd nfs-ganesha/src/scripts/systemd
cp –a nfs-ganesha-lock.service.el7 nfs-ganesha.service.el7 /usr/lib/systemd/system/
cd /usr/lib/systemd/system/
mv nfs-ganesha-lock.service.el7 nfs-ganesha-lock.service
mv nfs-ganesha.service.el7 nfs-ganesha.service
systemctl daemon-reload