-
Notifications
You must be signed in to change notification settings - Fork 0
1. MariaDB download Script.md
couplewith edited this page Mar 29, 2017
·
4 revisions
- 망분리가 된 상태라 파일을 받아서 내부로 이전을 해야 하기도하고 때로는 방화벽 문제로 외부 YUM으로 접근이 안되는 상황도 있습니다.
- 할수 없이 패키지를 다운 받아서 설치를 해야 하기도 하고, 현재 설치된 패키지의 상태를 확인 하는 경우 를 보면서 "와우 참 받은지 오래 됬고 설치된 지도 오래 됬구나 ~~!! " 를 느끼면 다시 설치하지 않을까요 ?
- 이런 저런 이유에서 아래와 같이 설치 스크립트를 가지고 여러대의 서버에 설치 환경을 만들어 둡니다.
- sh get_mariadb.sh : 다운로드만 합니다.
- sh get_mariadb.sh install : 다운로드 하고 설치를 합니다.
VER="10.0.2"
VER="10.1.22" # 2017.3.14
REV=`echo $VER | cut -d"." -f1,2` # 10.1
VER55="5.5.54" # 2017.3.7
REV55=`echo $VER55 | cut -d"." -f1,2` # 5.5
PLATFORM="centos6-x86_64"
##[URL ]##########################################
BASE_URL64=http://ftp.kaist.ac.kr/mariadb/mariadb-$VER/yum/centos6-amd64/rpms
BASE_URL_BIN=http://ftp.kaist.ac.kr/mariadb/mariadb-$VER/bintar-linux-x86_64
BASE_URL_BIN55=http://ftp.kaist.ac.kr/mariadb/mariadb-$VER55/bintar-linux-x86_64
# http://ftp.kaist.ac.kr/mariadb/mariadb-10.1.21/bintar-linux-x86_64/mariadb-10.1.21-linux-x86_64.tar.gz
##[PKG ]#########################################
PKGLIST_EXT="galera-25.3.19-1.rhel6.el6.x86_64.rpm \
jemalloc-3.6.0-1.el6.x86_64.rpm \
jemalloc-devel-3.6.0-1.el6.x86_64.rpm"
PKGLIST=`cat <>>>>>>>> get_MariaDB.env >>>>>>>>>>"
echo " BASE_URL64 :[$BASE_URL64]"
echo " PKGLIST :[$PKGLIST]"
echo " PKGLIST_EXT:[$PKGLIST_EXT]"
if [ -f "get_Mariadb.env" ]
then
source ./get_Mariadb.env
else
echo " $0.sh : get_Mariadb.env Notfound !! "
exit
fi
### Download RPM ##################
mkdir Maria-$REV
mkdir Maria-$REV55;
# -----------------
for pkg in $PKGLIST
do
# pkg_name="Maria-10.1/MariaDB-${VER}-centos6-x86_64-compat.rpm"
pkg_name="Maria-$REV/$pkg"
down_url="$BASE_URL64/$pkg"
if [ ! -f "$pkg_name" ]
then
wget $down_url -O $pkg_name;
else
echo " > (MariaDB) download exists [$pkg_name] "
fi
Ret=$?
ls -al $pkg_name;
done
#--------------------------------------
# *** EXT : jemalloc, galera ****
#--------------------------------------
for pkg in $PKGLIST_EXT
do
# pkg_name="Maria-10.1/MariaDB-${VER}-centos6-x86_64-compat.rpm"
pkg_name="Maria-$REV/$pkg"
down_url="$BASE_URL64/$pkg"
if [ ! -f "$pkg_name" ]
then
wget $down_url -O $pkg_name;
else
echo " > (Maria_Ext) download exists [$pkg_name] "
fi
Ret=$?
ls -al $pkg_name;
done
### Download BIN ##################
function WGET () {
wget_opt=" --tries=2 "
if [ -z "$2" ]
then
file_name=$(basename $1 );
else
file_name=$(basename $2 );
fi
download_url=$1/$2
down_file=${2:-"Maria-$REV/$file_name"}
down_desc=${3:-"$file_name"}
if [ ! -f "$down_file" ]
then
wget $wget_opt $download_url -O $down_file
else
echo " >> WGET : $down_file Exists !!! "
fi
ls -al $down_file
echo " >>> WGET [$down_desc] : $down_file Done !!! "
}
#*********************************
## down load bin-pkg
# -------------------------
bin_name="Maria-$REV/mariadb-$VER-linux-x86_64.tar.gz"
bin_name55="Maria-$REV55/mariadb-$VER55-linux-x86_64.tar.gz"
WGET $BASE_URL_BIN $bin_name "bin_down-$REV"
WGET $BASE_URL_BIN55 $bin_name55 "bin_down-$REV55"
## down load Judy
# -------------------------
WGET $BIN_EXT_URL1
WGET $BIN_EXT_URL2
### INSTALL RPM ##################
if [ -z "$1" ]
then
echo " *>>>>>>****************************************"
echo " Usage : $0 install "
echo " download Done & install Skipped !! "
echo " ***********************************************"
exit;
else
# for install oqgraph-engine #
# libJudy.so.1()(64bit) is needed by MariaDB-oqgraph-engine-10.0.12-1.el6.x86_64
yum install -y judy judy-devel
if [ ! $Ret -eq 0 ]
then
echo " Custom install : Judy !! "
ls -al $Maria-$REV/Judy-*
fi
for pkg in $PKGLIST
do
# pkg_name="Maria-10.0/MariaDB-10.0.12-centos6-x86_64-$pkg.rpm"
pkg_name="Maria-$REV/$pkg"
if [ -e "$pkg_name" ]
then
rpm -Uvh $pkg_name && echo " install _successed $pkg_name !!"
else
echo " install _failed $pkg_name !!"
fi
done
rpm -qa | grep -i "mariadb"
fi