From 8853fb21b4381fcf296940dd1eacdc9ad7917880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Thu, 10 Aug 2023 20:35:22 +0800 Subject: [PATCH 01/11] first commit datasophon-init --- datasophon-init/README.md | 25 + datasophon-init/bin/init-Cython.sh | 31 + datasophon-init/bin/init-add-hadoop-user.sh | 42 + datasophon-init/bin/init-allhosts.sh | 59 ++ datasophon-init/bin/init-chmod-dev-null.sh | 26 + datasophon-init/bin/init-cleanBuff-async.sh | 34 + datasophon-init/bin/init-cleanBuff.sh | 16 + datasophon-init/bin/init-close-swap.sh | 41 + .../bin/init-close-transparent-hugepage.sh | 26 + datasophon-init/bin/init-cyrus-sasl.sh | 20 + datasophon-init/bin/init-ecdsa.sh | 31 + datasophon-init/bin/init-expect.sh | 37 + datasophon-init/bin/init-gcc-c++.sh | 30 + datasophon-init/bin/init-hostIp-txt.sh | 43 + datasophon-init/bin/init-hostname.sh | 30 + datasophon-init/bin/init-java-policy.sh | 24 + datasophon-init/bin/init-jdk.sh | 108 +++ datasophon-init/bin/init-krb5-devel.sh | 36 + datasophon-init/bin/init-libxslt-devel.sh | 27 + datasophon-init/bin/init-mysql-8.sh | 127 +++ datasophon-init/bin/init-mysql-datasophon.sh | 65 ++ datasophon-init/bin/init-mysql-devel.sh | 28 + datasophon-init/bin/init-mysql-udp.sh | 34 + datasophon-init/bin/init-nmap.sh | 27 + datasophon-init/bin/init-ntp-chrony-server.sh | 105 +++ datasophon-init/bin/init-ntp-chrony-slave.sh | 59 ++ datasophon-init/bin/init-ntp_enable.sh | 28 + datasophon-init/bin/init-perl-JSON.sh | 29 + .../bin/init-private-yum-library.sh | 107 +++ datasophon-init/bin/init-psmisc.sh | 28 + datasophon-init/bin/init-pssh.sh | 36 + datasophon-init/bin/init-pytest_runner.sh | 27 + datasophon-init/bin/init-python-rpm-macros.sh | 31 + .../bin/init-python-srpm-macros.sh | 31 + .../bin/init-python2-rpm-macros.sh | 31 + datasophon-init/bin/init-python36-devel.sh | 31 + datasophon-init/bin/init-redhat-lsb.sh | 31 + datasophon-init/bin/init-six.sh | 32 + datasophon-init/bin/init-sourceSSHHostname.sh | 2 + datasophon-init/bin/init-ssh-copy-key.sh | 76 ++ datasophon-init/bin/init-ssh-gen-key.sh | 74 ++ datasophon-init/bin/init-ssh-hadoop.sh | 40 + datasophon-init/bin/init-sshpackage.sh | 37 + datasophon-init/bin/init-sshpass.sh | 37 + datasophon-init/bin/init-stop-firewall.sh | 35 + datasophon-init/bin/init-stop-selinux.sh | 38 + datasophon-init/bin/init-system-conf.sh | 83 ++ datasophon-init/bin/init-test.sh | 32 + datasophon-init/bin/init-tmp_pid.sh | 27 + datasophon-init/bin/init-websocket_client.sh | 32 + datasophon-init/bin/init-xdg-utils.sh | 30 + datasophon-init/bin/init-yum-hosts-mapping.sh | 52 ++ .../config/init-host-info-add.properties | 21 + .../config/init-host-info.properties | 15 + datasophon-init/config/init.properties | 28 + .../remove/remove-host-info.properties | 22 + datasophon-init/sbin/init.sh | 786 ++++++++++++++++++ datasophon-init/sql/R1.1.0.sql | 40 + datasophon-init/sql/V1.1.0__DDL.sql | 614 ++++++++++++++ datasophon-init/sql/V1.1.0__DML.sql | 418 ++++++++++ 60 files changed, 4112 insertions(+) create mode 100644 datasophon-init/README.md create mode 100644 datasophon-init/bin/init-Cython.sh create mode 100644 datasophon-init/bin/init-add-hadoop-user.sh create mode 100644 datasophon-init/bin/init-allhosts.sh create mode 100644 datasophon-init/bin/init-chmod-dev-null.sh create mode 100644 datasophon-init/bin/init-cleanBuff-async.sh create mode 100644 datasophon-init/bin/init-cleanBuff.sh create mode 100644 datasophon-init/bin/init-close-swap.sh create mode 100644 datasophon-init/bin/init-close-transparent-hugepage.sh create mode 100644 datasophon-init/bin/init-cyrus-sasl.sh create mode 100644 datasophon-init/bin/init-ecdsa.sh create mode 100644 datasophon-init/bin/init-expect.sh create mode 100644 datasophon-init/bin/init-gcc-c++.sh create mode 100644 datasophon-init/bin/init-hostIp-txt.sh create mode 100644 datasophon-init/bin/init-hostname.sh create mode 100644 datasophon-init/bin/init-java-policy.sh create mode 100644 datasophon-init/bin/init-jdk.sh create mode 100644 datasophon-init/bin/init-krb5-devel.sh create mode 100644 datasophon-init/bin/init-libxslt-devel.sh create mode 100644 datasophon-init/bin/init-mysql-8.sh create mode 100644 datasophon-init/bin/init-mysql-datasophon.sh create mode 100644 datasophon-init/bin/init-mysql-devel.sh create mode 100644 datasophon-init/bin/init-mysql-udp.sh create mode 100644 datasophon-init/bin/init-nmap.sh create mode 100644 datasophon-init/bin/init-ntp-chrony-server.sh create mode 100644 datasophon-init/bin/init-ntp-chrony-slave.sh create mode 100644 datasophon-init/bin/init-ntp_enable.sh create mode 100644 datasophon-init/bin/init-perl-JSON.sh create mode 100644 datasophon-init/bin/init-private-yum-library.sh create mode 100644 datasophon-init/bin/init-psmisc.sh create mode 100644 datasophon-init/bin/init-pssh.sh create mode 100644 datasophon-init/bin/init-pytest_runner.sh create mode 100644 datasophon-init/bin/init-python-rpm-macros.sh create mode 100644 datasophon-init/bin/init-python-srpm-macros.sh create mode 100644 datasophon-init/bin/init-python2-rpm-macros.sh create mode 100644 datasophon-init/bin/init-python36-devel.sh create mode 100644 datasophon-init/bin/init-redhat-lsb.sh create mode 100644 datasophon-init/bin/init-six.sh create mode 100644 datasophon-init/bin/init-sourceSSHHostname.sh create mode 100644 datasophon-init/bin/init-ssh-copy-key.sh create mode 100644 datasophon-init/bin/init-ssh-gen-key.sh create mode 100644 datasophon-init/bin/init-ssh-hadoop.sh create mode 100644 datasophon-init/bin/init-sshpackage.sh create mode 100644 datasophon-init/bin/init-sshpass.sh create mode 100644 datasophon-init/bin/init-stop-firewall.sh create mode 100644 datasophon-init/bin/init-stop-selinux.sh create mode 100644 datasophon-init/bin/init-system-conf.sh create mode 100644 datasophon-init/bin/init-test.sh create mode 100644 datasophon-init/bin/init-tmp_pid.sh create mode 100644 datasophon-init/bin/init-websocket_client.sh create mode 100644 datasophon-init/bin/init-xdg-utils.sh create mode 100644 datasophon-init/bin/init-yum-hosts-mapping.sh create mode 100644 datasophon-init/config/init-host-info-add.properties create mode 100644 datasophon-init/config/init-host-info.properties create mode 100644 datasophon-init/config/init.properties create mode 100644 datasophon-init/remove/remove-host-info.properties create mode 100644 datasophon-init/sbin/init.sh create mode 100644 datasophon-init/sql/R1.1.0.sql create mode 100644 datasophon-init/sql/V1.1.0__DDL.sql create mode 100644 datasophon-init/sql/V1.1.0__DML.sql diff --git a/datasophon-init/README.md b/datasophon-init/README.md new file mode 100644 index 00000000..5a0fdfd3 --- /dev/null +++ b/datasophon-init/README.md @@ -0,0 +1,25 @@ +
+ + DataSophon Logo + +

DataSophon

+

帮助您更容易地管理和监控集群

+
+ +

+ + + + +

+ 官网 | + English +

+

+

觉得不错的话,star fork下,欢迎社区开发者共建DataSophon

+# dataSophon-init使用说明 +前言:当前版本是根据centos8.5进行适配的,其它类型和版本的操作系统目前不能完全支持,需要对shell脚本和本地YUM离线安装包进行适配 +1、将dataSophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); +2、将 private-yum-library.tar.gz YUM离线安装包 移到 /data 文件夹并解压; +3、将packages.tar.gz 离线依赖库移到 /data/dataSophon-init下 并解压; +4、 \ No newline at end of file diff --git a/datasophon-init/bin/init-Cython.sh b/datasophon-init/bin/init-Cython.sh new file mode 100644 index 00000000..67203de8 --- /dev/null +++ b/datasophon-init/bin/init-Cython.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +CYTHON_FOLDER_NAME=Cython-0.20 +CYTHON_TAR_NAME=Cython-0.20.tar.gz + tar -zxvf ${PACKAGES_PATH}/${CYTHON_TAR_NAME} -C ${PACKAGES_PATH} + cd ${PACKAGES_PATH}/${CYTHON_FOLDER_NAME} + python3 setup.py install + cd ${INIT_BIN_PATH} + echo "Cython install successfully" + + diff --git a/datasophon-init/bin/init-add-hadoop-user.sh b/datasophon-init/bin/init-add-hadoop-user.sh new file mode 100644 index 00000000..4a770a7e --- /dev/null +++ b/datasophon-init/bin/init-add-hadoop-user.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +GROUP=hadoop +USER=hadoop + +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +egrep "^$GROUP" /etc/group >& /dev/null +if [ $? -ne 0 ] +then + groupadd $GROUP + echo "Successfully added GROUP: hadoop" +fi +egrep "^$USER" /etc/passwd >& /dev/null +if [ $? -ne 0 ] +then + useradd -g ${USER} ${USER} + echo "Successfully added USER: hadoop psw hadoop" +fi + +echo "init-add-hadoop-user.sh." +echo "Done." + + + + diff --git a/datasophon-init/bin/init-allhosts.sh b/datasophon-init/bin/init-allhosts.sh new file mode 100644 index 00000000..9e3ac0bc --- /dev/null +++ b/datasophon-init/bin/init-allhosts.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +hostAllInfoPath="$1" +initAllHostNums="$2" + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +REPAIR_PATH=$(dirname "${BASE_PATH}") +echo "REPAIR_PATH: ${REPAIR_PATH}" + +sed -i '/#modify etc hosts start/,/#modify etc hosts end/d' /etc/hosts +modifyHosts() { + cat /etc/hosts | grep yum + if [ $? -eq 0 ]; then + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts start' /etc/hosts + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password + echo "ip: ${ip}" + echo "${ip} ${hostname}" + sed -i '/#modify yum mapping hosts start/i '${ip}' '${hostname}'' /etc/hosts + done + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts end' /etc/hosts + else + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + echo "#modify etc hosts start" >>/etc/hosts + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password + echo "ip: ${ip}" + echo "${ip} ${hostname}" + echo "${ip} ${hostname}" >>/etc/hosts + done + echo "#modify etc hosts end" >>/etc/hosts + fi + +} + +modifyHosts +sed -i 's/^[^#].*[0-9]-[0-9]/#&/g' /etc/hosts + +echo "init-hosts.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-chmod-dev-null.sh b/datasophon-init/bin/init-chmod-dev-null.sh new file mode 100644 index 00000000..2bbfece2 --- /dev/null +++ b/datasophon-init/bin/init-chmod-dev-null.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# example: sh init-expect.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +rm -rf /dev/null && mknod -m 0666 /dev/null c 1 3 +echo "INIT-chmod-dev-null.sh." +echo "Done." + diff --git a/datasophon-init/bin/init-cleanBuff-async.sh b/datasophon-init/bin/init-cleanBuff-async.sh new file mode 100644 index 00000000..feef7563 --- /dev/null +++ b/datasophon-init/bin/init-cleanBuff-async.sh @@ -0,0 +1,34 @@ +#!/bin/bash + + +if [ $UID -ne 0 ] +then + echo Non root user. Please run as root. + exit 1 +fi + +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" + + +BASE_PATH=$(cd ${BASE_DIR}; pwd) +echo "BASE_PATH: ${BASE_PATH}" + +BIN_PATH=`dirname "${BASE_PATH}"`/bin +SCRIPTS_PATH=`dirname "${BASE_PATH}"`/scripts + +echo "SCRIPTS_PATH: $SCRIPTS_PATH" + +nohup sh ${INIT_BIN_PATH}/init-cleanBuff.sh >/dev/null 2>&1 & +#nohup sh $SCRIPTS_PATH/repair-cleanBuff.sh & + + diff --git a/datasophon-init/bin/init-cleanBuff.sh b/datasophon-init/bin/init-cleanBuff.sh new file mode 100644 index 00000000..b66aa844 --- /dev/null +++ b/datasophon-init/bin/init-cleanBuff.sh @@ -0,0 +1,16 @@ +#!/bin/bash + + +echo "sync" +sync +sync +sync + +echo "sleep" +sleep 10 + +echo 1 > /proc/sys/vm/drop_caches +echo 2 > /proc/sys/vm/drop_caches +echo 3 > /proc/sys/vm/drop_caches + +echo "done" diff --git a/datasophon-init/bin/init-close-swap.sh b/datasophon-init/bin/init-close-swap.sh new file mode 100644 index 00000000..1f16f5bd --- /dev/null +++ b/datasophon-init/bin/init-close-swap.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + + +#swapoff /dev/centos/swap + +# /etc/fstab +# /dev/mapper/centos-swap swap swap defaults 0 0 +sed -ri 's/.*swap.*/#&/' /etc/fstab + +echo 0 > /proc/sys/vm/swappiness + +SWAP_STR=`cat /etc/sysctl.conf | grep vm.swappiness` +if [ -z "${SWAP_STR}" ] +then + echo "vm.swappiness=0" >> /etc/sysctl.conf +else + sed -i '/vm.swappiness/d' /etc/sysctl.conf + echo "vm.swappiness=0" >> /etc/sysctl.conf +fi + +sysctl vm.swappiness=0 +swapoff -a && swapon -a +sysctl -p + +echo "Swap is closed." +echo "init-close-swap.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-close-transparent-hugepage.sh b/datasophon-init/bin/init-close-transparent-hugepage.sh new file mode 100644 index 00000000..11cc2edc --- /dev/null +++ b/datasophon-init/bin/init-close-transparent-hugepage.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + + +echo never > /sys/kernel/mm/transparent_hugepage/enabled +echo never > /sys/kernel/mm/transparent_hugepage/defrag +cat /sys/kernel/mm/transparent_hugepage/defrag +cat /sys/kernel/mm/transparent_hugepage/enabled +echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag' >> /etc/rc.d/rc.local +echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.d/rc.local +echo "transparent_hugepage is closed." +echo "init-close-transparent-hugepage.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-cyrus-sasl.sh b/datasophon-init/bin/init-cyrus-sasl.sh new file mode 100644 index 00000000..9b6b8628 --- /dev/null +++ b/datasophon-init/bin/init-cyrus-sasl.sh @@ -0,0 +1,20 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +yum -y install cyrus-sasl* + +echo "cyrus-sasl install successfully" diff --git a/datasophon-init/bin/init-ecdsa.sh b/datasophon-init/bin/init-ecdsa.sh new file mode 100644 index 00000000..b45ef485 --- /dev/null +++ b/datasophon-init/bin/init-ecdsa.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +ECDSA_FOLDER_NAME=ecdsa-0.14.1 +ECDSA_TAR_NAME=ecdsa-0.14.1.tar.gz + tar -zxvf ${PACKAGES_PATH}/${ECDSA_TAR_NAME} -C ${PACKAGES_PATH} + cd ${PACKAGES_PATH}/${ECDSA_FOLDER_NAME} + python3 setup.py install + cd ${INIT_PATH} + echo "ecdsa install successfully" + + diff --git a/datasophon-init/bin/init-expect.sh b/datasophon-init/bin/init-expect.sh new file mode 100644 index 00000000..7554b45c --- /dev/null +++ b/datasophon-init/bin/init-expect.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# example: sh init-expect.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +EXPECT_FOLDER_NAME=expect +EXPECT_TAR_NAME=expect.tar.gz +rpm -qa | grep expect-5.45 +if [ "$?" == "0" ]; then +echo "expect exists" +else + yum -y install expect +rpm -qa | grep expect-5.45 +if [ "$?" == "0" ]; then +echo "expect exists" +echo "init-expect.sh finished." +echo "Done." + fi +fi diff --git a/datasophon-init/bin/init-gcc-c++.sh b/datasophon-init/bin/init-gcc-c++.sh new file mode 100644 index 00000000..aaa99d64 --- /dev/null +++ b/datasophon-init/bin/init-gcc-c++.sh @@ -0,0 +1,30 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +GCC_FOLDER_NAME=gcc-c++ +GCC_TAR_NAME=gcc-c++.tar.gz +rpm -qa | grep gcc-c++ +if [ "$?" == "0" ]; then +echo "rpm -qa | grep gcc-c++ exists" +else + yum -y install gcc-c++ + rpm -qa | grep gcc-c++ + if [ "$?" == "0" ]; then + echo "gcc-c++ install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-hostIp-txt.sh b/datasophon-init/bin/init-hostIp-txt.sh new file mode 100644 index 00000000..e4992020 --- /dev/null +++ b/datasophon-init/bin/init-hostIp-txt.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# example: sh init-expect.sh +#TXT for initializing the cluster IP address list + +hostAllInfoPath="$1" +initAllHostNums="$2" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 +} +for ((i=1; i<=${initAllHostNums}; i++)) +do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") +echo "ip: ${ip}" +echo "port: ${port}" +echo -e "root@${ip}:${port}" >> ${INIT_BIN_PATH}/tmp_scp_host_info.txt +done + +echo "init-hostIp-txt.sh finished." +echo "Done." + diff --git a/datasophon-init/bin/init-hostname.sh b/datasophon-init/bin/init-hostname.sh new file mode 100644 index 00000000..6c35e888 --- /dev/null +++ b/datasophon-init/bin/init-hostname.sh @@ -0,0 +1,30 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + + +hostname=$1 +modifyHostname(){ + echo "${hostname}" > /etc/hostname + echo "HOSTNAME=${hostname}" > /etc/sysconfig/network + echo "NOZEROCONF=yes" >> /etc/sysconfig/network + hostnamectl set-hostname ${hostname} + hostnamectl set-hostname --static ${hostname} +} + +modifyHostname + +echo "init-hostname.sh finished." diff --git a/datasophon-init/bin/init-java-policy.sh b/datasophon-init/bin/init-java-policy.sh new file mode 100644 index 00000000..96c3dfd8 --- /dev/null +++ b/datasophon-init/bin/init-java-policy.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BBASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +ETC_HOST=/etc/hosts +source /etc/profile +sed -i '/modify java policy start/,/modify java policy end/d' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/grant {/a\//modify java policy end' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/modify java policy end/i\//modify java policy start' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/modify java policy end/i\permission javax.management.MBeanTrustPermission "register";' ${JAVA_HOME}/jre/lib/security/java.policy +echo "init-java-policy.sh finished." +echo "Done." \ No newline at end of file diff --git a/datasophon-init/bin/init-jdk.sh b/datasophon-init/bin/init-jdk.sh new file mode 100644 index 00000000..965a2f12 --- /dev/null +++ b/datasophon-init/bin/init-jdk.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +# example: sh init-jdk.sh +# instal and config jdk env +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +JDK_FOLDER_PATH=/usr/java +source /etc/profile +mkdir -p /usr/java +JDK_PATH_NAME="jdk1.8.0_333" +JDK_VERSION="1.8" +BASH_PROFILE_PATH="/root/.bash_profile" +BASHRC_PATH="/root/.bashrc" +ETC_PROFILE_PATH="/etc/profile" +JDK_TAR_NAME="jdk-8u333-linux-x64.tar.gz" + +jdkAvailable=$(java -version 2>&1 | awk 'NR==1{gsub(/"/,"");print $3}') +result=$(echo $jdkAvailable | grep $JDK_VERSION) +if [[ "$result" != "" ]]; then + echo "JDK installed.............................." +else + echo "JDK not installed.............................." + echo "JDK environment already sets" + pid="sed -i '/export JAVA_HOME/d' /etc/profile" + eval $pid + pid="sed -i '/export CLASSPATH/d' /etc/profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /root/.bash_profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /root/.bashrc" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bash_profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bashrc" + eval $pid + echo "Prepare to Install JDK..." + sleep 2s + mkdir -p ${JDK_FOLDER_PATH} + tar -zxvf ${PACKAGES_PATH}/${JDK_TAR_NAME} -C ${JDK_FOLDER_PATH} + JAVA_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}" + JRE_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}/jre" + JAVA_SOURCE_ENV="source /etc/profile" + echo "export JAVA_HOME=$JAVA_HOME" >>/etc/profile + echo "export JRE_HOME=$JRE_HOME" >>/etc/profile + echo "export CLASSPATH=.:\$JRE_HOME/lib/rt.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar" >>/etc/profile + echo "export PATH=\$PATH:\$JAVA_HOME/bin" >>/etc/profile + echo ${JAVA_SOURCE_ENV} >>~/.bash_profile + echo ${JAVA_SOURCE_ENV} >>~/.bashrc + echo "Prepare to config BCPROV..." + JAVA_SECURITY_DIR="${JAVA_HOME}/jre/lib/security/java.security" + JAVA_BCPROV_DIR="${JAVA_HOME}/jre/lib/ext/" + JAVA_BCPROV_JAR="${PACKAGES_PATH}/bcprov-jdk15on-1.68.jar" + + JAVA_SECURITY_ARGS_ARR[0]="security.provider.1=sun.security.provider.Sun" + JAVA_SECURITY_ARGS_ARR[1]="security.provider.2=sun.security.rsa.SunRsaSign" + JAVA_SECURITY_ARGS_ARR[2]="security.provider.3=com.sun.net.ssl.internal.ssl.Provider" + JAVA_SECURITY_ARGS_ARR[3]="security.provider.4=com.sun.crypto.provider.SunJCE" + JAVA_SECURITY_ARGS_ARR[4]="security.provider.5=sun.security.jgss.SunProvider" + JAVA_SECURITY_ARGS_ARR[5]="security.provider.6=com.sun.security.sasl.Provider" + JAVA_SECURITY_ARGS_ARR[6]="security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI" + JAVA_SECURITY_ARGS_ARR[7]="security.provider.8=sun.security.smartcardio.SunPCSC" + JAVA_SECURITY_ARGS_ARR[8]="security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider" + + for element in ${JAVA_SECURITY_ARGS_ARR[@]}; do + JAVA_SECURITY_ARGS="${JAVA_SECURITY_ARGS}${element}\n" + done + + echo -e ${JAVA_SECURITY_ARGS} >>${JAVA_SECURITY_DIR} + cp -a ${JAVA_BCPROV_JAR} ${JAVA_BCPROV_DIR} + + echo "BCPROV Installed." + + echo "If you need to effect the environment variable in the current session, do it manually: " + source ${BASH_PROFILE_PATH} + source ${BASHRC_PATH} + source ${ETC_PROFILE_PATH} + jdk2=$(grep -n "export JAVA_HOME=.*" /home/hadoop/.bash_profile | cut -f1 -d':') + if [ -n "$jdk2" ]; then + echo "JDK HADOOP environment exists" + else + echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bash_profile + echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bashrc + echo "JDK HADOOP environment sets successfully" + fi + echo "JDK install successfully" + source /etc/profile +fi +echo "INIT-init-jdk.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-krb5-devel.sh b/datasophon-init/bin/init-krb5-devel.sh new file mode 100644 index 00000000..77826bf4 --- /dev/null +++ b/datasophon-init/bin/init-krb5-devel.sh @@ -0,0 +1,36 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +KRB5_FOLDER_NAME=krb5-devel +KRB5_TAR_NAME=krb5-devel.tar.gz +rpm -qa | grep krb5-devel +if [ "$?" == "0" ]; then +echo "rpm -qa | grep krb5-devel exists" +else + yum -y install krb5-devel + rpm -qa | grep krb5-devel + if [ "$?" == "0" ]; then + echo "krb5-devel install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-libxslt-devel.sh b/datasophon-init/bin/init-libxslt-devel.sh new file mode 100644 index 00000000..c4b57dcf --- /dev/null +++ b/datasophon-init/bin/init-libxslt-devel.sh @@ -0,0 +1,27 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +rpm -qa | grep libxslt-devel +if [ "$?" == "0" ]; then +echo "libxslt-devel exists" +else + yum -y install libxslt-devel + rpm -qa | grep libxslt-devel + if [ "$?" == "0" ]; then + echo "libxslt_devel install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-mysql-8.sh b/datasophon-init/bin/init-mysql-8.sh new file mode 100644 index 00000000..20410214 --- /dev/null +++ b/datasophon-init/bin/init-mysql-8.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +num1="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +rpm -qa | grep zlib-devel +if [ "$?" == "0" ]; then + echo "zlib-devel exists" +else + yum -y install zlib-devel + rpm -qa | grep zlib-devel + if [ "$?" == "0" ]; then + echo "zlib-devel install successfully" + fi +fi + +rpm -qa | grep bzip2-devel +if [ "$?" == "0" ]; then + echo "bzip2-devel exists" +else + yum -y install bzip2-devel + rpm -qa | grep bzip2-devel + if [ "$?" == "0" ]; then + echo "bzip2-devel install successfully" + fi +fi + +rpm -qa | grep openssl-devel +if [ "$?" == "0" ]; then + echo "openssl-devel exists" +else + yum -y install openssl-devel + rpm -qa | grep openssl-devel + if [ "$?" == "0" ]; then + echo "openssl-devel install successfully" + fi +fi + +rpm -qa | grep ncurses-devel +if [ "$?" == "0" ]; then + echo "ncurses-devel exists" +else + yum -y install ncurses-devel + rpm -qa | grep ncurses-devel + if [ "$?" == "0" ]; then + echo "ncurses-devel install successfully" + fi +fi + +MYSQL_FOLDER_NAME=mysql-community-8.0.28.el8.x86_64 +MYSQL_TAR_NAME=mysql-community-8.0.28.el8.x86_64.tar.gz + +echo "mysql start install mysql-community-8.0.28-1.el8.x86_64........." +tar -zxvf ${PACKAGES_PATH}/${MYSQL_TAR_NAME} -C ${PACKAGES_PATH} +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-common-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-libs-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-devel-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-server-8.0.28-1.el8.x86_64.rpm + +mysqld --initialize --user=mysql +systemctl start mysqld +systemctl enable mysqld +sleep 2 +echo "${num1}" + +if [ $(systemctl status mysqld | grep running | wc -l) -eq 1 ]; then + echo "mysql在运行" + tmp_passwd=$(grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}') + echo "临时密码:${tmp_passwd}" + #mysql -uroot -p"${tmp_passwd}" --connect-expired-password -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}';" + #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}' PASSWORD EXPIRE NEVER;" + #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '${num1}';" + #mysql -uroot -p"${num1}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;" + #mysql -uroot -p"${num1}" -e "FLUSH PRIVILEGES;" + + /usr/bin/mysqladmin -uroot -p''$tmp_passwd'' password ''$num1'' + mysql -uroot -p''$num1'' -e "update mysql.user set host='%' where user ='root';" + mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" + mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED BY '$num1' PASSWORD EXPIRE NEVER;" + echo "num1:'$num1'" + mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '$num1';" + mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" + + cat >/etc/my.cnf </etc/chrony.conf </etc/chrony.conf </etc/chrony.conf < /etc/yum.repos.d/dataSophon.repo << EOF +[dataSophon-base] +name=dataSophon-base +baseurl=file:///data/private-yum-library/centos/8/x86_64/BaseOS/ +gpgcheck=0 +enable=1 + +[dataSophon-AppStream] +name=dataSophon-AppStream +baseurl=file:///data/private-yum-library/centos/8/x86_64/AppStream/ +gpgcheck=0 +enabled=1 + +[dataSophon-epel] +name=dataSophon-epel +baseurl=file:///data/private-yum-library/epel/8/x86_64/ +enabled=1 +gpgcheck=0 +EOF +yum clean all +yum makecache +echo "init-private-yum-library.sh finished." +echo "Done." + + +cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' +if [ $? -eq 0 ]; then + echo "httpd port modified successfully" >> ${initLogDir}/installSingle_`date +%Y%m%d`.log + systemctl stop httpd + systemctl start httpd + +else +echo "init httpd begin." +yum install httpd +cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' +sed -i 's/Listen 80/Listen 8000/g' /etc/httpd/conf/httpd.conf +systemctl start httpd +systemctl enable httpd +echo "init httpd finished." +fi +ln -s /data/private-yum-library/centos/ /var/www/html/ +ln -s /data/private-yum-library/epel/ /var/www/html/ +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts(){ +echo "#modify yum mapping hosts start" >> /etc/hosts +echo "${ip} yum.dataSophon.cn" >> /etc/hosts +echo "#modify yum mapping hosts end" >> /etc/hosts +source /etc/profile +source /root/.bash_profile +} +modifyYumHosts + +rm /etc/yum.repos.d/dataSophon.repo + +cat > /etc/yum.repos.d/dataSophon.repo << EOF +[dataSophon-base] +name=dataSophon-base +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/BaseOS/ +gpgcheck=0 +enable=1 + +[dataSophon-AppStream] +name=dataSophon-AppStream +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/AppStream/ +gpgcheck=0 +enabled=1 + +[dataSophon-epel] +name=dataSophon-epel +baseurl=http://yum.dataSophon.cn:8000/epel/8/x86_64/ +enabled=1 +gpgcheck=0 +EOF +yum clean all +yum makecache +echo "init-private-yum-library.sh finished." +echo "Done." + diff --git a/datasophon-init/bin/init-psmisc.sh b/datasophon-init/bin/init-psmisc.sh new file mode 100644 index 00000000..930587bc --- /dev/null +++ b/datasophon-init/bin/init-psmisc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +rpm -qa | grep psmisc +if [ "$?" == "0" ]; then +echo "psmisc exists" +else + yum -y install psmisc + rpm -qa | grep psmisc + if [ "$?" == "0" ]; then + echo "psmisc install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-pssh.sh b/datasophon-init/bin/init-pssh.sh new file mode 100644 index 00000000..9f44c07f --- /dev/null +++ b/datasophon-init/bin/init-pssh.sh @@ -0,0 +1,36 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +PSSH_FOLDER_NAME=pssh + +PSSH_TAR_NAME=pssh.tar.gz +rpm -qa | grep pssh +if [ "$?" == "0" ]; then +echo "pssh exists" +else + yum -y install pssh + rpm -qa | grep pssh + if [ "$?" == "0" ]; then + echo "pssh install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-pytest_runner.sh b/datasophon-init/bin/init-pytest_runner.sh new file mode 100644 index 00000000..085bc959 --- /dev/null +++ b/datasophon-init/bin/init-pytest_runner.sh @@ -0,0 +1,27 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +PYTEST_RUNNER_FOLDER_NAME=pytest_runner-5.2-py2.py3-none-any.whl + pip3 install ${PACKAGES_PATH}/${PYTEST_RUNNER_FOLDER_NAME} + echo "pytest_runner install successfully" + + diff --git a/datasophon-init/bin/init-python-rpm-macros.sh b/datasophon-init/bin/init-python-rpm-macros.sh new file mode 100644 index 00000000..4986d084 --- /dev/null +++ b/datasophon-init/bin/init-python-rpm-macros.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +MACROS_FOLDER_NAME=python-rpm-macros + +MACROS_TAR_NAME=python-rpm-macros.tar.gz +rpm -qa | grep python-rpm-macros +if [ "$?" == "0" ]; then +echo "python-rpm-macros exists" +else + yum -y install python-rpm-macros + rpm -qa | grep python-rpm-macros + if [ "$?" == "0" ]; then + echo "python-rpm-macros install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-python-srpm-macros.sh b/datasophon-init/bin/init-python-srpm-macros.sh new file mode 100644 index 00000000..1146808d --- /dev/null +++ b/datasophon-init/bin/init-python-srpm-macros.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +SRPM_FOLDER_NAME=python-srpm-macros + +SRPM_TAR_NAME=python-srpm-macros.tar.gz +rpm -qa | grep python-srpm-macros +if [ "$?" == "0" ]; then +echo "python-srpm-macros exists" +else + yum -y install python-srpm-macros + rpm -qa | grep python-srpm-macros + if [ "$?" == "0" ]; then + echo "python-srpm-macros install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-python2-rpm-macros.sh b/datasophon-init/bin/init-python2-rpm-macros.sh new file mode 100644 index 00000000..46202c66 --- /dev/null +++ b/datasophon-init/bin/init-python2-rpm-macros.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +MACROS2_FOLDER_NAME=python2-rpm-macros + +MACROS2_TAR_NAME=python2-rpm-macros.tar.gz +rpm -qa | grep python2-rpm-macros +if [ "$?" == "0" ]; then +echo "python2-rpm-macros exists" +else + yum -y install python2-rpm-macros + rpm -qa | grep python-rpm-macros + if [ "$?" == "0" ]; then + echo "python2-rpm-macros install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-python36-devel.sh b/datasophon-init/bin/init-python36-devel.sh new file mode 100644 index 00000000..7fb0b7f3 --- /dev/null +++ b/datasophon-init/bin/init-python36-devel.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +PYTHON36_DEVEL_FOLDER_NAME=python36-devel + +PYTHON36_DEVEL_TAR_NAME=python36-devel.tar.gz +rpm -qa | grep python3 +if [ "$?" == "0" ]; then +echo "rpm -qa | grep python36-devel exists" +else + yum -y install python36-devel + rpm -qa | grep python3 + if [ "$?" == "0" ]; then + echo "python36-devel install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-redhat-lsb.sh b/datasophon-init/bin/init-redhat-lsb.sh new file mode 100644 index 00000000..0f7b5db4 --- /dev/null +++ b/datasophon-init/bin/init-redhat-lsb.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +REDHAT_LSB_FOLDER_NAME=redhat-lsb + +REDHAT_LSB_TAR_NAME=redhat-lsb.tar.gz +rpm -qa | grep redhat-lsb +if [ "$?" == "0" ]; then +echo "redhat-lsb exists" +else + yum -y install redhat-lsb* + rpm -qa | grep redhat-lsb* + if [ "$?" == "0" ]; then + echo "redhat-lsb install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-six.sh b/datasophon-init/bin/init-six.sh new file mode 100644 index 00000000..8fbda174 --- /dev/null +++ b/datasophon-init/bin/init-six.sh @@ -0,0 +1,32 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +SIX_FOLDER_NAME=six-1.15.0 +SIX_TAR_NAME=six-1.15.0.tar.gz + tar -zxvf ${PACKAGES_PATH}/${SIX_TAR_NAME} -C ${PACKAGES_PATH} + cd ${PACKAGES_PATH}/${SIX_FOLDER_NAME} + python3 setup.py install + cd ${INIT_BIN_PATH} + echo "six-1.15.0 install successfully" + + diff --git a/datasophon-init/bin/init-sourceSSHHostname.sh b/datasophon-init/bin/init-sourceSSHHostname.sh new file mode 100644 index 00000000..63e32d48 --- /dev/null +++ b/datasophon-init/bin/init-sourceSSHHostname.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "StrictHostKeyChecking no" >~/.ssh/config diff --git a/datasophon-init/bin/init-ssh-copy-key.sh b/datasophon-init/bin/init-ssh-copy-key.sh new file mode 100644 index 00000000..1edbb709 --- /dev/null +++ b/datasophon-init/bin/init-ssh-copy-key.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +INITAllHostNums=$2 +port=$3 +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +removeSSHAsk() { + sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config + sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config + sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config +} +copyKeyConfig(){ +# authorized_keys +# known_hosts +# scp -r /root/.ssh/ root@192.168.216.20:/root/ + +user=root +sshDir="/${user}/.ssh" + +function prop { + [ -f "${filePath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${filePath} | cut -d'=' -f2 +} +for ((i=1; i<=${INITAllHostNums}; i++)) +do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo $ip + echo $pwd + echo $port +/usr/bin/expect <<-EOF +set timeout -1 +spawn scp -P${port} -r $sshDir/ $user@$ip:/${user}/ +expect { + "yes/no" { send "yes\r"; exp_continue } + "password:" { send "$pwd\r" } + } + expect eof + EOF +done +echo -e "\nFinish copy ssh config." +} + +removeSSHAsk +copyKeyConfig + +echo "init-ssh-copy-key.sh finished." + + +echo "repai_init-ssh.sh finished." +echo "Done." + + + + diff --git a/datasophon-init/bin/init-ssh-gen-key.sh b/datasophon-init/bin/init-ssh-gen-key.sh new file mode 100644 index 00000000..8c7a1019 --- /dev/null +++ b/datasophon-init/bin/init-ssh-gen-key.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +sh ${INIT_BIN_PATH}/init-sshpackage.sh +sh ${INIT_BIN_PATH}/init-expect.sh + +removeSSHAsk() { + echo "begin removeSSHAsk....." + sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config + sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config + sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config +} + + +keygenConfig(){ +# ssh-keygen -t rsa +sshPath=/root/.ssh +if [ ! -r "${sshPath}/id_rsa.pub" ]; then +echo "id_rsa.pub nonexistent creating......" +/usr/bin/expect <<-EOF +set timeout 10 +spawn ssh-keygen -t rsa +expect { + "Enter file in which to save the key (/root/.ssh/id_rsa): " { send "\r"; exp_continue } + "Overwrite (y/n)? " { send "y\r"; exp_continue } + "Enter passphrase (empty for no passphrase): " { send "\r"; exp_continue } + "Enter same passphrase again: " { send "\r" } + } + expect eof + EOF + +wait +echo "Finish ssh-keygen -t rsa." +else +echo "id_rsa.pub exists" +fi +} + +configAuthorizedKeys(){ + user=root + sshDir="/${user}/.ssh" + cat ${sshDir}/id_rsa.pub >> ${sshDir}/authorized_keys +} +removeSSHAsk +keygenConfig +configAuthorizedKeys + +echo "init-ssh-gen-key.sh finished." +echo "Done." + + + + diff --git a/datasophon-init/bin/init-ssh-hadoop.sh b/datasophon-init/bin/init-ssh-hadoop.sh new file mode 100644 index 00000000..328723ad --- /dev/null +++ b/datasophon-init/bin/init-ssh-hadoop.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +initAllHostNums="$2" +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + + sshHadoopDir=/home/hadoop/.ssh/ + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${filePath} ${initAllHostNums} + bash ${INIT_BIN_PATH}/init-pssh.sh + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" + pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-add-hadoop-user.sh + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p /home/hadoop/" + pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r /root/.ssh /home/hadoop/ + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "chown hadoop:hadoop -R '${sshHadoopDir}'" +echo "repair init-ssh-hadoop.sh finished." +echo "Done." + + + + diff --git a/datasophon-init/bin/init-sshpackage.sh b/datasophon-init/bin/init-sshpackage.sh new file mode 100644 index 00000000..70aa693c --- /dev/null +++ b/datasophon-init/bin/init-sshpackage.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +SSH_FOLDER_NAME=ssh +SSH_TAR_NAME=ssh.tar.gz + +ssh_rpm=`rpm -qa | grep openssh` +if [[ "$?" == "0" ]]; then + echo "ssh exists" + else + yum -y install openssh + echo "ssh-install finished." +fi + +echo "init-sshpackage.sh finished." +echo "Done." + + diff --git a/datasophon-init/bin/init-sshpass.sh b/datasophon-init/bin/init-sshpass.sh new file mode 100644 index 00000000..03d6c926 --- /dev/null +++ b/datasophon-init/bin/init-sshpass.sh @@ -0,0 +1,37 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +SSHPASS_FOLDER_NAME=sshpass + +SSHPASS_TAR_NAME=sshpass.tar.gz +rpm -qa | grep sshpass +if [ "$?" == "0" ]; then +echo "sshpass exists" +else + yum -y install sshpass + rpm -qa | grep sshpass + if [ "$?" == "0" ]; then + echo "init sshpass install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-stop-firewall.sh b/datasophon-init/bin/init-stop-firewall.sh new file mode 100644 index 00000000..03777a2c --- /dev/null +++ b/datasophon-init/bin/init-stop-firewall.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# example: sh init-stop-firewall.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +FIREWALL_STATUS=`firewall-cmd --state` +if [[ ${FIREWALL_STATUS} == "running" ]] +then + echo "Closing firewall." + systemctl stop firewalld.service + systemctl disable firewalld.service + echo "Firewall closed." +else + echo "Firewall closed." +fi +echo "init-stop-firewall.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-stop-selinux.sh b/datasophon-init/bin/init-stop-selinux.sh new file mode 100644 index 00000000..f8b7d411 --- /dev/null +++ b/datasophon-init/bin/init-stop-selinux.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# example: sh init-stop-firewall.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + + +SELINUX_STATUS=`getenforce` +SELINUX_CONFIG_PATH="/etc/selinux/config" +if [[ ${SELINUX_STATUS} == "Enforcing" ]] +then + echo "Closing SELINUX." + setenforce 0 + echo "Disabling SELINUX." + sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" ${SELINUX_CONFIG_PATH} + echo "SELINUX closed." +else + echo "SELINUX closed." +fi + +echo "init-stop-selinux.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-system-conf.sh b/datasophon-init/bin/init-system-conf.sh new file mode 100644 index 00000000..7688c6ae --- /dev/null +++ b/datasophon-init/bin/init-system-conf.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# example: sh init-system-conf.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + + +# vi /etc/systemd/system.conf +# DefaultLimitNOFILE=102400000 +# DefaultLimitNPROC=102400000 +sed -i '/DefaultLimitNOFILE=/d' /etc/systemd/system.conf +sed -i '/DefaultLimitNPROC=/d' /etc/systemd/system.conf + +cat << EOF >> /etc/systemd/system.conf +DefaultLimitNOFILE=1024000 +DefaultLimitNPROC=1024000 +EOF + +# vi /etc/security/limits.conf +#* soft fsize unlimited +#* hard fsize unlimited +#* soft cpu unlimited +#* hard cpu unlimited +#* soft as unlimited +#* hard as unlimited +#* soft nofile 10240000 +#* hard nofile 10240000 +#* soft nproc 10240000 +#* hard nproc 10240000 + +sed -i '/* soft fsize/d' /etc/security/limits.conf +sed -i '/* hard fsize/d' /etc/security/limits.conf +sed -i '/* soft cpu/d' /etc/security/limits.conf +sed -i '/* hard cpu/d' /etc/security/limits.conf +sed -i '/* soft as/d' /etc/security/limits.conf +sed -i '/* hard as/d' /etc/security/limits.conf +sed -i '/* soft nofile/d' /etc/security/limits.conf +sed -i '/* hard nofile/d' /etc/security/limits.conf +sed -i '/* soft nproc/d' /etc/security/limits.conf +sed -i '/* hard nproc/d' /etc/security/limits.conf + +cat << EOF >> /etc/security/limits.conf +* soft fsize unlimited +* hard fsize unlimited +* soft cpu unlimited +* hard cpu unlimited +* soft as unlimited +* hard as unlimited +* soft nofile 1048576 +* hard nofile 1048576 +* soft nproc unlimited +* hard nproc unlimited +EOF + +# vi /etc/security/limits.d/20-nproc.conf +#* soft nproc 102400000 +#root soft nproc unlimited + +cat << EOF > /etc/security/limits.d/20-nproc.conf +# Default limit for number of user's processes to prevent +# accidental fork bombs. +# See rhbz #432903 for reasoning. + +* soft nproc unlimited +root soft nproc unlimited +EOF + +echo "kernel.pid_max=1000000" >> /etc/sysctl.conf +sysctl -p + +echo "init-system-conf finished." +echo "Done." diff --git a/datasophon-init/bin/init-test.sh b/datasophon-init/bin/init-test.sh new file mode 100644 index 00000000..d01dcb98 --- /dev/null +++ b/datasophon-init/bin/init-test.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +num1="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +INIT_SQL_PATH=${INIT_PATH}/sql +echo "INIT_SQL_PATH: ${INIT_SQL_PATH}" +#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DDL.sql; +#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DML.sql; + +mysql -udatasophon -p'datasophon' <> /usr/lib/tmpfiles.d/tmp.conf + echo "x /tmp/hsperfdata*/*" >> /usr/lib/tmpfiles.d/tmp.conf + echo "X /tmp/hsperfdata*" >> /usr/lib/tmpfiles.d/tmp.conf +} + +modifyHostname + +echo "init-tmp_pid.sh finished." diff --git a/datasophon-init/bin/init-websocket_client.sh b/datasophon-init/bin/init-websocket_client.sh new file mode 100644 index 00000000..dccbb7d2 --- /dev/null +++ b/datasophon-init/bin/init-websocket_client.sh @@ -0,0 +1,32 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +WEBSOCKET_CLIENT_FOLDER_NAME=websocket_client-0.54.0 +WEBSOCKET_CLIENT_TAR_NAME=websocket_client-0.54.0.tar.gz + tar -zxvf ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_TAR_NAME} -C ${PACKAGES_PATH} + cd ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_FOLDER_NAME} + python3 setup.py install + cd ${INIT_PATH} + echo "websocket_client install successfully" + + diff --git a/datasophon-init/bin/init-xdg-utils.sh b/datasophon-init/bin/init-xdg-utils.sh new file mode 100644 index 00000000..a8a2fb19 --- /dev/null +++ b/datasophon-init/bin/init-xdg-utils.sh @@ -0,0 +1,30 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +XDG_FOLDER_NAME=xdg-utils +XDG_TAR_NAME=xdg-utils.tar.gz +rpm -qa | grep xdg-utils +if [ "$?" == "0" ]; then +echo "rpm -qa | grep xdg-utils exists" +else + yum -y install xdg-utils + rpm -qa | grep xdg-utils + if [ "$?" == "0" ]; then + echo "xdg-utils install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-yum-hosts-mapping.sh b/datasophon-init/bin/init-yum-hosts-mapping.sh new file mode 100644 index 00000000..b000bef2 --- /dev/null +++ b/datasophon-init/bin/init-yum-hosts-mapping.sh @@ -0,0 +1,52 @@ +#!/bin/bash +ip="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +rm -rf /etc/yum.repos.d/backup +mkdir -p /etc/yum.repos.d/backup +mv `find /etc/yum.repos.d/ -name "*.repo"` /etc/yum.repos.d/backup + +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts(){ +echo "#modify yum mapping hosts start" >> /etc/hosts +echo "${ip} yum.dataSophon.cn" >> /etc/hosts +echo "#modify yum mapping hosts end" >> /etc/hosts +} +modifyYumHosts +cat > /etc/yum.repos.d/dataSophon.repo << EOF +[dataSophon-base] +name=dataSophon-base +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/BaseOS/ +gpgcheck=0 +enable=1 + +[dataSophon-AppStream] +name=dataSophon-AppStream +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/AppStream/ +gpgcheck=0 +enabled=1 + +[dataSophon-epel] +name=dataSophon-epel +baseurl=http://yum.dataSophon.cn:8000/epel/8/x86_64/ +enabled=1 +gpgcheck=0 +EOF + +yum clean all + +yum makecache +echo "init-yum-hosts-mapping.sh finished." +echo "Done." diff --git a/datasophon-init/config/init-host-info-add.properties b/datasophon-init/config/init-host-info-add.properties new file mode 100644 index 00000000..290e51b3 --- /dev/null +++ b/datasophon-init/config/init-host-info-add.properties @@ -0,0 +1,21 @@ +# 1.Please provide the information of added hosts needed to be inited in the format specified below +# 2.dataSophon.ip.i(eg:i=1,2,3.....): +# 3.dataSophon.password.i: +# 4.dataSophon.ssh.port.i: +# 5.dataSophon.ssh.port.hostname.i: +dataSophon.ip.1=127.0.0.1(need to change) +dataSophon.password.1=your-node-root-password(need to change) +dataSophon.ssh.port.1=22 +dataSophon.ssh.port.hostname.1=your-node-hostname(need to change) + +dataSophon.ip.2=127.0.0.1(need to change) +dataSophon.password.2=your-node-root-password(need to change) +dataSophon.ssh.port.2=22 +dataSophon.ssh.port.hostname.2=your-node-hostname(need to change) + + +dataSophon.ip.3=127.0.0.1(need to change) +dataSophon.password.3=your-node-root-password(need to change) +dataSophon.ssh.port.3=22 +dataSophon.ssh.port.hostname.3=your-node-hostname(need to change) + diff --git a/datasophon-init/config/init-host-info.properties b/datasophon-init/config/init-host-info.properties new file mode 100644 index 00000000..676c1f3f --- /dev/null +++ b/datasophon-init/config/init-host-info.properties @@ -0,0 +1,15 @@ +# 1.Please provide the information of hosts needed to be inited in the format specified below +# 2.dataSophon.ip.i(eg:i=1,2,3.....): +# 3.dataSophon.password.i: +# 4.dataSophon.ssh.port.i: +# 5.dataSophon.ssh.port.hostname.i: +dataSophon.ip.1=172.31.51.194 +dataSophon.password.1=max123!@# +dataSophon.ssh.port.1=22 +dataSophon.ssh.port.hostname.1=dataSophon0 + +dataSophon.ip.2=172.31.51.191 +dataSophon.password.2=max@123!@# +dataSophon.ssh.port.2=22 +dataSophon.ssh.port.hostname.2=dataSophon1 + diff --git a/datasophon-init/config/init.properties b/datasophon-init/config/init.properties new file mode 100644 index 00000000..797288ba --- /dev/null +++ b/datasophon-init/config/init.properties @@ -0,0 +1,28 @@ +# Set the YUM source host IP +yum.repo.host.ip=172.31.51.194 + +#The Host information for installing the NMAP service +nmap.server.ip=172.31.51.194 +nmap.server.port=22 +nmap.server.password=max123!@# + +# The Host information for installing the NTP service(Master) +ntp.master.ip=172.31.51.194 + +# Install MySQL machine node information +mysql.ip=172.31.51.194 +mysql.host.ssh.port=22 +mysql.host.ssh.password=max123!@# + +# Set the MYSQL database login password +mysql.password=max2022sh + +# The total number of machines needed to be init. +init.host.num=2 + +# The total number of added machines needed to be init. +init.add.host.num=0 + +# Common Settings. +init.log.dir=./logs + diff --git a/datasophon-init/remove/remove-host-info.properties b/datasophon-init/remove/remove-host-info.properties new file mode 100644 index 00000000..a2d3bb97 --- /dev/null +++ b/datasophon-init/remove/remove-host-info.properties @@ -0,0 +1,22 @@ +# 1.Please provide the information of hosts needed to be cleared in the format specified below + +dataSophon.ip.1=127.0.0.1(need to change) +dataSophon.ssh.port.1=22 + + +dataSophon.ip.2=127.0.0.1(need to change) +dataSophon.ssh.port.2=22 + + +dataSophon.ip.3=127.0.0.1(need to change) +dataSophon.ssh.port.3=22 + +remove.host.num=n(The total nodes of Cluster needed to be cleared ) + +# MySQL machine node information +mysql.ip=127.0.0.1(need to change) +mysql.host.ssh.port=22 +mysql.host.ssh.password=your-mysql-password(need to change) + +# the MYSQL database login password +mysql.password=ucloud.cn1qaz!QAZ(need to change) \ No newline at end of file diff --git a/datasophon-init/sbin/init.sh b/datasophon-init/sbin/init.sh new file mode 100644 index 00000000..7ef83418 --- /dev/null +++ b/datasophon-init/sbin/init.sh @@ -0,0 +1,786 @@ +#!/bin/bash +Action="$1" + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +BASE_DIR=$(dirname $0) + +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +echo "Bash Path: ${BASE_PATH}" +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_CONFIG_PATH=${INIT_PATH}/config +echo "INIT_CONFIG_PATH: ${INIT_CONFIG_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +hostAllInfoPath=${INIT_CONFIG_PATH}/init-host-info.properties +echo "hostAllInfoPath: ${hostAllInfoPath}" +hostSingleInfoPath=${INIT_CONFIG_PATH}/init-host-info-add.properties +echo "hostSingleInfoPath: ${hostSingleInfoPath}" +FilePath=${INIT_CONFIG_PATH}/init.properties +echo "FilePath: ${FilePath}" +JDK_PATH=/opt/module +smallTimeOut=300 +middleTimeOut=600 +longTimeOut=1200 + +function prop { + [ -f "$FilePath" ] && grep -P "^\s*[^#]?${1}=.*$" $FilePath | cut -d'=' -f2 +} + +ntpMasterIP=$(prop "ntp.master.ip") +mysqlIP=$(prop "mysql.ip") +mysqlPort=$(prop "mysql.host.ssh.port") +mysqlHostSshPassword=$(prop "mysql.host.ssh.password") +mysqlPassword=$(prop "mysql.password") +nmapServerIp=$(prop "nmap.server.ip") +nmapServerPort=$(prop "nmap.server.port") +nmapServerPassword=$(prop "nmap.server.password") +initLogDir=$(prop "init.log.dir") +yumRepoIp=$(prop "yum.repo.host.ip") +initAllHostNums=$(prop "init.host.num") +initSingleHostNums=$(prop "init.add.host.num") + +echo "yumRepoIp: ${yumRepoIp}" + +initALL() { + function network() { + local timeout=1 + + local target=www.baidu.com + + local ret_code=$(curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1) + + if [ "x$ret_code" = "x200" ]; then + return 1 + else + return 0 + fi + + return 0 + } + + network + + if [ $? -eq 0 ]; then + echo -e "\033[31m 由于机器没有联网,请自行检查设置正确的机器时间! \033[0m" + read -p "Please confirm whether the time displayed by the machine is correct(yes/no):" isCorrect + if [ "$isCorrect" = "yes" ]; then + echo "机器时间设置正常,请进行如下环境初始化操作" + else + echo "机器时间不正确,请设置正确时间后,再进行 DataSophon 初始化环境操作" + exit + fi + else + echo "机器可以联网,无需自行检查系统时间是否正常" + fi + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + rm -rf ${initLogDir}/installAllSuccess_$(date +%Y%m%d).log + + #如果文件不存在 + if [ ! -f "/data/private-yum-library.tar.gz" ]; then + echo "the initial work needn't use the provided YUM" + else + mv /etc/yum.repos.d/backup/* /etc/yum.repos.d + mkdir -p /etc/yum.repos.d/backup + mv $(find /etc/yum.repos.d/ -name "*.repo") /etc/yum.repos.d/backup + bash ${INIT_BIN_PATH}/init-stop-firewall.sh + bash ${INIT_BIN_PATH}/init-stop-selinux.sh + bash ${INIT_BIN_PATH}/init-private-yum-library.sh ${yumRepoIp} + fi + secretFreeAllLogin + checkSecretFreeAllLogin + + #close all Firewall + echo "closeAllFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + echo "closeAllFirewall end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + checkCloseAllFirewall + + #close all selinux + echo "closeAllSelinux start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-selinux.sh >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + echo "closeAllSelinux end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + + #close all Swap + echo "closeAllSwap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-swap.sh >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + echo "closeAllSwap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + checkcloseAllSwap + + #configure all slave node yum source + if [ ! -f "/data/private-yum-library.tar.gz" ]; then + echo "the initial work needn't use the provided YUM" + else + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-yum-hosts-mapping.sh ${yumRepoIp} >>${initLogDir}/modifyYumRepo_$(date +%Y%m%d).log + fi + + #optimiz system conf + echo "modifyAllSystemConf start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-system-conf.sh >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + echo "modifyAllSystemConf end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + + #Configure all hostname + setAllHostname + checkHostName + + #Configure all hosts + echo "modifyAllhostRelation start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-allhosts.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + echo "modifyAllhostRelation end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-sourceSSHHostname.sh + installServerNmap + + #Configure NTP + initAllNtpChronyService + checkNtpChronyService + + #Configurelibxslt_devel + echo "installAlllibxsltdevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-libxslt-devel.sh >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + echo "installAlllibxsltdevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + checkLibxsltDevel + #Configure Psmisc + echo "installAllpsmisc start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-psmisc.sh >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + echo "installAllpsmisc end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + checkPsmisc + + echo "installAllPerlJSON start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-perl-JSON.sh >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + echo "installAllPerlJSON end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + + #Configure Mysql and DataSophon data + initMysqlDataSophon + initMysqlDevel + + #Configure Disable transparent-hugepage + echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-transparent-hugepage.sh >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + checkTransparentHugepage + + #Configure JDK + echo "installAllJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + echo "installAllJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + checkJDK + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-tmp_pid.sh + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-xdg-utils.sh >>${initLogDir}/installXdg_$(date +%Y%m%d).log + checkXdg + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${middleTimeOut} -i bash ${INIT_BIN_PATH}/init-redhat-lsb.sh >>${initLogDir}/installRedhatLsb_$(date +%Y%m%d).log + checkRedhatLsb + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python2-rpm-macros.sh >>${initLogDir}/installPython2Macros_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-srpm-macros.sh >>${initLogDir}/installPythonSrpmMacros_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-rpm-macros.sh >>${initLogDir}/installPythonMacros_$(date +%Y%m%d).log + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-init-python-devel.sh >> ${initLogDir}/installPythonDevel_`date +%Y%m%d`.log + #checkPythonDevel + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cyrus-sasl.sh >>${initLogDir}/installCyrusSasl_$(date +%Y%m%d).log + checkCyrusSasl + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python36-devel.sh >>${initLogDir}/installPython36Devel_$(date +%Y%m%d).log + checkPython36Devel + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-gcc-c++.sh >>${initLogDir}/installGccC++_$(date +%Y%m%d).log + checkGccC + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-Cython.sh >>${initLogDir}/installCython_$(date +%Y%m%d).log + checkCython + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-six.sh >>${initLogDir}/installSix_$(date +%Y%m%d).log + checkSix + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-websocket_client.sh >>${initLogDir}/installWebsocketClient_$(date +%Y%m%d).log + checkWebsocketClient + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ecdsa.sh >>${initLogDir}/installEcdsa_$(date +%Y%m%d).log + checkecdsa + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-pytest_runner.sh >>${initLogDir}/installPytestRunner_$(date +%Y%m%d).log + checkPytestRunner + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-krb5-devel.sh >>${initLogDir}/installKrb5Devel_$(date +%Y%m%d).log + checkKrb5Devel + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp_enable.sh >>${initLogDir}/installSingleNtpEnable_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-chmod-dev-null.sh >>${initLogDir}/chmodDevNull_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cleanBuff-async.sh >>${initLogDir}/cleanBuff_$(date +%Y%m%d).log + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + initsource + source /etc/profile + source /root/.bash_profile + echo "The DataSophon deployment environment of added nodes has been inited successfully . Please proceed to the next step" >>${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log + +} + +initsource() { + source /etc/profile + source /root/.bash_profile + echo $(java -version) +} + +testFun() { + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log +} + +#免密登录 +secretFreeAllLogin() { + echo "secretFreeAllLogin........................" + mkdir -p ${initLogDir} + echo "secretFreeAllLogin start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + rpm -qa | grep openssh + if [[ "$?" == "0" ]]; then + echo "ssh exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + echo "${INIT_BIN_PATH}" + else + bash ${INIT_BIN_PATH}/init-sshpackage.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + fi + rpm -qa | grep sshpass + if [[ "$?" == "0" ]]; then + echo "sshpass exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + else + bash ${INIT_BIN_PATH}/init-sshpass.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + fi + rpm -qa | grep expect-5.45 + if [[ "$?" == "0" ]]; then + echo "expect exists" + else + bash ${INIT_BIN_PATH}/init-expect.sh + fi + bash ${INIT_BIN_PATH}/init-ssh-gen-key.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostAllInfoPath} ${initAllHostNums} ${nmapServerPort} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + echo "secretFreeAllLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log +} + +#检查免密登录 +checkSecretFreeAllLogin() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${pwd}" + echo "${hostAllInfoPath}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'ls' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All free login links have been init successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查所有的swap是否关闭 +checkcloseAllSwap() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /etc/sysctl.conf | grep vm.swappiness=0' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All closing swap links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查所有的Firewall是否关闭 +checkCloseAllFirewall() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'firewall-cmd --state' >${initLogDir}/checkCloseAllFirewall.log + cat ${initLogDir}/checkCloseAllFirewall.log | grep running + if [ $? -eq 0 ]; then + echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + else + echo "${ip} close firewall successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + fi + done + echo "SUCCESS: All closing firewall links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#设置所有的的hostname +setAllHostname() { + echo "setAllHostname start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") + + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-hostname.sh ${hostname} >${initLogDir}/setAllHostname_$(date +%Y%m%d).log + done + echo "setAllHostname end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log +} + +#检查设置所有的的hostname +checkHostName() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # hostname + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'hostname' >${initLogDir}/checkHostName.log + cat ${initLogDir}/checkHostName.log | grep "${hostname}" + if [ $? -eq 0 ]; then + echo "${ip} set hostname successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: set hostname links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#安装nmap +installServerNmap() { + echo "installServerNmap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log + sshpass -p'${nmapServerPassword}' ssh -P${nmapServerPort} -o StrictHostKeyChecking=no root@${nmapServerIp} bash ${INIT_BIN_PATH}/init-nmap.sh >${initLogDir}/installServerNmap_$(date +%Y%m%d).log + echo "installServerNmap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log +} + +#初始化配置安装Ntp服务 +initAllNtpChronyService() { + echo "initAllNtpChronyService start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + if [ "${ntpMasterIP}" = "${ip}" ]; then + echo "masterntp" + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-server.sh >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + else + echo "slaventp" + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-slave.sh ${ntpMasterIP} >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + fi + done + echo "initAllNtpChronyService end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log +} + +#检查配置安装的Ntp服务 +checkNtpChronyService() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep chrony-' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set ntp Chrony have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的libxslt-devel +checkLibxsltDevel() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep libxslt-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set libxslt devel have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的Psmisc +checkPsmisc() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep psmisc' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set psmisc have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#配置安装mysql8以及初始化DataSophon数据库 +initMysqlDataSophon() { + echo "initMysqlDataSophon start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + echo "${mysqlIP}" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + sshpass -p'${mysqlHostSshPassword}' ssh -P${mysqlPort} -o StrictHostKeyChecking=no root@${mysqlIP} bash ${INIT_BIN_PATH}/init-mysql-datasophon.sh $mysqlPassword >${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + echo "initMysqlDataSophon end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log +} + +#配置安装mysql-devel +initMysqlDevel() { + rm -rf ${INIT_BIN_PATH}/m.txt + echo "initMysqlDevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + + if [ "${mysqlIP}" = "${ip}" ]; then + echo "already install mysql" + else + echo -e "root@${ip}:${port}" >>${INIT_BIN_PATH}/m.txt + fi + done + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-devel.sh >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-client.sh >> ${initLogDir}/initMysqlDevel_`date +%Y%m%d`.log + rm -rf ${INIT_BIN_PATH}/m.txt + echo "initMysqlDevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log +} + +#检查配置配置安装Cython +checkCython() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep Cython' >${initLogDir}/checkCython.log + cat ${initLogDir}/checkCython.log | grep Cython + if [ $? -eq 0 ]; then + echo "${ip} set Cython successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set Cython links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} +#检查配置配置安装Six +checkSix() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep six' >${initLogDir}/checkSix.log + cat ${initLogDir}/checkSix.log | grep six + if [ $? -eq 0 ]; then + echo "${ip} set Six successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set Six links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装WebsocketClient +checkWebsocketClient() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep websocket-client' >${initLogDir}/checkWebsocketClient.log + cat ${initLogDir}/checkWebsocketClient.log | grep websocket-client + if [ $? -eq 0 ]; then + echo "${ip} set websocket-client successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set websocket-client links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#配置禁止透明大页 +checkTransparentHugepage() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep [never]' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All transparent_hugepage links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的jdk环境 +checkJDK() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'source /etc/profile ; java -version' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set JDK links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的xdg-utils +checkXdg() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep xdg-utils' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set xdg-utils links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的redhat-lsb +checkRedhatLsb() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep redhat-lsb' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set redhat-lsb links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkecdsa() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep ecdsa' >${initLogDir}/checkecdsa.log + cat ${initLogDir}/checkecdsa.log | grep ecdsa + if [ $? -eq 0 ]; then + echo "${ip} set ecdsa successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set ecdsa links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkPytestRunner() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep pytest-runner' >${initLogDir}/checkPytestRunner.log + cat ${initLogDir}/checkPytestRunner.log | grep pytest-runner + if [ $? -eq 0 ]; then + echo "${ip} set pytest-runner successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set pytest-runner links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkKrb5Devel() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep krb5-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set krb5-devel links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +if [ "$Action" = "initAll" ]; then + initALL + echo "initALL....................." +fi +if [ "$Action" = "secretFreeAllLogin" ]; then + secretFreeAllLogin +fi +if [ "$Action" = "checkcloseAllSwap" ]; then + checkcloseAllSwap +fi + +if [ "$Action" = "testFun" ]; then + testFun +fi diff --git a/datasophon-init/sql/R1.1.0.sql b/datasophon-init/sql/R1.1.0.sql new file mode 100644 index 00000000..dd988beb --- /dev/null +++ b/datasophon-init/sql/R1.1.0.sql @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS `migration_history`; +DROP TABLE IF EXISTS `t_ddh_access_token`; +DROP TABLE IF EXISTS `t_ddh_alert_group`; +DROP TABLE IF EXISTS `t_ddh_cluster_alert_expression`; +DROP TABLE IF EXISTS `t_ddh_cluster_alert_group_map`; +DROP TABLE IF EXISTS `t_ddh_cluster_alert_history`; +DROP TABLE IF EXISTS `t_ddh_cluster_alert_quota`; +DROP TABLE IF EXISTS `t_ddh_cluster_alert_rule`; +DROP TABLE IF EXISTS `t_ddh_cluster_group`; +DROP TABLE IF EXISTS `t_ddh_cluster_host`; +DROP TABLE IF EXISTS `t_ddh_cluster_info`; +DROP TABLE IF EXISTS `t_ddh_cluster_node_label`; +DROP TABLE IF EXISTS `t_ddh_cluster_queue_capacity`; +DROP TABLE IF EXISTS `t_ddh_cluster_rack`; +DROP TABLE IF EXISTS `t_ddh_cluster_role_user`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_command`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_command_host`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_command_host_command`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_dashboard`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_instance`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_instance_role_group`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_group_config`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_instance`; +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_instance_webuis`; +DROP TABLE IF EXISTS `t_ddh_cluster_user`; +DROP TABLE IF EXISTS `t_ddh_cluster_user_group`; +DROP TABLE IF EXISTS `t_ddh_cluster_variable`; +DROP TABLE IF EXISTS `t_ddh_cluster_yarn_queue`; +DROP TABLE IF EXISTS `t_ddh_cluster_yarn_scheduler`; +DROP TABLE IF EXISTS `t_ddh_cluster_zk`; +DROP TABLE IF EXISTS `t_ddh_command`; +DROP TABLE IF EXISTS `t_ddh_frame_info`; +DROP TABLE IF EXISTS `t_ddh_frame_service`; +DROP TABLE IF EXISTS `t_ddh_frame_service_role`; +DROP TABLE IF EXISTS `t_ddh_install_step`; +DROP TABLE IF EXISTS `t_ddh_notice_group`; +DROP TABLE IF EXISTS `t_ddh_notice_group_user`; +DROP TABLE IF EXISTS `t_ddh_role_info`; +DROP TABLE IF EXISTS `t_ddh_session`; +DROP TABLE IF EXISTS `t_ddh_user_info`; diff --git a/datasophon-init/sql/V1.1.0__DDL.sql b/datasophon-init/sql/V1.1.0__DDL.sql new file mode 100644 index 00000000..7b2e0a26 --- /dev/null +++ b/datasophon-init/sql/V1.1.0__DDL.sql @@ -0,0 +1,614 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for t_ddh_access_token +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_access_token`; +CREATE TABLE `t_ddh_access_token` ( + `id` int(10) NOT NULL, + `user_id` int(10) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + `expire_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_alert_group +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_alert_group`; +CREATE TABLE `t_ddh_alert_group` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `alert_group_name` varchar(32) DEFAULT NULL COMMENT '告警组名称', + `alert_group_category` varchar(32) DEFAULT NULL COMMENT '告警组类别', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 24 DEFAULT CHARSET=utf8mb4 COMMENT = '告警组表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_alert_expression +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_alert_expression`; +CREATE TABLE `t_ddh_cluster_alert_expression` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增 ID', + `name` varchar(255) DEFAULT NULL COMMENT '指标名称', + `expr` varchar(4096) DEFAULT NULL COMMENT '监控指标表达式', + `service_category` varchar(255) DEFAULT NULL COMMENT '服务类别', + `value_type` varchar(255) DEFAULT NULL COMMENT '阈值类型 BOOL INT FLOAT ', + `is_predefined` varchar(255) DEFAULT NULL COMMENT '是否预定义', + `state` varchar(255) NOT NULL COMMENT '表达式状态', + `is_delete` varchar(255) DEFAULT NULL COMMENT '是否删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 134002 DEFAULT CHARSET=utf8mb4 COMMENT = '表达式常量表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_alert_group_map +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_alert_group_map`; +CREATE TABLE `t_ddh_cluster_alert_group_map` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(10) DEFAULT NULL, + `alert_group_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_alert_history +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_alert_history`; +CREATE TABLE `t_ddh_cluster_alert_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `alert_group_name` varchar(32) DEFAULT NULL COMMENT '告警组', + `alert_target_name` varchar(32) DEFAULT NULL COMMENT '告警指标', + `alert_info` varchar(1024) DEFAULT NULL COMMENT '告警详情', + `alert_advice` varchar(1024) DEFAULT NULL COMMENT '告警建议', + `hostname` varchar(32) DEFAULT NULL COMMENT '主机', + `alert_level` int(11) DEFAULT NULL COMMENT '告警级别 1:警告2:异常', + `is_enabled` int(11) DEFAULT NULL COMMENT '是否处理 1:未处理2:已处理', + `service_role_instance_id` int(11) DEFAULT NULL COMMENT '集群服务角色实例id', + `service_instance_id` int(11) DEFAULT NULL COMMENT '集群服务实例id', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `cluster_id` int(10) DEFAULT NULL COMMENT '集群id', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群告警历史表 ' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_alert_quota +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_alert_quota`; +CREATE TABLE `t_ddh_cluster_alert_quota` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `alert_quota_name` varchar(32) DEFAULT NULL COMMENT '告警指标名称', + `service_category` varchar(32) DEFAULT NULL COMMENT '服务分类', + `alert_expr` varchar(1024) DEFAULT NULL COMMENT '告警指标表达式', + `alert_level` int(11) DEFAULT NULL COMMENT '告警级别 1:警告2:异常', + `alert_group_id` int(11) DEFAULT NULL COMMENT '告警组', + `notice_group_id` int(11) DEFAULT NULL COMMENT '通知组', + `alert_advice` varchar(1024) DEFAULT NULL COMMENT '告警建议', + `compare_method` varchar(32) DEFAULT NULL COMMENT '比较方式 != > <', + `alert_threshold` bigint(200) DEFAULT NULL COMMENT '告警阀值', + `alert_tactic` int(11) DEFAULT NULL COMMENT '告警策略 1:单次2:连续', + `interval_duration` int(11) DEFAULT NULL COMMENT '间隔时长 单位分钟', + `trigger_duration` int(11) DEFAULT NULL COMMENT '触发时长 单位秒', + `service_role_name` varchar(255) DEFAULT NULL COMMENT '服务角色名称', + `quota_state` int(2) DEFAULT NULL COMMENT '1: 启用 2:未启用', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 628 DEFAULT CHARSET=utf8mb4 COMMENT = '集群告警指标表 ' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_alert_rule +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_alert_rule`; +CREATE TABLE `t_ddh_cluster_alert_rule` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增 ID', + `expression_id` bigint(20) NOT NULL COMMENT '表达式 ID', + `is_predefined` varchar(255) DEFAULT NULL COMMENT '是否预定义', + `compare_method` varchar(255) NOT NULL COMMENT '比较方式 如 大于 小于 等于 等', + `threshold_value` varchar(255) NOT NULL COMMENT '阈值', + `persistent_time` bigint(20) NOT NULL COMMENT '持续时长', + `strategy` varchar(255) NOT NULL COMMENT '告警策略:单次,连续', + `repeat_interval` bigint(11) DEFAULT NULL COMMENT '连续告警时 间隔时长', + `alert_level` varchar(255) NOT NULL COMMENT '告警级别', + `alert_desc` varchar(4096) NOT NULL COMMENT '告警描述', + `receiver_group_id` bigint(20) DEFAULT NULL COMMENT '接收组 ID', + `state` varchar(255) NOT NULL COMMENT '状态', + `is_delete` varchar(255) DEFAULT NULL COMMENT '是否删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `cluster_id` int(10) DEFAULT NULL COMMENT '集群id', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 134002 DEFAULT CHARSET=utf8mb4 COMMENT = '规则表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_group +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_group`; +CREATE TABLE `t_ddh_cluster_group` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `group_name` varchar(255) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_host +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_host`; +CREATE TABLE `t_ddh_cluster_host` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `hostname` varchar(32) DEFAULT NULL COMMENT '主机名', + `ip` varchar(32) DEFAULT NULL COMMENT 'IP', + `rack` varchar(32) DEFAULT NULL COMMENT '机架', + `core_num` int(11) DEFAULT NULL COMMENT '核数', + `total_mem` int(11) DEFAULT NULL COMMENT '总内存', + `total_disk` int(11) DEFAULT NULL COMMENT '总磁盘', + `used_mem` int(11) DEFAULT NULL COMMENT '已用内存', + `used_disk` int(11) DEFAULT NULL COMMENT '已用磁盘', + `average_load` varchar(32) DEFAULT NULL COMMENT '平均负载', + `check_time` datetime DEFAULT NULL COMMENT '检测时间', + `cluster_id` varchar(32) DEFAULT NULL COMMENT '集群id', + `host_state` int(2) DEFAULT NULL COMMENT '1:健康 2、有一个角色异常3、有多个角色异常', + `managed` int(2) DEFAULT NULL COMMENT '1:受管 2:断线', + `cpu_architecture` varchar(255) DEFAULT NULL COMMENT 'cpu架构', + `node_label` varchar(255) DEFAULT NULL COMMENT '节点标签', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群主机表 ' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_info +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_info`; +CREATE TABLE `t_ddh_cluster_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `create_by` varchar(128) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `cluster_name` varchar(128) DEFAULT NULL COMMENT '集群名称', + `cluster_code` varchar(128) DEFAULT NULL COMMENT '集群编码', + `cluster_frame` varchar(128) DEFAULT NULL COMMENT '集群框架', + `frame_version` varchar(128) DEFAULT NULL COMMENT '集群版本', + `cluster_state` int(11) DEFAULT NULL COMMENT '集群状态 1:待配置2:正在运行', + `frame_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_node_label +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_node_label`; +CREATE TABLE `t_ddh_cluster_node_label` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(10) DEFAULT NULL, + `node_label` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_queue_capacity +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_queue_capacity`; +CREATE TABLE `t_ddh_cluster_queue_capacity` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(10) DEFAULT NULL, + `queue_name` varchar(255) DEFAULT NULL, + `capacity` varchar(255) DEFAULT NULL, + `node_label` varchar(255) DEFAULT NULL, + `acl_users` varchar(255) DEFAULT NULL, + `parent` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_rack +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_rack`; +CREATE TABLE `t_ddh_cluster_rack` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `rack` varchar(255) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_role_user +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_role_user`; +CREATE TABLE `t_ddh_cluster_role_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `cluster_id` int(11) DEFAULT NULL COMMENT '集群id', + `user_type` int(2) DEFAULT NULL COMMENT '集群用户类型1:管理员2:普通用户', + `user_id` int(11) DEFAULT NULL COMMENT '用户id', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群角色用户中间表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_command +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_command`; +CREATE TABLE `t_ddh_cluster_service_command` ( + `command_id` varchar(128) NOT NULL COMMENT '主键', + `create_by` varchar(32) DEFAULT NULL COMMENT '创建人', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `command_name` varchar(256) DEFAULT NULL COMMENT '命令名称', + `command_state` int(11) DEFAULT NULL COMMENT '命令状态 0:待运行 1:正在运行2:成功3:失败4、取消', + `command_progress` int(11) DEFAULT NULL COMMENT '命令进度', + `cluster_id` int(10) DEFAULT NULL, + `service_name` varchar(128) DEFAULT NULL, + `command_type` int(2) DEFAULT NULL COMMENT '命令类型1:安装服务 2:启动服务 3:停止服务 4:重启服务 5:更新配置后启动 6:更新配置后重启', + `end_time` datetime DEFAULT NULL COMMENT '结束时间', + `service_instance_id` int(10) DEFAULT NULL COMMENT '服务实例id', + UNIQUE INDEX `command_id`(`command_id`) +) DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务操作指令表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_command_host +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_command_host`; +CREATE TABLE `t_ddh_cluster_service_command_host` ( + `command_host_id` varchar(128) NOT NULL DEFAULT '1' COMMENT '主键', + `hostname` varchar(32) DEFAULT NULL COMMENT '主机', + `command_state` int(11) DEFAULT NULL COMMENT '命令状态 1:正在运行2:成功3:失败4、取消', + `command_progress` int(11) DEFAULT NULL COMMENT '命令进度', + `command_id` varchar(128) DEFAULT NULL COMMENT '操作指令id', + `create_time` datetime DEFAULT NULL, + UNIQUE INDEX `command_host_id`(`command_host_id`) , + UNIQUE INDEX `command_host_id_2`(`command_host_id`) +) DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务操作指令主机表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_command_host_command +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_command_host_command`; +CREATE TABLE `t_ddh_cluster_service_command_host_command` ( + `host_command_id` varchar(128) NOT NULL DEFAULT '1' COMMENT '主键', + `command_name` varchar(256) DEFAULT NULL COMMENT '指令名称', + `command_state` int(11) DEFAULT NULL COMMENT '指令状态', + `command_progress` int(11) DEFAULT NULL COMMENT '指令进度', + `command_host_id` varchar(128) DEFAULT NULL COMMENT '主机id', + `hostname` varchar(128) DEFAULT NULL COMMENT '主机', + `service_role_name` varchar(128) DEFAULT NULL COMMENT '服务角色名称', + `service_role_type` int(2) DEFAULT NULL COMMENT '服务角色类型', + `command_id` varchar(128) DEFAULT NULL COMMENT '指令id', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `command_type` int(2) DEFAULT NULL COMMENT '1:安装服务 2:启动服务 3:停止服务 4:重启服务 5:更新配置后启动 6:更新配置后重启', + `result_msg` text NULL, + UNIQUE INDEX `host_command_id`(`host_command_id`) +) DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务操作指令主机指令表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_dashboard +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_dashboard`; +CREATE TABLE `t_ddh_cluster_service_dashboard` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主机', + `service_name` varchar(128) DEFAULT NULL COMMENT '服务名称', + `dashboard_url` varchar(256) DEFAULT NULL COMMENT '总览页面地址', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 22 DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务总览仪表盘' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_instance +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_instance`; +CREATE TABLE `t_ddh_cluster_service_instance` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `cluster_id` int(11) DEFAULT NULL COMMENT '集群id', + `service_name` varchar(32) DEFAULT NULL COMMENT '服务名称', + `service_state` int(11) DEFAULT NULL COMMENT '服务状态 1、待安装 2:正在运行 3:存在告警 4:存在异常', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `need_restart` int(2) DEFAULT NULL COMMENT '是否需要重启 1:正常 2:需要重启', + `frame_service_id` int(10) DEFAULT NULL COMMENT '框架服务id', + `sort_num` int(2) DEFAULT NULL COMMENT '排序字段', + `label` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_instance_role_group +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_instance_role_group`; +CREATE TABLE `t_ddh_cluster_service_instance_role_group` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `role_group_name` varchar(255) DEFAULT NULL, + `service_instance_id` int(11) DEFAULT NULL, + `service_name` varchar(255) DEFAULT NULL, + `cluster_id` int(11) DEFAULT NULL, + `role_group_type` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_role_group_config +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_group_config`; +CREATE TABLE `t_ddh_cluster_service_role_group_config` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `role_group_id` int(10) DEFAULT NULL, + `config_json` text NULL, + `config_json_md5` varchar(255) DEFAULT NULL, + `config_version` int(2) DEFAULT NULL, + `config_file_json` text NULL, + `config_file_json_md5` varchar(255) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + `service_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_role_instance +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_instance`; +CREATE TABLE `t_ddh_cluster_service_role_instance` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `service_role_name` varchar(32) DEFAULT NULL COMMENT '服务角色名称', + `hostname` varchar(32) DEFAULT NULL COMMENT '主机', + `service_role_state` int(2) DEFAULT NULL COMMENT '服务角色状态 1:正在运行2:停止', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `service_id` int(11) DEFAULT NULL COMMENT '服务id', + `role_type` int(11) DEFAULT NULL COMMENT '角色类型 1:master2:worker3:client', + `cluster_id` int(10) DEFAULT NULL COMMENT '集群id', + `service_name` varchar(255) DEFAULT NULL COMMENT '服务名称', + `role_group_id` int(10) DEFAULT NULL COMMENT '角色组id', + `need_restart` int(10) DEFAULT NULL COMMENT '是否需要重启 1:正常 2:需要重启', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务角色实例表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_service_role_instance_webuis +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_service_role_instance_webuis`; +CREATE TABLE `t_ddh_cluster_service_role_instance_webuis` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `service_role_instance_id` int(10) DEFAULT NULL COMMENT '服务角色id', + `web_url` varchar(256) DEFAULT NULL COMMENT 'URL地址', + `service_instance_id` int(10) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群服务角色对应web ui表 ' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_user +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_user`; +CREATE TABLE `t_ddh_cluster_user` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `username` varchar(255) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_user_group +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_user_group`; +CREATE TABLE `t_ddh_cluster_user_group` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `user_id` int(10) DEFAULT NULL, + `group_id` int(10) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + `user_group_type` int(2) DEFAULT NULL COMMENT '1:主用户组 2:附加组', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_variable +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_variable`; +CREATE TABLE `t_ddh_cluster_variable` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(10) DEFAULT NULL, + `variable_name` varchar(255) DEFAULT NULL, + `variable_value` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_cluster_yarn_queue +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_yarn_queue`; +CREATE TABLE `t_ddh_cluster_yarn_queue` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `queue_name` varchar(255) DEFAULT NULL, + `min_core` int(10) DEFAULT NULL, + `min_mem` int(10) DEFAULT NULL, + `max_core` int(10) DEFAULT NULL, + `max_mem` int(10) DEFAULT NULL, + `app_num` int(10) DEFAULT NULL, + `weight` int(2) DEFAULT NULL, + `schedule_policy` varchar(255) DEFAULT NULL COMMENT 'fifo ,fair ,drf', + `allow_preemption` int(2) DEFAULT NULL COMMENT '1: true 2:false', + `cluster_id` int(10) DEFAULT NULL, + `am_share` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_yarn_scheduler +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_yarn_scheduler`; +CREATE TABLE `t_ddh_cluster_yarn_scheduler` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `cluster_id` int(11) DEFAULT NULL, + `scheduler` varchar(255) DEFAULT NULL, + `in_use` int(2) DEFAULT NULL COMMENT '1: 是 2:否', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_cluster_zk +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_cluster_zk`; +CREATE TABLE `t_ddh_cluster_zk` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `zk_server` varchar(255) DEFAULT NULL, + `myid` int(10) DEFAULT NULL, + `cluster_id` int(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_command +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_command`; +CREATE TABLE `t_ddh_command` ( + `id` int(10) NOT NULL, + `command_type` int(2) DEFAULT NULL, + PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_frame_info +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_frame_info`; +CREATE TABLE `t_ddh_frame_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `frame_name` varchar(128) DEFAULT NULL COMMENT '框架名称', + `frame_code` varchar(128) DEFAULT NULL COMMENT '框架编码', + `frame_version` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群框架表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_frame_service +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_frame_service`; +CREATE TABLE `t_ddh_frame_service` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `frame_id` int(11) DEFAULT NULL COMMENT '版本id', + `service_name` varchar(32) DEFAULT NULL COMMENT '服务名称', + `label` varchar(255) DEFAULT NULL, + `service_version` varchar(32) DEFAULT NULL COMMENT '服务版本', + `service_desc` varchar(1024) DEFAULT NULL COMMENT '服务描述', + `dependencies` varchar(255) DEFAULT NULL COMMENT '服务依赖', + `package_name` varchar(255) DEFAULT NULL COMMENT '安装包名称', + `service_config` text NULL, + `service_json` text NULL, + `service_json_md5` varchar(255) DEFAULT NULL, + `frame_code` varchar(255) DEFAULT NULL, + `config_file_json` text NULL, + `config_file_json_md5` varchar(255) DEFAULT NULL, + `decompress_package_name` varchar(255) DEFAULT NULL, + `sort_num` int(2) DEFAULT NULL COMMENT '排序字段', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '集群框架版本服务表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_frame_service_role +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_frame_service_role`; +CREATE TABLE `t_ddh_frame_service_role` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `service_id` int(11) DEFAULT NULL COMMENT '服务id', + `service_role_name` varchar(32) DEFAULT NULL COMMENT '角色名称', + `service_role_type` int(11) DEFAULT NULL COMMENT '角色类型 1:master2:worker3:client', + `cardinality` varchar(32) DEFAULT NULL, + `service_role_json` text NULL, + `service_role_json_md5` varchar(255) DEFAULT NULL, + `frame_code` varchar(255) DEFAULT NULL, + `jmx_port` varchar(255) DEFAULT NULL, + `log_file` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '框架服务角色表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_install_step +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_install_step`; +CREATE TABLE `t_ddh_install_step` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `step_name` varchar(128) DEFAULT NULL, + `step_desc` varchar(256) DEFAULT NULL, + `install_type` int(1) DEFAULT NULL COMMENT '1:集群配置2:添加服务3:添加主机', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 10 DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_notice_group +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_notice_group`; +CREATE TABLE `t_ddh_notice_group` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `notice_group_name` varchar(32) DEFAULT NULL COMMENT '通知组名称', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '通知组表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_notice_group_user +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_notice_group_user`; +CREATE TABLE `t_ddh_notice_group_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `notice_group_id` int(11) DEFAULT NULL COMMENT '通知组id', + `user_id` int(11) DEFAULT NULL COMMENT '用户id', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '通知组-用户中间表' ROW_FORMAT = DYNAMIC; + + +-- ---------------------------- +-- Table structure for t_ddh_role_info +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_role_info`; +CREATE TABLE `t_ddh_role_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `role_name` varchar(128) DEFAULT NULL COMMENT '角色名称', + `role_code` varchar(128) DEFAULT NULL COMMENT '角色编码', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8mb4 COMMENT = '角色信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for t_ddh_session +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_session`; +CREATE TABLE `t_ddh_session` ( + `id` varchar(128) NOT NULL, + `user_id` int(10) DEFAULT NULL, + `ip` varchar(128) DEFAULT NULL, + `last_login_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8mb4 ROW_FORMAT = DYNAMIC; + + + +-- ---------------------------- +-- Table structure for t_ddh_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `t_ddh_user_info`; +CREATE TABLE `t_ddh_user_info` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `username` varchar(128) DEFAULT NULL COMMENT '用户名', + `password` varchar(128) DEFAULT NULL COMMENT '密码', + `email` varchar(128) DEFAULT NULL COMMENT '邮箱', + `phone` varchar(128) DEFAULT NULL COMMENT '手机号', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `user_type` int(2) DEFAULT NULL COMMENT '1:超级管理员 2:普通用户', + PRIMARY KEY (`id`) +) AUTO_INCREMENT = 2 DEFAULT CHARSET=utf8mb4 COMMENT = '用户信息表' ROW_FORMAT = DYNAMIC; + + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/datasophon-init/sql/V1.1.0__DML.sql b/datasophon-init/sql/V1.1.0__DML.sql new file mode 100644 index 00000000..3d6be3e0 --- /dev/null +++ b/datasophon-init/sql/V1.1.0__DML.sql @@ -0,0 +1,418 @@ +-- ---------------------------- +-- Records of t_ddh_access_token +-- ---------------------------- +INSERT INTO `t_ddh_access_token` VALUES (0, 1, 'test', '2022-06-15 09:51:54', '2022-06-15 09:51:57', '2023-01-01 09:51:59'); + +-- ---------------------------- +-- Records of t_ddh_alert_group +-- ---------------------------- +INSERT INTO `t_ddh_alert_group` VALUES (1, 'HIVE告警组', 'HIVE', '2022-07-14 15:52:45'); +INSERT INTO `t_ddh_alert_group` VALUES (2, 'HDFS告警组', 'HDFS', '2022-07-14 15:52:47'); +INSERT INTO `t_ddh_alert_group` VALUES (3, 'YARN告警组', 'YARN', '2022-07-14 15:52:50'); +INSERT INTO `t_ddh_alert_group` VALUES (8, 'HBASE告警组', 'HBASE', '2022-07-14 15:52:52'); +INSERT INTO `t_ddh_alert_group` VALUES (10, 'KAFKA告警组', 'KAFKA', '2022-07-14 15:52:57'); +INSERT INTO `t_ddh_alert_group` VALUES (11, '主机告警组', 'NODE', '2022-07-14 15:52:59'); +INSERT INTO `t_ddh_alert_group` VALUES (12, 'ZOOKEEPER告警组', 'ZOOKEEPER', '2022-07-14 15:53:02'); +INSERT INTO `t_ddh_alert_group` VALUES (13, 'ALERTMANAGER告警组', 'ALERTMANAGER', '2022-07-14 15:53:05'); +INSERT INTO `t_ddh_alert_group` VALUES (14, 'GRAFANA告警组', 'GRAFANA', '2022-07-14 15:53:07'); +INSERT INTO `t_ddh_alert_group` VALUES (15, 'PROMETHEUS告警组', 'PROMETHEUS', '2022-07-14 15:53:09'); +INSERT INTO `t_ddh_alert_group` VALUES (16, 'SPARK告警组', 'SPARK3', '2022-07-15 14:12:38'); +INSERT INTO `t_ddh_alert_group` VALUES (17, 'TRINO告警组', 'TRINO', '2022-07-24 23:23:01'); +INSERT INTO `t_ddh_alert_group` VALUES (18, 'RANGER告警组', 'RANGER', '2022-09-09 11:29:14'); +INSERT INTO `t_ddh_alert_group` VALUES (19, 'STARROCKS告警组', 'STARROCKS', '2022-09-13 14:53:57'); +INSERT INTO `t_ddh_alert_group` VALUES (20, 'ELASTICSEARCH告警组', 'ELASTICSEARCH', '2022-10-08 16:15:55'); +INSERT INTO `t_ddh_alert_group` VALUES (21, 'DS告警组', 'DS', '2022-11-20 21:00:00'); +INSERT INTO `t_ddh_alert_group` VALUES (22, 'SP告警组', 'STREAMPARK', '2022-11-21 18:20:10'); +INSERT INTO `t_ddh_alert_group` VALUES (23, 'Doris告警组', 'DORIS', '2023-01-07 22:12:36'); + + + +-- ---------------------------- +-- Records of t_ddh_cluster_alert_expression +-- ---------------------------- +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101001, '主机内存使用率(%)', '(1-(node_memory_MemAvailable_bytes/(node_memory_MemTotal_bytes)))*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101002, '主机CPU使用率(%)', '(1-avg(irate(node_cpu_seconds_total{mode=\"idle\"}[5m]))by(instance))*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101003, '主机CPU系统使用率(%)', 'avg(irate(node_cpu_seconds_total{mode=\"system\"}[5m]))by(instance)*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101004, '主机CPU用户使用率(%)', 'avg(irate(node_cpu_seconds_total{mode=\"user\"}[5m]))by(instance)*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101005, '主机磁盘IO使用率(%)', 'avg(irate(node_cpu_seconds_total{mode=\"iowait\"}[5m]))by(instance)*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101006, '主机交换分区使用率(%)', '(1-((node_memory_SwapFree_bytes+1)/(node_memory_SwapTotal_bytes+1)))*100', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101007, '主机磁盘使用率(%)', '(node_filesystem_size_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}-node_filesystem_free_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"})*100/(node_filesystem_avail_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}+(node_filesystem_size_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}-node_filesystem_free_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}))', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101008, '主机入网带宽', 'irate(node_network_receive_bytes_total[5m])*8', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101009, '主机出网带宽', 'irate(node_network_transmit_bytes_total[5m])*8', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101010, '系统平均负载[1m]', 'node_load1', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101011, '系统平均负载[5m]', 'node_load5', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101012, '系统平均负载[15m]', 'node_load15', 'NODE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101013, 'Ntp服务存活', 'cluster_basic_isNtpServiceAlive', 'NODE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (101014, 'Ntp时间同步', 'cluster_basic_isNtpClockSyncNormal', 'NODE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (102001, 'AlertManager进程存活', 'alertmanager_isAlertmanagerProcessAlive', 'ALERTMANAGER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (103001, 'Elasticsearch进程存活', 'Elastic_isEsProcessAlive', 'ELASTICSEARCH', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (103002, 'ElasticsearchCPU使用率(%)', 'es_os_cpu_percent{job=\"ELASTICSEARCH-ElasticSearch\"}', 'ELASTICSEARCH', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (103003, 'Elasticsearch内存使用率(%)', 'es_os_mem_used_percent', 'ELASTICSEARCH', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (103004, 'Elasticsearch磁盘使用率(%)', '100-es_fs_path_available_bytes*100/es_fs_path_total_bytes', 'ELASTICSEARCH', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (104001, 'FlinkHistoryServer进程存活', 'up{job=\"FLINK-FlinkHistoryServer\"}', 'FLINK', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (105001, 'Grafana进程存活', 'grafana_isGrafanaProcessAlive', 'GRAFANA', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (106001, 'HBaseMaster进程存活', 'hbase_isHMasterProcessAlive', 'HBASE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (106002, 'HRegionServer进程存活', 'hbase_isHRegionServerProcessAlive', 'HBASE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (106003, 'HThriftServer进程存活', 'hbase_isHThriftServerProcessAlive', 'HBASE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107001, 'NameNode进程存活', 'hdfs_isNameNodeProcessAlive', 'HDFS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107002, 'NameNodeRPC延迟[5m]', 'avg_over_time(Hadoop_NameNode_RpcProcessingTimeAvgTime{job=\"HDFS-NameNode\"}[5m])', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107003, 'NameNodeRPC延迟[15m]', 'avg_over_time(Hadoop_NameNode_RpcProcessingTimeAvgTime{job=\"HDFS-NameNode\"}[15m])', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107004, 'NameNode堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"HDFS-NameNode\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"HDFS-NameNode\"}', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107005, 'NameNode老年代GC持续时间[5m]', 'avg_over_time(Hadoop_NameNode_GcTimeMillisConcurrentMarkSweep{job=\"HDFS-NameNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107006, 'NameNode新生代GC持续时间[5m]', 'avg_over_time(Hadoop_NameNode_GcTimeMillisParNew{job=\"HDFS-NameNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107007, 'NameNodeGC持续时间[5m]', 'avg_over_time(Hadoop_NameNode_GcTimeMillis{job=\"HDFS-NameNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107008, 'DataNode进程存活', 'hdfs_isDataNodeProcessAlive', 'HDFS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107009, 'DataNodeRPC[5m]', 'avg_over_time(Hadoop_DataNode_RpcProcessingTimeAvgTime{job=\"HDFS-DataNode\"}[5m])', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107010, 'DataNodeRPC[15m]', 'avg_over_time(Hadoop_DataNode_RpcProcessingTimeAvgTime{job=\"HDFS-DataNode\"}[15m])', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107011, 'DataNode堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"HDFS-DataNode\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"HDFS-DataNode\"}', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107012, 'DataNode老年代GC持续时间[5m]', 'avg_over_time(Hadoop_DataNode_GcTimeMillisConcurrentMarkSweep{job=\"HDFS-DataNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107013, 'DataNode新生代GC持续时间[5m]', 'avg_over_time(Hadoop_DataNode_GcTimeMillisParNew{job=\"HDFS-DataNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107014, 'DataNodeGC持续时间[5m]', 'avg_over_time(Hadoop_DataNode_GcTimeMillis{job=\"HDFS-DataNode\"}[5m])/(5*60*1000)', 'HDFS', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107015, 'JournalNode进程存活', 'hdfs_isJournalNodeProcessAlive', 'HDFS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107016, 'ZKFailoverController进程存活', 'hdfs_isDFSZKFCProcessAlive', 'HDFS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107017, 'HttpFs进程存活', 'supplement_isHttpFsServerProcessNormal', 'HDFS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107018, 'HDFS坏盘', 'Hadoop_NameNode_VolumeFailuresTotal{name=\"FSNamesystem\"}', 'HDFS', 'INT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (107019, 'HDFS块丢失', 'Hadoop_NameNode_MissingBlocks{name=\"FSNamesystem\"}', 'HDFS', 'INT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108001, 'HiveServer2进程存活', 'hive_isHiveServer2ProcessAlive', 'HIVE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108002, 'HiveServer2堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"HIVE-HiveServer2\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"HIVE-HiveServer2\"}', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108003, 'HiveServer2老年代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"HIVE-HiveServer2\",name=\"PS MarkSweep\"}[5m])/(5*60*1000)', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108004, 'HiveServer2新生代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"HIVE-HiveServer2\",name=\"PS Scavenge\"}[5m])/(5*60*1000)', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108005, 'HiveMetastore进程存活', 'hive_isHiveMetaStoreProcessAlive', 'HIVE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108006, 'HiveMetastore堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"HIVE-MetaStore\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"HIVE-MetaStore\"}', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108007, 'HiveMetastore老年代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"HIVE-MetaStore\",name=\"PS MarkSweep\"}[5m])/(5*60*1000)', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108008, 'HiveMetastore新生代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"HIVE-MetaStore\",name=\"PS Scavenge\"}[5m])/(5*60*1000)', 'HIVE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (108009, 'MySQL进程存活', 'hive_isMysqlProcessAlive', 'HIVE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (109001, 'HueServer进程存活', 'hue_isHueProcessAlive', 'HUE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (110001, 'InfluxDB进程存活', 'supplement_isInfluxDBProcessAlive', 'INFLUXDB', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (111001, 'KafkaEagle进程存活', 'KafkaEagle_isKafkaEagleProcessAlive', 'KAFKAEAGLE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (112001, 'Kibana进程存活', 'kibana_isKibanaProcessAlive', 'KIBANA', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (113001, 'KylinServer进程存活', 'up{job=\"KYLIN-KylinServer\"}', 'KYLIN', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (113002, 'KylinServer堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"KYLIN-KylinServer\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"KYLIN-KylinServer\"}', 'KYLIN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (113003, 'KylinServer老年代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"KYLIN-KylinServer\",name=\"ConcurrentMarkSweep\"}[5m])/(5*60*1000)', 'KYLIN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (113004, 'KylinServer新生代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"KYLIN-KylinServer\",name=\"ParNew\"}[5m])/(5*60*1000)', 'KYLIN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (114001, 'LivyServer进程存活', 'up{job=\"LIVY-LivyServer\"}', 'LIVY', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (114002, 'LivyServer堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"LIVY-LivyServer\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"LIVY-LivyServer\"}', 'LIVY', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (114003, 'LivyServer老年代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"LIVY-LivyServer\",name=\"PS MarkSweep\"}[5m])/(5*60*1000)', 'LIVY', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (114004, 'LivyServer新生代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"LIVY-LivyServer\",name=\"PS Scavenge\"}[5m])/(5*60*1000)', 'LIVY', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (115001, 'NodeExporter进程存活', 'up{job=\"NODEEXPORTER-NodeExporter\"}', 'NODEEXPORTER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (116001, 'OozieServer进程存活', 'up{job=\"OOZIE-OozieServer\"}', 'OOZIE', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (116002, 'OozieServer堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"OOZIE-OozieServer\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"OOZIE-OozieServer\"}', 'OOZIE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (116003, 'OozieServer老年代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"OOZIE-OozieServer\",name=\"PS MarkSweep\"}[5m])/(5*60*1000)', 'OOZIE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (116004, 'OozieServer新生代GC持续时间[5m]', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"OOZIE-OozieServer\",name=\"PS Scavenge\"}[5m])/(5*60*1000)', 'OOZIE', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (117001, 'Prometheus进程存活', 'up{job=\"prometheus\"}', 'PROMETHEUS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (118001, 'RangerServer进程存活', 'up{job=\"RANGER-RangerAdmin\"}', 'RANGER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (119001, 'SparkHistoryServer进程存活', 'spark_isHistoryServerProcessAlive', 'SPARK', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (120001, 'TezUI进程存活', 'hive_isTezUIProcessAlive', 'TEZ', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (121001, 'MonitorAgent进程存活', 'up{job=\"USDPMONITOR-MonitorAgent\"}', 'USDPMONITOR', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (122001, 'ZkUI进程存活', 'zk_isZKUIProcessAlive', 'ZKUI', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (123001, 'QuarumPeermain进程存活', 'zk_isZKProcessAlive', 'ZOOKEEPER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124001, 'ResourceManager进程存活', 'yarn_isResourceManagerProcessAlive', 'YARN', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124002, 'ResourceManager堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"YARN-ResourceManager\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"YARN-ResourceManager\"}', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124003, 'ResourceManager老年代GC持续时间[5m]', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillisPS_MarkSweep{job=\"YARN-ResourceManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124004, 'ResourceManager新生代GC持续时间[5m]', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillisPS_Scavenge{job=\"YARN-ResourceManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124005, 'ResourceManagerGC持续时间[5m]', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillis{job=\"YARN-ResourceManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124006, 'NodeManager进程存活', 'yarn_isNodeManagerProcessAlive', 'YARN', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124007, 'NodeManager堆内存使用率(%)', 'java_lang_Memory_HeapMemoryUsage_used{job=\"YARN-NodeManager\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"YARN-NodeManager\"}', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124008, 'NodeManager老年代GC持续时间[5m]', 'avg_over_time(Hadoop_NodeManager_GcTimeMillisPS_MarkSweep{job=\"YARN-NodeManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124009, 'NodeManager新生代GC持续时间[5m]', 'avg_over_time(Hadoop_NodeManager_GcTimeMillisPS_Scavenge{job=\"YARN-NodeManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (124010, 'NodeManagerGC持续时间[5m]', 'avg_over_time(Hadoop_NodeManager_GcTimeMillis{job=\"YARN-NodeManager\"}[5m])/(5*60*1000)', 'YARN', 'FLOAT', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (125001, 'PrestoCoordinator进程存活', 'presto_isCoordinatorProcessAlive', 'PRESTO', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (125002, 'PrestoWorker进程存活', 'presto_isWorkerProcessAlive', 'PRESTO', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (126001, 'UdsMaster进程存活', 'uds_isMasterProcessAlive', 'UDS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (126002, 'UdsWorker进程存活', 'uds_isWorkerProcessAlive', 'UDS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (126003, 'UdsWeb进程存活', 'uds_isWebProcessAlive', 'UDS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (127001, 'KuduMaster进程存活', 'kudu_isMasterProcessAlive', 'KUDU', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (127002, 'KuduTserver进程存活', 'kudu_isTServerProcessAlive', 'KUDU', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (128001, 'ImpalaImpalad进程存活', 'impala_isImpaladProcessAlive', 'IMPALA', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (128002, 'ImpalaCatalog进程存活', 'impala_isCatalogdProcessAlive', 'IMPALA', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (128003, 'ImpalaStatestored进程存活', 'impala_isStatestoredProcessAlive', 'IMPALA', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (129001, 'ZeppelinServer进程存活', 'supplement_isZeppelinServerProcessNormal', 'ZEPPELIN', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (130001, 'AirflowWebserver进程存活', 'supplement_isAirflowWebserverProcessAlive', 'AIRFLOW', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (130002, 'AirflowScheduler进程存活', 'supplement_isAirflowSchedulerProcessAlive', 'AIRFLOW', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (131001, 'AtlasIndexServer进程存活', 'supplement_isAtlasIndexServerProcessAlive', 'ATLAS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (131002, 'AtlasServer进程存活', 'supplement_isAtlasServerProcessAlive', 'ATLAS', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (132001, 'AlertServer进程存活', 'DolphinScheduler_isAlertProcessAlive', 'DOLPHINSCHEDULER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (132002, 'ApiServer进程存活', 'DolphinScheduler_isAPIProcessAlive', 'DOLPHINSCHEDULER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (132003, 'LoggerServer进程存活', 'DolphinScheduler_isLoggerProcessAlive', 'DOLPHINSCHEDULER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (132004, 'MasterServer进程存活', 'DolphinScheduler_isMasterProcessAlive', 'DOLPHINSCHEDULER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (132005, 'WorkerServer进程存活', 'DolphinScheduler_isWorkerProcessAlive', 'DOLPHINSCHEDULER', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (133001, 'TrinoCoordinator进程存活', 'trino_isCoordinatorProcessAlive', 'TRINO', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (133002, 'TrinoWorker进程存活', 'trino_isWorkerProcessAlive', 'TRINO', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_expression` VALUES (134001, 'Neo4j进程存活', 'supplement_isNeo4jServerProcessAlive', 'NEO4J', 'BOOL', 'TRUE', 'VALID', 'FALSE', NULL, NULL); + + +-- ---------------------------- +-- Records of t_ddh_cluster_alert_quota +-- ---------------------------- +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (464, '主机内存使用率', 'NODE', '(1-(node_memory_MemAvailable_bytes/(node_memory_MemTotal_bytes)))*100', 1, 11, 1, '内存使用率过高,可迁出部分进程', '>', 95, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (465, '主机CPU使用率', 'NODE', '(1-avg(irate(node_cpu_seconds_total{mode=\"idle\"}[5m]))by(instance))*100', 1, 11, 1, 'cpu使用率过高,注意观察cpu密集型进程,必要时需停止或迁移该进程', '>', 90, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (466, '主机CPU系统使用率', 'NODE', 'avg(irate(node_cpu_seconds_total{mode=\"system\"}[5m]))by(instance)*100', 1, 11, 1, 'cpu使用过高,评估是否有任务倾斜', '>', 95, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (467, '主机CPU用户使用率', 'NODE', 'avg(irate(node_cpu_seconds_total{mode=\"user\"}[5m]))by(instance)*100', 2, 11, 1, 'cpu使用过高,评估是否有任务倾斜', '>', 95, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (468, '主机磁盘IO使用率', 'NODE', 'avg(irate(node_cpu_seconds_total{mode=\"iowait\"}[5m]))by(instance)*100', 1, 11, 1, '磁盘IO过高,评估任务执行是否过于密集', '>', 95, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (469, '主机交换分区使用率', 'NODE', '(1-((node_memory_SwapFree_bytes+1)/(node_memory_SwapTotal_bytes+1)))*100', 1, 11, 1, '主机交换分区使用率过高,评估是否存在任务密集执行', '>', 95, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (470, '主机磁盘使用率', 'NODE', '(node_filesystem_size_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}-node_filesystem_free_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"})*100/(node_filesystem_avail_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}+(node_filesystem_size_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}-node_filesystem_free_bytes{fstype=~\"ext.*|xfs\",mountpoint!~\".*pod.*\"}))', 1, 11, 1, '请清理磁盘', '>', 85, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (471, '主机入网带宽', 'NODE', 'irate(node_network_receive_bytes_total[5m])*8', 1, 11, 1, '网络流量过高', '>', 8589934592, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (472, '主机出网带宽', 'NODE', 'irate(node_network_transmit_bytes_total[5m])*8', 1, 11, 1, '网络流量过高', '>', 8589934592, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (473, '系统平均负载[1m]', 'NODE', 'node_load1', 1, 11, 1, '系统负载过高', '>', 100, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (474, '系统平均负载[5m]', 'NODE', 'node_load5', 1, 11, 1, '系统负载过高', '>', 100, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (475, '系统平均负载[15m]', 'NODE', 'node_load15', 1, 11, 1, '系统负载过高', '>', 100, 1, 1, 60, 'node', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (479, 'NameNode进程存活', 'HDFS', 'up{job=\"namenode\"}', 2, 2, 2, '查看日志,分析宕机原因,解决问题后重新启动', '!=', 1, 1, 1, 15, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (482, 'NameNode堆内存使用率', 'HDFS', '(Hadoop_NameNode_MemHeapUsedM/Hadoop_NameNode_MemHeapMaxM )*100', 1, 2, 2, 'NameNode堆内存不足,增大NameNode堆内存', '>', 95, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (483, 'NameNode老年代GC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_NameNode_GcTimeMillisPS_MarkSweep{job=\"namenode\"}[5m])/1000', 1, 2, 2, '老年代GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (484, 'NameNode新生代GC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_NameNode_GcTimeMillisPS_Scavenge{job=\"namenode\"}[5m])/1000', 1, 2, 2, '新生代GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (485, 'NameNodeGC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_NameNode_GcTimeMillis{job=\"namenode\"}[5m])/1000', 1, 2, 2, 'GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (486, 'DataNode进程存活', 'HDFS', 'up{job=\"datanode\"}', 2, 2, 2, '查看日志,分析宕机原因,解决问题后重新启动', '!=', 1, 1, 1, 15, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (487, 'DataNodeRPC[5m]', 'HDFS', 'avg_over_time(Hadoop_DataNode_RpcProcessingTimeAvgTime{job=\"datanode\"}[5m])', 1, 2, 2, '请检查网络流量使用情况', '>', 5, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (488, 'DataNodeRPC[15m]', 'HDFS', 'avg_over_time(Hadoop_DataNode_RpcProcessingTimeAvgTime{job=\"datanode\"}[15m])', 1, 2, 2, '请检查网络流量使用情况', '>', 5, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (489, 'DataNode堆内存使用率', 'HDFS', '(Hadoop_DataNode_MemHeapUsedM/Hadoop_DataNode_MemHeapMaxM )*100', 1, 2, 2, 'NameNode堆内存不足,增大NameNode堆内存', '>', 95, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (490, 'DataNode老年代GC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_DataNode_GcTimeMillisPS_MarkSweep{job=\"datanode\"}[5m])/(1000)', 1, 2, 2, '老年代GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (491, 'DataNode新生代GC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_DataNode_GcTimeMillisPS_Scavenge{job=\"datanode\"}[5m])/(1000)', 1, 2, 2, '新生代GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (492, 'DataNodeGC持续时间[5m]', 'HDFS', 'avg_over_time(Hadoop_DataNode_GcTimeMillis{job=\"datanode\"}[5m])/(1000)', 1, 2, 2, 'GC时间过长,可考虑加大堆内存', '>', 60, 1, 1, 60, 'DataNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (493, 'JournalNode进程存活', 'HDFS', 'up{job=\"journalnode\"}', 2, 2, 2, 'JournalNode宕机,请重新启动', '!=', 1, 1, 1, 15, 'JournalNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (494, 'ZKFailoverController进程存活', 'HDFS', 'up{job=\"zkfc\"}', 2, 2, 2, 'ZKFC宕机,请重新启动', '!=', 1, 1, 1, 15, 'ZKFC', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (496, 'HDFS坏盘', 'HDFS', 'Hadoop_NameNode_VolumeFailuresTotal{name=\"FSNamesystem\"}', 1, 2, 2, '存在坏盘', '>', 0, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (497, 'HDFS块丢失', 'HDFS', 'Hadoop_NameNode_MissingBlocks{name=\"FSNamesystem\"}', 1, 2, 2, '存在块丢失', '>', 0, 1, 1, 60, 'NameNode', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (518, 'Grafana进程存活', 'GRAFANA', 'up{job=\"grafana\"}', 2, 14, 1, 'Grafana宕机,请重新启动', '!=', 1, 1, 1, 15, 'Grafana', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (519, 'HBaseMaster进程存活', 'HBASE', 'up{job=\"hbasemaster\"}', 2, 8, 1, 'Hbase Master宕机,请重新启动', '!=', 1, 1, 1, 15, 'HbaseMaster', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (520, 'HRegionServer进程存活', 'HBASE', 'up{job=\"regionserver\"}', 2, 8, 1, 'RegionServer宕机,请重新启动', '!=', 1, 1, 1, 15, 'RegionServer', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (541, 'HiveServer2进程存活', 'HIVE', 'up{job=\"hiveserver2\"}', 2, 1, 1, 'HiveServer2宕机,请重新启动', '!=', 1, 1, 1, 15, 'HiveServer2', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (542, 'HiveServer2堆内存使用率', 'HIVE', 'java_lang_Memory_HeapMemoryUsage_used{job=\"hiveserver2\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"hiveserver2\"}', 1, 1, 1, 'HiveServer2堆内存不足,增大NameNode堆内存', '>', 95, 1, 1, 60, 'HiveServer2', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (543, 'HiveServer2老年代GC持续时间[5m]', 'HIVE', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"hiveserver2\",name=\"PS MarkSweep\"}[5m])/(1000)', 1, 1, 1, '请联系管理员', '>', 60, 1, 1, 60, 'HiveServer2', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (544, 'HiveServer2新生代GC持续时间[5m]', 'HIVE', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"hiveserver2\",name=\"PS Scavenge\"}[5m])/(1000)', 1, 1, 1, '请联系管理员', '>', 60, 1, 1, 60, 'HiveServer2', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (545, 'HiveMetastore进程存活', 'HIVE', 'up{job=\"hivemetastore\"}', 2, 1, 1, 'HiveMetastore宕机,请重新启动', '!=', 1, 1, 1, 15, 'HiveMetaStore', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (546, 'HiveMetastore堆内存使用率', 'HIVE', 'java_lang_Memory_HeapMemoryUsage_used{job=\"hivemetastore\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"hivemetastore\"}', 1, 1, 1, '请联系管理员', '>', 95, 1, 1, 60, 'HiveMetaStore', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (547, 'HiveMetastore老年代GC持续时间[5m]', 'HIVE', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"hivemetastore\",name=\"PS MarkSweep\"}[5m])/(1000)', 1, 1, 1, '请联系管理员', '>', 60, 1, 1, 60, 'HiveMetaStore', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (548, 'HiveMetastore新生代GC持续时间[5m]', 'HIVE', 'avg_over_time(java_lang_GarbageCollector_CollectionTime{job=\"hivemetastore\",name=\"PS Scavenge\"}[5m])/(1000)', 1, 1, 1, '请联系管理员', '>', 60, 1, 1, 60, 'HiveMetaStore', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (568, 'RangerServer进程存活', 'RANGER', 'up{job=\"rangeradmin\"}', 2, 18, 1, '请联系管理员', '!=', 1, 1, 1, 15, 'RangerAdmin', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (569, 'SparkHistoryServer进程存活', 'SPARK', 'up{job=\"sparkhistoryserver\"}', 2, 16, 1, '请联系管理员', '!=', 1, 1, 1, 15, 'SparkHistoryServer', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (573, 'ZK进程存活', 'ZOOKEEPER', 'up{job=\"zkserver\"}', 2, 12, 1, 'zk宕机,请重新启动', '!=', 1, 1, 1, 15, 'ZkServer', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (574, 'ResourceManager进程存活', 'YARN', 'up{job=\"resourcemanager\"}', 2, 3, 1, 'ResourceManager宕机,请重新启动', '!=', 1, 1, 1, 15, 'ResourceManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (575, 'ResourceManager堆内存使用率', 'YARN', 'java_lang_Memory_HeapMemoryUsage_used{job=\"resourcemanager\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"resourcemanager\"}', 1, 3, 1, '请联系管理员', '>', 95, 1, 1, 60, 'ResourceManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (576, 'ResourceManager老年代GC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillisPS_MarkSweep{job=\"resourcemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'ResourceManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (577, 'ResourceManager新生代GC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillisPS_Scavenge{job=\"resourcemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'ResourceManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (578, 'ResourceManagerGC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_ResourceManager_GcTimeMillis{job=\"resourcemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'ResourceManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (579, 'NodeManager进程存活', 'YARN', 'up{job=\"nodemanager\"}', 2, 3, 1, 'NodeManager宕机,请重新启动', '!=', 1, 1, 1, 15, 'NodeManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (580, 'NodeManager堆内存使用率', 'YARN', 'java_lang_Memory_HeapMemoryUsage_used{job=\"nodemanager\"}*100/java_lang_Memory_HeapMemoryUsage_max{job=\"nodemanager\"}', 1, 3, 1, '请联系管理员', '>', 95, 1, 1, 60, 'NodeManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (581, 'NodeManager老年代GC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_NodeManager_GcTimeMillisPS_MarkSweep{job=\"nodemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'NodeManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (582, 'NodeManager新生代GC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_NodeManager_GcTimeMillisPS_Scavenge{job=\"nodemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'NodeManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (583, 'NodeManagerGC持续时间[5m]', 'YARN', 'avg_over_time(Hadoop_NodeManager_GcTimeMillis{job=\"nodemanager\"}[5m])/(1000)', 1, 3, 1, '请联系管理员', '>', 60, 1, 1, 60, 'NodeManager', 1, '2022-07-14 14:22:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (611, 'KafkaBorker进程存活', 'KAFKA', 'up{job=\"kafkabroker\"}', 2, 10, 1, 'KafkaBroker宕机,请重新启动', '!=', 1, 1, 1, 15, 'KafkaBroker', 1, '2022-07-15 14:32:25'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (612, 'TrinoCoordinator进程存活', 'TRINO', 'up{job=\"trinocoordinator\"}', 2, 17, 1, '重新启动', '!=', 1, 1, 1, 15, 'TrinoCoordinator', 1, NULL); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (613, 'TrinoWorker进程存活', 'TRINO', 'up{job=\"trinoworker\"}', 2, 17, 1, '重新启动', '!=', 1, 1, 1, 15, 'TrinoWorker', 1, NULL); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (614, '主机采集器Node状态', 'NODE', 'up{job=\"node\"}', 1, 11, 1, '重新启动该Node服务', '!=', 1, 1, 1, 0, 'node', 1, NULL); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (615, 'FE进程存活', 'STARROCKS', 'up{group=\'fe\',job=\"StarRocks\"}', 2, 19, 1, '重新启动', '!=', 1, 1, 1, 15, 'SRFE', 1, '2022-09-13 14:54:39'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (616, 'BE进程存活', 'STARROCKS', 'up{group=\'be\',job=\"StarRocks\"}', 2, 19, 1, '重新启动', '!=', 1, 1, 1, 15, 'SRBE', 1, '2022-09-13 14:55:16'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (617, 'SparkMaster进程存活', 'SPARK3', 'up{job=\"sparkmaster\"}', 2, 16, 1, '重新启动', '!=', 1, 1, 1, 15, 'SparkMaster', 1, '2022-09-16 10:24:38'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (618, 'SparkWorker进程存活', 'SPARK3', 'up{job=\"sparkworker\"}', 2, 16, 1, '重新启动', '!=', 1, 1, 1, 15, 'SparkWorker', 1, '2022-09-16 10:25:18'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (619, 'ElasticSearch进程存活', 'ELASTICSEARCH', 'com_datasophon_ddh_worker_metrics_esMetrics_EsUp', 2, 20, 1, '重新启动', '!=', 1, 1, 1, 15, 'ElasticSearch', 1, '2022-10-08 16:17:00'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (620, 'DS API存活', 'DS', 'up{job=\'apiserver\'}', 2, 21, 1, '重新启动', '!=', 1, 1, 1, 15, 'ApiServer', 1, '2022-11-20 21:00:54'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (621, 'DSMaster存活', 'DS', 'up{job=\'masterserver\'}', 2, 21, 1, '重新启动', '!=', 1, 1, 1, 15, 'MasterServer', 1, '2022-11-20 21:01:33'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (622, 'DSWorker存活', 'DS', 'up{job=\'workerserver\'}', 2, 21, 1, '重新启动', '!=', 1, 1, 1, 15, 'WorkerServer', 1, '2022-11-20 21:02:10'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (623, 'DSAlert存活', 'DS', 'up{job=\'alertserver\'}', 2, 21, 1, '重新启动', '!=', 1, 1, 1, 15, 'AlertServer', 1, '2022-11-20 21:02:46'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (624, 'StreamPark存活', 'STREAMPARK', 'up{job=\'streampark\'}', 2, 22, 1, '重新启动', '!=', 1, 1, 1, 15, 'StreamPark', 1, '2022-11-21 18:20:51'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (625, 'FE进程存活', 'DORIS', 'up{group=\"fe\",job=\"doris\"}', 2, 23, 1, 'restart', '!=', 1, 1, 1, 15, 'DorisFE', 1, '2023-01-07 22:21:36'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (626, 'BE进程存活', 'DORIS', 'up{group=\"be\",job=\"doris\"}', 2, 23, 1, 'restart', '!=', 1, 1, 1, 15, 'DorisBE', 1, '2023-01-07 22:22:10'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (627, 'HistoryServer进程存活', 'YARN', 'up{job=\"historyserver\"}', 2, 3, 1, '重新启动', '!=', 1, 1, 1, 15, 'HistoryServer', 1, '2023-01-12 14:20:23'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (628, 'DataSophonWorker存活', 'NODE', 'up{job=\'worker\'}', 2, 11, 1, '使用service datasophon-worker start命令启动worker', '!=', 1, 1, 1, 15, 'node', 1, '2023-04-17 21:10:01'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (629, 'Pulsar Broker存活', 'PULSAR', 'up{job=\"pulsarbroker\"}', 2, 24, 1, '重新启动', '!=', 1, 1, 1, 15, 'PulsarBroker', 1, '2023-06-19 10:51:17'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (630, 'Pulsar Bookie进程存活', 'PULSAR', 'up{job=\"bookie\"}', 2, 24, 1, '重新启动', '!=', 1, 1, 1, 15, 'Bookie', 1, '2023-06-19 11:17:07'); +INSERT INTO `t_ddh_cluster_alert_quota` VALUES (631, '存在NodeManager Unhealthy节点', 'YARN', 'Hadoop_ResourceManager_NumUnhealthyNMs', 1, 3, 1, '打开Yarn Web Ui 查看Unhealthy NodeManager节点', '>', 0, 1, 1, 15, 'NodeManager', 1, '2023-06-26 17:12:47'); + + + + +-- ---------------------------- +-- Records of t_ddh_cluster_alert_rule +-- ---------------------------- +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101001, 101001, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101002, 101002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机CPU使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101003, 101003, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机CPU系统使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101004, 101004, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机CPU用户使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101005, 101005, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机磁盘IO使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101006, 101006, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机交换分区使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101007, 101007, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', '主机磁盘使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101008, 101008, 'TRUE', '>', '8589934592', 60, 'REPEAT', 30, 'WARN', '主机入网带宽', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101009, 101009, 'TRUE', '>', '8589934592', 60, 'REPEAT', 30, 'WARN', '主机出网带宽', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101010, 101010, 'TRUE', '>', '100', 60, 'REPEAT', 30, 'WARN', '系统平均负载[1m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101011, 101011, 'TRUE', '>', '100', 60, 'REPEAT', 30, 'WARN', '系统平均负载[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101012, 101012, 'TRUE', '>', '100', 60, 'REPEAT', 30, 'WARN', '系统平均负载[15m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101013, 101013, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Ntp服务存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (101014, 101014, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Ntp时间同步', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (102001, 102001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AlertManager进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (103001, 103001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Elasticsearch进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (103002, 103002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'ElasticsearchCPU使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (103003, 103003, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'Elasticsearch内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (103004, 103004, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'Elasticsearch磁盘使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (104001, 104001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'FlinkHistoryServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (105001, 105001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Grafana进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (106001, 106001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HBaseMaster进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (106002, 106002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HRegionServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (106003, 106003, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HThriftServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107001, 107001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'NameNode进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107002, 107002, 'TRUE', '>', '5', 60, 'REPEAT', 30, 'WARN', 'NameNodeRPC延迟[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107003, 107003, 'TRUE', '>', '5', 60, 'REPEAT', 30, 'WARN', 'NameNodeRPC延迟[15m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107004, 107004, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'NameNode堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107005, 107005, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NameNode老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107006, 107006, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NameNode新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107007, 107007, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NameNodeGC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107008, 107008, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'DataNode进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107009, 107009, 'TRUE', '>', '5', 60, 'REPEAT', 30, 'WARN', 'DataNodeRPC[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107010, 107010, 'TRUE', '>', '5', 60, 'REPEAT', 30, 'WARN', 'DataNodeRPC[15m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107011, 107011, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'DataNode堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107012, 107012, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'DataNode老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107013, 107013, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'DataNode新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107014, 107014, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'DataNodeGC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107015, 107015, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'JournalNode进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107016, 107016, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ZKFailoverController进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107017, 107017, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HttpFs进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107018, 107018, 'TRUE', '>', '0', 60, 'REPEAT', 30, 'WARN', 'HDFS坏盘', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (107019, 107019, 'TRUE', '>', '0', 60, 'REPEAT', 30, 'WARN', 'HDFS块丢失', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108001, 108001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HiveServer2进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108002, 108002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'HiveServer2堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108003, 108003, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'HiveServer2老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108004, 108004, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'HiveServer2新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108005, 108005, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HiveMetastore进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108006, 108006, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'HiveMetastore堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108007, 108007, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'HiveMetastore老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108008, 108008, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'HiveMetastore新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (108009, 108009, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'MySQL进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (109001, 109001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'HueServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (110001, 110001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'InfluxDB进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (111001, 111001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'KafkaEagle进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (112001, 112001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Kibana进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (113001, 113001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'KylinServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (113002, 113002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'KylinServer堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (113003, 113003, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'KylinServer老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (113004, 113004, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'KylinServer新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (114001, 114001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'LivyServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (114002, 114002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'LivyServer堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (114003, 114003, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'LivyServer老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (114004, 114004, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'LivyServer新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (115001, 115001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'NodeExporter进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (116001, 116001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'OozieServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (116002, 116002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'OozieServer堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (116003, 116003, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'OozieServer老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (116004, 116004, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'OozieServer新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (117001, 117001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Prometheus进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (118001, 118001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'RangerServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (119001, 119001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'SparkHistoryServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (120001, 120001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'TezUI进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (121001, 121001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'MonitorAgent进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (122001, 122001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ZkUI进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (123001, 123001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'QuarumPeermain进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124001, 124001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ResourceManager进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124002, 124002, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'ResourceManager堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124003, 124003, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'ResourceManager老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124004, 124004, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'ResourceManager新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124005, 124005, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'ResourceManagerGC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124006, 124006, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'NodeManager进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124007, 124007, 'TRUE', '>', '95', 60, 'REPEAT', 30, 'WARN', 'NodeManager堆内存使用率', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124008, 124008, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NodeManager老年代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124009, 124009, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NodeManager新生代GC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (124010, 124010, 'TRUE', '>', '60', 60, 'REPEAT', 30, 'WARN', 'NodeManagerGC持续时间[5m]', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (125001, 125001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'PrestoCoordinator进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (125002, 125002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'PrestoWorker进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (126001, 126001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'UdsMaster进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (126002, 126002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'UdsWorker进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (126003, 126003, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'UdsWeb进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (127001, 127001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'KuduMaster进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (127002, 127002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'KuduTserver进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (128001, 128001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ImpalaImpalad进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (128002, 128002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ImpalaCatalog进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (128003, 128003, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ImpalaStatestored进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (129001, 129001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ZeppelinServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (130001, 130001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AirflowWebserver进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (130002, 130002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AirflowScheduler进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (131001, 131001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AtlasIndexServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (131002, 131002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AtlasServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (132001, 132001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'AlertServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (132002, 132002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'ApiServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (132003, 132003, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'LoggerServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (132004, 132004, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'MasterServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (132005, 132005, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'WorkerServer进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (133001, 133001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'TrinoCoordinator进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (133002, 133002, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'TrinoWorker进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); +INSERT INTO `t_ddh_cluster_alert_rule` VALUES (134001, 134001, 'TRUE', '!=', '1', 60, 'REPEAT', 30, 'WARN', 'Neo4j进程存活', NULL, 'VALID', 'FALSE', NULL, NULL, NULL); + + + +-- ---------------------------- +-- Records of t_ddh_cluster_service_dashboard +-- ---------------------------- +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (1, 'HDFS', 'http://${grafanaHost}:3000/d/huM_B3dZz/2-hdfs?orgId=1&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (2, 'YARN', 'http://${grafanaHost}:3000/d/-ZErfqOWz/3-yarn?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (3, 'HIVE', 'http://${grafanaHost}:3000/d/WYNeBqdZz/5-hive?orgId=1&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (4, 'HBASE', 'http://${grafanaHost}:3000/d/_S8XBqOWz/4-hbase?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (5, 'KAFKA', 'http://${grafanaHost}:3000/d/DGHHkJKWk/6-kafka?orgId=1&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (6, 'ZOOKEEPER', 'http://${grafanaHost}:3000/d/000000261/8-zookeeper?orgId=1&refresh=1m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (7, 'RANGER', 'http://${grafanaHost}:3000/d/qgVDEd3nk/ranger?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (8, 'PROMETHEUS', 'http://${grafanaHost}:3000/d/dd4t3A6nz/prometheus-2-0-overview?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (9, 'GRAFANA', 'http://${grafanaHost}:3000/d/eea-11_sik/grafana?orgId=1&refresh=5m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (10, 'ALERTMANAGER', 'http://${grafanaHost}:3000/d/eea-9_siks/alertmanager?orgId=1&refresh=5m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (11, 'SPARK3', 'http://${grafanaHost}:3000/d/rCUqf3dWz/7-spark?orgId=1&from=now-30m&to=now&refresh=5m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (12, 'TOTAL', 'http://${grafanaHost}:3000/d/_4gf-qOZz/1-zong-lan?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (13, 'TRINO', 'http://${grafanaHost}:3000/d/TGzKne5Wk/trino?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (14, 'STARROCKS', 'http://${grafanaHost}:3000/d/wpcA3tG7z/starrocks?orgId=1&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (15, 'FLINK', 'http://${grafanaHost}:3000/d/-0rFuzoZk/flink-dashboard?orgId=1&refresh=30s&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (16, 'ELASTICSEARCH', 'http://${grafanaHost}:3000/d/3788af4adc3046dd92b3af31d0150c79/elasticsearch-cluster?orgId=1&refresh=5m&var-cluster=ddp_es&var-name=All&var-interval=5m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (17, 'DS', 'http://${grafanaHost}:3000/d/X_NPpJOVk/dolphinscheduler?refresh=1m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (18, 'STREAMPARK', 'http://${grafanaHost}:3000/d/98U0T1OVz/streampark?kiosk&refresh=1m'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (19, 'DINKY', 'http://${grafanaHost}:3000/d/9qU9T1OVk/dinky?kiosk&refresh=1m'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (20, 'DORIS', 'http://${grafanaHost}:3000/d/1fFiWJ4mz/doris-overview?orgId=1&from=now-6h&to=now&refresh=1m&kiosk'); +INSERT INTO `t_ddh_cluster_service_dashboard` VALUES (21, 'KERBEROS', 'http://${grafanaHost}:3000/d/QflaxlA4k/kerberos?orgId=1&refresh=1m&kiosk'); + + + +-- ---------------------------- +-- Records of t_ddh_install_step +-- ---------------------------- +INSERT INTO `t_ddh_install_step` VALUES (1, '安装主机', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (2, '主机环境校验', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (3, '分发安装启动主机agent', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (4, '选择服务', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (5, '分配服务Master角色', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (6, '分配服务Worker与Client角色', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (7, '服务配置', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (8, '服务安装总览', NULL, 1); +INSERT INTO `t_ddh_install_step` VALUES (9, '服务安装启动', NULL, 1); + +-- ---------------------------- +-- Records of t_ddh_cluster_group +-- ---------------------------- +INSERT INTO `t_ddh_cluster_group` VALUES (1, 'hadoop', 1); +INSERT INTO `t_ddh_cluster_group` VALUES (2, 'elastic', 1); + +-- ---------------------------- +-- Records of t_ddh_cluster_user +-- ---------------------------- +INSERT INTO `t_ddh_cluster_user` VALUES (1, 'hdfs', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (2, 'hive', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (3, 'yarn', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (4, 'mapred', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (5, 'elastic', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (6, 'hbase', 1); +INSERT INTO `t_ddh_cluster_user` VALUES (9, 'admin', 1); + +-- ---------------------------- +-- Records of t_ddh_cluster_user_group +-- ---------------------------- +INSERT INTO `t_ddh_cluster_user_group` VALUES (1, 1, 1, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (2, 2, 1, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (3, 3, 1, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (4, 4, 1, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (5, 5, 2, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (6, 6, 1, 1, 1); +INSERT INTO `t_ddh_cluster_user_group` VALUES (11, 9, 1, 1, 1); + +-- ---------------------------- +-- Records of t_ddh_session +-- ---------------------------- +INSERT INTO `t_ddh_session` VALUES ('3f229c41-84ee-4a09-a0b9-76e95f0577dc', 2, '192.168.75.12', '2022-09-07 11:52:12'); +INSERT INTO `t_ddh_session` VALUES ('d25dd005-ceb6-4414-bfdf-9279a23c2ba6', 1, '192.168.75.12', '2023-02-12 20:34:57'); + + + +-- ---------------------------- +-- Records of t_ddh_user_info +-- ---------------------------- +INSERT INTO `t_ddh_user_info` VALUES (1, 'admin', '0192023a7bbd73250516f069df18b500', 'xxx@163.com', '1865xx', '2022-05-10 16:05:18', 1); From 1a30b96567cabcde1fbf527139416f87651c8a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Fri, 18 Aug 2023 16:56:18 +0800 Subject: [PATCH 02/11] first commit datasophon-init --- datasophon-init/README.md | 100 ++- datasophon-init/bin/init-Cython.sh | 31 - datasophon-init/bin/init-add-hadoop-user.sh | 42 - datasophon-init/bin/init-allhosts.sh | 59 -- datasophon-init/bin/init-chmod-dev-null.sh | 26 - datasophon-init/bin/init-cleanBuff-async.sh | 34 - datasophon-init/bin/init-cleanBuff.sh | 16 - datasophon-init/bin/init-close-swap.sh | 41 - .../bin/init-close-transparent-hugepage.sh | 26 - datasophon-init/bin/init-cyrus-sasl.sh | 20 - datasophon-init/bin/init-ecdsa.sh | 31 - datasophon-init/bin/init-expect.sh | 37 - datasophon-init/bin/init-gcc-c++.sh | 30 - datasophon-init/bin/init-hostIp-txt.sh | 43 - datasophon-init/bin/init-hostname.sh | 30 - datasophon-init/bin/init-java-policy.sh | 24 - datasophon-init/bin/init-jdk.sh | 108 --- datasophon-init/bin/init-krb5-devel.sh | 36 - datasophon-init/bin/init-libxslt-devel.sh | 27 - datasophon-init/bin/init-mysql-8.sh | 127 --- datasophon-init/bin/init-mysql-datasophon.sh | 65 -- datasophon-init/bin/init-mysql-devel.sh | 28 - datasophon-init/bin/init-mysql-udp.sh | 34 - datasophon-init/bin/init-nmap.sh | 27 - datasophon-init/bin/init-ntp-chrony-server.sh | 105 --- datasophon-init/bin/init-ntp-chrony-slave.sh | 59 -- datasophon-init/bin/init-ntp_enable.sh | 28 - datasophon-init/bin/init-perl-JSON.sh | 29 - .../bin/init-private-yum-library.sh | 107 --- datasophon-init/bin/init-psmisc.sh | 28 - datasophon-init/bin/init-pssh.sh | 36 - datasophon-init/bin/init-pytest_runner.sh | 27 - datasophon-init/bin/init-python-rpm-macros.sh | 31 - .../bin/init-python-srpm-macros.sh | 31 - .../bin/init-python2-rpm-macros.sh | 31 - datasophon-init/bin/init-python36-devel.sh | 31 - datasophon-init/bin/init-redhat-lsb.sh | 31 - datasophon-init/bin/init-six.sh | 32 - datasophon-init/bin/init-sourceSSHHostname.sh | 2 - datasophon-init/bin/init-ssh-copy-key.sh | 76 -- datasophon-init/bin/init-ssh-gen-key.sh | 74 -- datasophon-init/bin/init-ssh-hadoop.sh | 40 - datasophon-init/bin/init-sshpackage.sh | 37 - datasophon-init/bin/init-sshpass.sh | 37 - datasophon-init/bin/init-stop-firewall.sh | 35 - datasophon-init/bin/init-stop-selinux.sh | 38 - datasophon-init/bin/init-system-conf.sh | 83 -- datasophon-init/bin/init-test.sh | 32 - datasophon-init/bin/init-tmp_pid.sh | 27 - datasophon-init/bin/init-websocket_client.sh | 32 - datasophon-init/bin/init-xdg-utils.sh | 30 - datasophon-init/bin/init-yum-hosts-mapping.sh | 52 -- .../config/init-host-info-add.properties | 21 - .../config/init-host-info.properties | 15 - datasophon-init/config/init.properties | 28 - datasophon-init/sbin/init.sh | 786 ------------------ website/static/img/Initialization-process.png | Bin 0 -> 30914 bytes 57 files changed, 95 insertions(+), 2998 deletions(-) delete mode 100644 datasophon-init/bin/init-Cython.sh delete mode 100644 datasophon-init/bin/init-add-hadoop-user.sh delete mode 100644 datasophon-init/bin/init-allhosts.sh delete mode 100644 datasophon-init/bin/init-chmod-dev-null.sh delete mode 100644 datasophon-init/bin/init-cleanBuff-async.sh delete mode 100644 datasophon-init/bin/init-cleanBuff.sh delete mode 100644 datasophon-init/bin/init-close-swap.sh delete mode 100644 datasophon-init/bin/init-close-transparent-hugepage.sh delete mode 100644 datasophon-init/bin/init-cyrus-sasl.sh delete mode 100644 datasophon-init/bin/init-ecdsa.sh delete mode 100644 datasophon-init/bin/init-expect.sh delete mode 100644 datasophon-init/bin/init-gcc-c++.sh delete mode 100644 datasophon-init/bin/init-hostIp-txt.sh delete mode 100644 datasophon-init/bin/init-hostname.sh delete mode 100644 datasophon-init/bin/init-java-policy.sh delete mode 100644 datasophon-init/bin/init-jdk.sh delete mode 100644 datasophon-init/bin/init-krb5-devel.sh delete mode 100644 datasophon-init/bin/init-libxslt-devel.sh delete mode 100644 datasophon-init/bin/init-mysql-8.sh delete mode 100644 datasophon-init/bin/init-mysql-datasophon.sh delete mode 100644 datasophon-init/bin/init-mysql-devel.sh delete mode 100644 datasophon-init/bin/init-mysql-udp.sh delete mode 100644 datasophon-init/bin/init-nmap.sh delete mode 100644 datasophon-init/bin/init-ntp-chrony-server.sh delete mode 100644 datasophon-init/bin/init-ntp-chrony-slave.sh delete mode 100644 datasophon-init/bin/init-ntp_enable.sh delete mode 100644 datasophon-init/bin/init-perl-JSON.sh delete mode 100644 datasophon-init/bin/init-private-yum-library.sh delete mode 100644 datasophon-init/bin/init-psmisc.sh delete mode 100644 datasophon-init/bin/init-pssh.sh delete mode 100644 datasophon-init/bin/init-pytest_runner.sh delete mode 100644 datasophon-init/bin/init-python-rpm-macros.sh delete mode 100644 datasophon-init/bin/init-python-srpm-macros.sh delete mode 100644 datasophon-init/bin/init-python2-rpm-macros.sh delete mode 100644 datasophon-init/bin/init-python36-devel.sh delete mode 100644 datasophon-init/bin/init-redhat-lsb.sh delete mode 100644 datasophon-init/bin/init-six.sh delete mode 100644 datasophon-init/bin/init-sourceSSHHostname.sh delete mode 100644 datasophon-init/bin/init-ssh-copy-key.sh delete mode 100644 datasophon-init/bin/init-ssh-gen-key.sh delete mode 100644 datasophon-init/bin/init-ssh-hadoop.sh delete mode 100644 datasophon-init/bin/init-sshpackage.sh delete mode 100644 datasophon-init/bin/init-sshpass.sh delete mode 100644 datasophon-init/bin/init-stop-firewall.sh delete mode 100644 datasophon-init/bin/init-stop-selinux.sh delete mode 100644 datasophon-init/bin/init-system-conf.sh delete mode 100644 datasophon-init/bin/init-test.sh delete mode 100644 datasophon-init/bin/init-tmp_pid.sh delete mode 100644 datasophon-init/bin/init-websocket_client.sh delete mode 100644 datasophon-init/bin/init-xdg-utils.sh delete mode 100644 datasophon-init/bin/init-yum-hosts-mapping.sh delete mode 100644 datasophon-init/config/init-host-info-add.properties delete mode 100644 datasophon-init/config/init-host-info.properties delete mode 100644 datasophon-init/config/init.properties delete mode 100644 datasophon-init/sbin/init.sh create mode 100644 website/static/img/Initialization-process.png diff --git a/datasophon-init/README.md b/datasophon-init/README.md index 5a0fdfd3..a55f2017 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -18,8 +18,98 @@

觉得不错的话,star fork下,欢迎社区开发者共建DataSophon

# dataSophon-init使用说明 -前言:当前版本是根据centos8.5进行适配的,其它类型和版本的操作系统目前不能完全支持,需要对shell脚本和本地YUM离线安装包进行适配 -1、将dataSophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); -2、将 private-yum-library.tar.gz YUM离线安装包 移到 /data 文件夹并解压; -3、将packages.tar.gz 离线依赖库移到 /data/dataSophon-init下 并解压; -4、 \ No newline at end of file +前言:当前版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配 +1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); +2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压; +3、在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); + 离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源,该步骤都是在主节点上操作): + 配置脚本为:init-private-yum-library-${initOS}.sh + ①首先创建目录 'mkdir -p /data/private-yum-library_temp'然后将和操作系统匹配的操作系统iso文件移动到/data/目录下; + ②在/data目录下创建private-yum-library目录:'mkdir -p /data/private-yum-library'; + ③执行挂载操作系统命令:mount -o loop /data/openEuler-22.03-LTS-SP2-everything-x86_64-dvd.iso /data/private-yum-library_temp + 这种挂载重启服务器之后会失效,所以我们挂载完成后将ios内的文件全部拷贝出来做离线yum源用; + ④在private-yum-library目录下创建两个子目录 repo 和 epel; + ⑤将private-yum-library_temp目录下的文件全部拷贝到/data/private-yum-library/repo目录下:cp -r /data/private-yum-library_temp/* /data/private-yum-library/repo + 另外不同操作系统挂载后所产生的目录不同,比如centos8的repo有两个BaseOS和AppStream; + ⑥将原本的yum源的配置文件进行备份 :mkdir -p /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak + ⑦剩下的工作就交给脚本工具自己去处理了,epel目录是为了给需要自行配置离线eprl源的用户准备的,如果能配置epel建议进行配置,因为很多操作系统额外的很多工具包都在对应的epel中 + +4、集群NTP时钟默认使用Chrony,如使用其它的方式请自行安装配置,并将sbin/init.sh 脚本中的 initALL() 方法中的‘initAllNtpChronyService’ 和 ‘checkNtpChronyService’方法注释掉避免重复安装; +5、脚本的初始化需要用到python环境,主要用到pssh进行集群间的命令执行控制,目前packages目录中pssh.tar.gz中已经内置了三个安装包 + pssh-2.3.1-5.el7.noarch.rpm 需要python2.7的支持 + pssh-2.3.1-29.el8.noarch.rpm 需要python3.6的支持 + pssh-2.3.4-1.el9.noarch.rpm 需要python3.9的支持 + Centos7和8中的repo中已经存在对应的rpm格式的pssh包了,目前openEuler22.03中还没有pssh相关的安装包 + 其它版本pssh的rpm包下载工具地址:http://rpmfind.net/linux/rpm2html/search.php?query=pssh,可以根据操作系统和python版本进行适配 +6、服务器操作系统的iso文件建议使用everything版本的,这样包含的依赖包更全一点; + +dataSophon-init目录结构如下: +[root@localhost datasophon-init]# ls -l +总用量 8 +drwxr-xr-x 2 root root 4096 8月 10 17:09 bin +drwxr-xr-x 2 root root 99 7月 28 16:10 config +drwxr-xr-x 8 root root 4096 8月 9 13:47 packages +drwxr-xr-x 2 root root 189 7月 27 11:35 remove +drwxr-xr-x 3 root root 50 8月 10 20:02 sbin +drwxr-xr-x 2 root root 70 8月 7 10:54 sql + + +上面的各个目录解释如下: + +* bin:datasophon 服务器集群环境配置初始化程序脚本(单个模块初始化脚本所在目录,无需手动管理) +* config:datasophon 服务器集群环境一键初始化所需配置文件目录,需要用户手动修改 +* packages:初始化过程需要的依赖安装包存放目录 +* remove:卸载环境脚本 +* sbin:一键初始化环境脚本所在目录 +* sql:datasophon数据库初始化sql脚本所在目录 + + +在 config 目录下面有三个配置文件: +* init.properties:主要配置私有化 yum 源安装节点信息、namp 安装节点信息、mysql 数据库安装节点信息、修复机器总数,以及修复模块日志存放位置。用户根据需要自行修改相关配置项; +* init-host-info.properties:节点全量修复,需要配置此文件,具体配置所有节点内网 Ip、密码、端口号以及主机名; +* init-host-info-add.properties:集群新增节点时,需要配置此文件,具体配置新增节点内网 Ip、密码、端口号以及主机名; + +### init.properties 说明 + +yum.repo.host.ip:填写即将部署私有化yum源的节点的内网IP(即执行init脚本的节点IP,推荐在主节点上进行) +namp.server.ip=:填写未来要部署的datasophon管理端的节点内网IP +namp.server.port:填写未来要部署的datasophon管理端节点的SSH端口号,默认22 +namp.server.password:填写未来要部署的datasophon管理端节点的密码,这个密码最好不要有特殊字符比如‘,’、‘$’等 +ntp.master.ip: 填写未来要部署ntp时钟同步的主节点服务器IP(推荐主节点) +mysql.ip: 填写未来要部署mysql数据库的节点服务器IP(推荐主节点) +mysql.host.ssh.port: 填写未来要部署mysql数据库的节点服务器SSH端口,默认为22 +mysql.host.ssh.password: 填写未来要部署mysql数据库的节点服务器的密码 +mysql.password: 填写未来要部署mysql数据库的root密码,这个密码不要有特殊字符比如‘,’、‘$’等,可在初始化完成之后再自行设置高复杂度密码 +init.host.num: 填写未来要初始化的服务器数量 +init.add.host.num: 填写未来要初始化的新增服务器节点数量,全量初始化时无需修改 +init.log.dir=./logs :设置初始化服务器环境时日志存放目录 + +### init-host-info.properties 说明 + +dataSophon.ip.i=172.31.51.194 #预备安装dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量) +dataSophon.password.i=xxxxx #预备安装dataSophon集群的节点的登录密码 +dataSophon.ssh.port.i=22 #预备安装dataSophon集群的节点的SSH端口默认22 +dataSophon.ssh.port.hostname.i=dataSophon0 #预备安装dataSophon集群的节点的主机名 + + +## 全量初始化流程 + +![img](website/static/img/Initialization-process.png) + +### 执行初始化脚本 +完成上述步骤后,执行如下命令即可开始一键初始化任务。 +PS:执行的 + +cd /data/datasophon-init/sbin +bash init.sh initAll +source /etc/profile + +当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 +其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" + +##当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64 +##当前初始化模块支持的mysql为:mysql-community-8.0.28 +##自动安装的JDK为:jdk-8u333 + + + diff --git a/datasophon-init/bin/init-Cython.sh b/datasophon-init/bin/init-Cython.sh deleted file mode 100644 index 67203de8..00000000 --- a/datasophon-init/bin/init-Cython.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -CYTHON_FOLDER_NAME=Cython-0.20 -CYTHON_TAR_NAME=Cython-0.20.tar.gz - tar -zxvf ${PACKAGES_PATH}/${CYTHON_TAR_NAME} -C ${PACKAGES_PATH} - cd ${PACKAGES_PATH}/${CYTHON_FOLDER_NAME} - python3 setup.py install - cd ${INIT_BIN_PATH} - echo "Cython install successfully" - - diff --git a/datasophon-init/bin/init-add-hadoop-user.sh b/datasophon-init/bin/init-add-hadoop-user.sh deleted file mode 100644 index 4a770a7e..00000000 --- a/datasophon-init/bin/init-add-hadoop-user.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# example: sh init-ssh-gen-key.sh - -filePath=$1 -GROUP=hadoop -USER=hadoop - -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -egrep "^$GROUP" /etc/group >& /dev/null -if [ $? -ne 0 ] -then - groupadd $GROUP - echo "Successfully added GROUP: hadoop" -fi -egrep "^$USER" /etc/passwd >& /dev/null -if [ $? -ne 0 ] -then - useradd -g ${USER} ${USER} - echo "Successfully added USER: hadoop psw hadoop" -fi - -echo "init-add-hadoop-user.sh." -echo "Done." - - - - diff --git a/datasophon-init/bin/init-allhosts.sh b/datasophon-init/bin/init-allhosts.sh deleted file mode 100644 index 9e3ac0bc..00000000 --- a/datasophon-init/bin/init-allhosts.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -hostAllInfoPath="$1" -initAllHostNums="$2" - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ]; then - BASE_DIR=$(dirname $(readlink $0)) -else - BASE_DIR=$(dirname $0) -fi -BASE_PATH=$( - cd ${BASE_DIR} - pwd -) -REPAIR_PATH=$(dirname "${BASE_PATH}") -echo "REPAIR_PATH: ${REPAIR_PATH}" - -sed -i '/#modify etc hosts start/,/#modify etc hosts end/d' /etc/hosts -modifyHosts() { - cat /etc/hosts | grep yum - if [ $? -eq 0 ]; then - sed -i '/#modify yum mapping hosts start/i\#modify etc hosts start' /etc/hosts - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password - echo "ip: ${ip}" - echo "${ip} ${hostname}" - sed -i '/#modify yum mapping hosts start/i '${ip}' '${hostname}'' /etc/hosts - done - sed -i '/#modify yum mapping hosts start/i\#modify etc hosts end' /etc/hosts - else - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - echo "#modify etc hosts start" >>/etc/hosts - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password - echo "ip: ${ip}" - echo "${ip} ${hostname}" - echo "${ip} ${hostname}" >>/etc/hosts - done - echo "#modify etc hosts end" >>/etc/hosts - fi - -} - -modifyHosts -sed -i 's/^[^#].*[0-9]-[0-9]/#&/g' /etc/hosts - -echo "init-hosts.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-chmod-dev-null.sh b/datasophon-init/bin/init-chmod-dev-null.sh deleted file mode 100644 index 2bbfece2..00000000 --- a/datasophon-init/bin/init-chmod-dev-null.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# example: sh init-expect.sh -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -rm -rf /dev/null && mknod -m 0666 /dev/null c 1 3 -echo "INIT-chmod-dev-null.sh." -echo "Done." - diff --git a/datasophon-init/bin/init-cleanBuff-async.sh b/datasophon-init/bin/init-cleanBuff-async.sh deleted file mode 100644 index feef7563..00000000 --- a/datasophon-init/bin/init-cleanBuff-async.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ] -then - echo Non root user. Please run as root. - exit 1 -fi - -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" - - -BASE_PATH=$(cd ${BASE_DIR}; pwd) -echo "BASE_PATH: ${BASE_PATH}" - -BIN_PATH=`dirname "${BASE_PATH}"`/bin -SCRIPTS_PATH=`dirname "${BASE_PATH}"`/scripts - -echo "SCRIPTS_PATH: $SCRIPTS_PATH" - -nohup sh ${INIT_BIN_PATH}/init-cleanBuff.sh >/dev/null 2>&1 & -#nohup sh $SCRIPTS_PATH/repair-cleanBuff.sh & - - diff --git a/datasophon-init/bin/init-cleanBuff.sh b/datasophon-init/bin/init-cleanBuff.sh deleted file mode 100644 index b66aa844..00000000 --- a/datasophon-init/bin/init-cleanBuff.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - - -echo "sync" -sync -sync -sync - -echo "sleep" -sleep 10 - -echo 1 > /proc/sys/vm/drop_caches -echo 2 > /proc/sys/vm/drop_caches -echo 3 > /proc/sys/vm/drop_caches - -echo "done" diff --git a/datasophon-init/bin/init-close-swap.sh b/datasophon-init/bin/init-close-swap.sh deleted file mode 100644 index 1f16f5bd..00000000 --- a/datasophon-init/bin/init-close-swap.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - - -#swapoff /dev/centos/swap - -# /etc/fstab -# /dev/mapper/centos-swap swap swap defaults 0 0 -sed -ri 's/.*swap.*/#&/' /etc/fstab - -echo 0 > /proc/sys/vm/swappiness - -SWAP_STR=`cat /etc/sysctl.conf | grep vm.swappiness` -if [ -z "${SWAP_STR}" ] -then - echo "vm.swappiness=0" >> /etc/sysctl.conf -else - sed -i '/vm.swappiness/d' /etc/sysctl.conf - echo "vm.swappiness=0" >> /etc/sysctl.conf -fi - -sysctl vm.swappiness=0 -swapoff -a && swapon -a -sysctl -p - -echo "Swap is closed." -echo "init-close-swap.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-close-transparent-hugepage.sh b/datasophon-init/bin/init-close-transparent-hugepage.sh deleted file mode 100644 index 11cc2edc..00000000 --- a/datasophon-init/bin/init-close-transparent-hugepage.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - - -echo never > /sys/kernel/mm/transparent_hugepage/enabled -echo never > /sys/kernel/mm/transparent_hugepage/defrag -cat /sys/kernel/mm/transparent_hugepage/defrag -cat /sys/kernel/mm/transparent_hugepage/enabled -echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag' >> /etc/rc.d/rc.local -echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.d/rc.local -echo "transparent_hugepage is closed." -echo "init-close-transparent-hugepage.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-cyrus-sasl.sh b/datasophon-init/bin/init-cyrus-sasl.sh deleted file mode 100644 index 9b6b8628..00000000 --- a/datasophon-init/bin/init-cyrus-sasl.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -yum -y install cyrus-sasl* - -echo "cyrus-sasl install successfully" diff --git a/datasophon-init/bin/init-ecdsa.sh b/datasophon-init/bin/init-ecdsa.sh deleted file mode 100644 index b45ef485..00000000 --- a/datasophon-init/bin/init-ecdsa.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -ECDSA_FOLDER_NAME=ecdsa-0.14.1 -ECDSA_TAR_NAME=ecdsa-0.14.1.tar.gz - tar -zxvf ${PACKAGES_PATH}/${ECDSA_TAR_NAME} -C ${PACKAGES_PATH} - cd ${PACKAGES_PATH}/${ECDSA_FOLDER_NAME} - python3 setup.py install - cd ${INIT_PATH} - echo "ecdsa install successfully" - - diff --git a/datasophon-init/bin/init-expect.sh b/datasophon-init/bin/init-expect.sh deleted file mode 100644 index 7554b45c..00000000 --- a/datasophon-init/bin/init-expect.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# example: sh init-expect.sh -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -EXPECT_FOLDER_NAME=expect -EXPECT_TAR_NAME=expect.tar.gz -rpm -qa | grep expect-5.45 -if [ "$?" == "0" ]; then -echo "expect exists" -else - yum -y install expect -rpm -qa | grep expect-5.45 -if [ "$?" == "0" ]; then -echo "expect exists" -echo "init-expect.sh finished." -echo "Done." - fi -fi diff --git a/datasophon-init/bin/init-gcc-c++.sh b/datasophon-init/bin/init-gcc-c++.sh deleted file mode 100644 index aaa99d64..00000000 --- a/datasophon-init/bin/init-gcc-c++.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -GCC_FOLDER_NAME=gcc-c++ -GCC_TAR_NAME=gcc-c++.tar.gz -rpm -qa | grep gcc-c++ -if [ "$?" == "0" ]; then -echo "rpm -qa | grep gcc-c++ exists" -else - yum -y install gcc-c++ - rpm -qa | grep gcc-c++ - if [ "$?" == "0" ]; then - echo "gcc-c++ install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-hostIp-txt.sh b/datasophon-init/bin/init-hostIp-txt.sh deleted file mode 100644 index e4992020..00000000 --- a/datasophon-init/bin/init-hostIp-txt.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# example: sh init-expect.sh -#TXT for initializing the cluster IP address list - -hostAllInfoPath="$1" -initAllHostNums="$2" -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 -} -for ((i=1; i<=${initAllHostNums}; i++)) -do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") -echo "ip: ${ip}" -echo "port: ${port}" -echo -e "root@${ip}:${port}" >> ${INIT_BIN_PATH}/tmp_scp_host_info.txt -done - -echo "init-hostIp-txt.sh finished." -echo "Done." - diff --git a/datasophon-init/bin/init-hostname.sh b/datasophon-init/bin/init-hostname.sh deleted file mode 100644 index 6c35e888..00000000 --- a/datasophon-init/bin/init-hostname.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - - -hostname=$1 -modifyHostname(){ - echo "${hostname}" > /etc/hostname - echo "HOSTNAME=${hostname}" > /etc/sysconfig/network - echo "NOZEROCONF=yes" >> /etc/sysconfig/network - hostnamectl set-hostname ${hostname} - hostnamectl set-hostname --static ${hostname} -} - -modifyHostname - -echo "init-hostname.sh finished." diff --git a/datasophon-init/bin/init-java-policy.sh b/datasophon-init/bin/init-java-policy.sh deleted file mode 100644 index 96c3dfd8..00000000 --- a/datasophon-init/bin/init-java-policy.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BBASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -ETC_HOST=/etc/hosts -source /etc/profile -sed -i '/modify java policy start/,/modify java policy end/d' ${JAVA_HOME}/jre/lib/security/java.policy -sed -i '/grant {/a\//modify java policy end' ${JAVA_HOME}/jre/lib/security/java.policy -sed -i '/modify java policy end/i\//modify java policy start' ${JAVA_HOME}/jre/lib/security/java.policy -sed -i '/modify java policy end/i\permission javax.management.MBeanTrustPermission "register";' ${JAVA_HOME}/jre/lib/security/java.policy -echo "init-java-policy.sh finished." -echo "Done." \ No newline at end of file diff --git a/datasophon-init/bin/init-jdk.sh b/datasophon-init/bin/init-jdk.sh deleted file mode 100644 index 965a2f12..00000000 --- a/datasophon-init/bin/init-jdk.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash - -# example: sh init-jdk.sh -# instal and config jdk env -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ]; then - BASE_DIR=$(dirname $(readlink $0)) -else - BASE_DIR=$(dirname $0) -fi -BASE_PATH=$( - cd ${BASE_DIR} - pwd -) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -JDK_FOLDER_PATH=/usr/java -source /etc/profile -mkdir -p /usr/java -JDK_PATH_NAME="jdk1.8.0_333" -JDK_VERSION="1.8" -BASH_PROFILE_PATH="/root/.bash_profile" -BASHRC_PATH="/root/.bashrc" -ETC_PROFILE_PATH="/etc/profile" -JDK_TAR_NAME="jdk-8u333-linux-x64.tar.gz" - -jdkAvailable=$(java -version 2>&1 | awk 'NR==1{gsub(/"/,"");print $3}') -result=$(echo $jdkAvailable | grep $JDK_VERSION) -if [[ "$result" != "" ]]; then - echo "JDK installed.............................." -else - echo "JDK not installed.............................." - echo "JDK environment already sets" - pid="sed -i '/export JAVA_HOME/d' /etc/profile" - eval $pid - pid="sed -i '/export CLASSPATH/d' /etc/profile" - eval $pid - pid="sed -i '/source \/etc\/profile/d' /root/.bash_profile" - eval $pid - pid="sed -i '/source \/etc\/profile/d' /root/.bashrc" - eval $pid - pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bash_profile" - eval $pid - pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bashrc" - eval $pid - echo "Prepare to Install JDK..." - sleep 2s - mkdir -p ${JDK_FOLDER_PATH} - tar -zxvf ${PACKAGES_PATH}/${JDK_TAR_NAME} -C ${JDK_FOLDER_PATH} - JAVA_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}" - JRE_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}/jre" - JAVA_SOURCE_ENV="source /etc/profile" - echo "export JAVA_HOME=$JAVA_HOME" >>/etc/profile - echo "export JRE_HOME=$JRE_HOME" >>/etc/profile - echo "export CLASSPATH=.:\$JRE_HOME/lib/rt.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar" >>/etc/profile - echo "export PATH=\$PATH:\$JAVA_HOME/bin" >>/etc/profile - echo ${JAVA_SOURCE_ENV} >>~/.bash_profile - echo ${JAVA_SOURCE_ENV} >>~/.bashrc - echo "Prepare to config BCPROV..." - JAVA_SECURITY_DIR="${JAVA_HOME}/jre/lib/security/java.security" - JAVA_BCPROV_DIR="${JAVA_HOME}/jre/lib/ext/" - JAVA_BCPROV_JAR="${PACKAGES_PATH}/bcprov-jdk15on-1.68.jar" - - JAVA_SECURITY_ARGS_ARR[0]="security.provider.1=sun.security.provider.Sun" - JAVA_SECURITY_ARGS_ARR[1]="security.provider.2=sun.security.rsa.SunRsaSign" - JAVA_SECURITY_ARGS_ARR[2]="security.provider.3=com.sun.net.ssl.internal.ssl.Provider" - JAVA_SECURITY_ARGS_ARR[3]="security.provider.4=com.sun.crypto.provider.SunJCE" - JAVA_SECURITY_ARGS_ARR[4]="security.provider.5=sun.security.jgss.SunProvider" - JAVA_SECURITY_ARGS_ARR[5]="security.provider.6=com.sun.security.sasl.Provider" - JAVA_SECURITY_ARGS_ARR[6]="security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI" - JAVA_SECURITY_ARGS_ARR[7]="security.provider.8=sun.security.smartcardio.SunPCSC" - JAVA_SECURITY_ARGS_ARR[8]="security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider" - - for element in ${JAVA_SECURITY_ARGS_ARR[@]}; do - JAVA_SECURITY_ARGS="${JAVA_SECURITY_ARGS}${element}\n" - done - - echo -e ${JAVA_SECURITY_ARGS} >>${JAVA_SECURITY_DIR} - cp -a ${JAVA_BCPROV_JAR} ${JAVA_BCPROV_DIR} - - echo "BCPROV Installed." - - echo "If you need to effect the environment variable in the current session, do it manually: " - source ${BASH_PROFILE_PATH} - source ${BASHRC_PATH} - source ${ETC_PROFILE_PATH} - jdk2=$(grep -n "export JAVA_HOME=.*" /home/hadoop/.bash_profile | cut -f1 -d':') - if [ -n "$jdk2" ]; then - echo "JDK HADOOP environment exists" - else - echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bash_profile - echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bashrc - echo "JDK HADOOP environment sets successfully" - fi - echo "JDK install successfully" - source /etc/profile -fi -echo "INIT-init-jdk.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-krb5-devel.sh b/datasophon-init/bin/init-krb5-devel.sh deleted file mode 100644 index 77826bf4..00000000 --- a/datasophon-init/bin/init-krb5-devel.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -echo "${PACKAGES_PATH}" -KRB5_FOLDER_NAME=krb5-devel -KRB5_TAR_NAME=krb5-devel.tar.gz -rpm -qa | grep krb5-devel -if [ "$?" == "0" ]; then -echo "rpm -qa | grep krb5-devel exists" -else - yum -y install krb5-devel - rpm -qa | grep krb5-devel - if [ "$?" == "0" ]; then - echo "krb5-devel install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-libxslt-devel.sh b/datasophon-init/bin/init-libxslt-devel.sh deleted file mode 100644 index c4b57dcf..00000000 --- a/datasophon-init/bin/init-libxslt-devel.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -rpm -qa | grep libxslt-devel -if [ "$?" == "0" ]; then -echo "libxslt-devel exists" -else - yum -y install libxslt-devel - rpm -qa | grep libxslt-devel - if [ "$?" == "0" ]; then - echo "libxslt_devel install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-mysql-8.sh b/datasophon-init/bin/init-mysql-8.sh deleted file mode 100644 index 20410214..00000000 --- a/datasophon-init/bin/init-mysql-8.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -num1="$1" -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ]; then - BASE_DIR=$(dirname $(readlink $0)) -else - BASE_DIR=$(dirname $0) -fi -BASE_PATH=$( - cd ${BASE_DIR} - pwd -) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -rpm -qa | grep zlib-devel -if [ "$?" == "0" ]; then - echo "zlib-devel exists" -else - yum -y install zlib-devel - rpm -qa | grep zlib-devel - if [ "$?" == "0" ]; then - echo "zlib-devel install successfully" - fi -fi - -rpm -qa | grep bzip2-devel -if [ "$?" == "0" ]; then - echo "bzip2-devel exists" -else - yum -y install bzip2-devel - rpm -qa | grep bzip2-devel - if [ "$?" == "0" ]; then - echo "bzip2-devel install successfully" - fi -fi - -rpm -qa | grep openssl-devel -if [ "$?" == "0" ]; then - echo "openssl-devel exists" -else - yum -y install openssl-devel - rpm -qa | grep openssl-devel - if [ "$?" == "0" ]; then - echo "openssl-devel install successfully" - fi -fi - -rpm -qa | grep ncurses-devel -if [ "$?" == "0" ]; then - echo "ncurses-devel exists" -else - yum -y install ncurses-devel - rpm -qa | grep ncurses-devel - if [ "$?" == "0" ]; then - echo "ncurses-devel install successfully" - fi -fi - -MYSQL_FOLDER_NAME=mysql-community-8.0.28.el8.x86_64 -MYSQL_TAR_NAME=mysql-community-8.0.28.el8.x86_64.tar.gz - -echo "mysql start install mysql-community-8.0.28-1.el8.x86_64........." -tar -zxvf ${PACKAGES_PATH}/${MYSQL_TAR_NAME} -C ${PACKAGES_PATH} -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-common-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-libs-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-devel-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm -rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-server-8.0.28-1.el8.x86_64.rpm - -mysqld --initialize --user=mysql -systemctl start mysqld -systemctl enable mysqld -sleep 2 -echo "${num1}" - -if [ $(systemctl status mysqld | grep running | wc -l) -eq 1 ]; then - echo "mysql在运行" - tmp_passwd=$(grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}') - echo "临时密码:${tmp_passwd}" - #mysql -uroot -p"${tmp_passwd}" --connect-expired-password -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}';" - #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}' PASSWORD EXPIRE NEVER;" - #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '${num1}';" - #mysql -uroot -p"${num1}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;" - #mysql -uroot -p"${num1}" -e "FLUSH PRIVILEGES;" - - /usr/bin/mysqladmin -uroot -p''$tmp_passwd'' password ''$num1'' - mysql -uroot -p''$num1'' -e "update mysql.user set host='%' where user ='root';" - mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" - mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED BY '$num1' PASSWORD EXPIRE NEVER;" - echo "num1:'$num1'" - mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '$num1';" - mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" - - cat >/etc/my.cnf </etc/chrony.conf </etc/chrony.conf </etc/chrony.conf < /etc/yum.repos.d/dataSophon.repo << EOF -[dataSophon-base] -name=dataSophon-base -baseurl=file:///data/private-yum-library/centos/8/x86_64/BaseOS/ -gpgcheck=0 -enable=1 - -[dataSophon-AppStream] -name=dataSophon-AppStream -baseurl=file:///data/private-yum-library/centos/8/x86_64/AppStream/ -gpgcheck=0 -enabled=1 - -[dataSophon-epel] -name=dataSophon-epel -baseurl=file:///data/private-yum-library/epel/8/x86_64/ -enabled=1 -gpgcheck=0 -EOF -yum clean all -yum makecache -echo "init-private-yum-library.sh finished." -echo "Done." - - -cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' -if [ $? -eq 0 ]; then - echo "httpd port modified successfully" >> ${initLogDir}/installSingle_`date +%Y%m%d`.log - systemctl stop httpd - systemctl start httpd - -else -echo "init httpd begin." -yum install httpd -cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' -sed -i 's/Listen 80/Listen 8000/g' /etc/httpd/conf/httpd.conf -systemctl start httpd -systemctl enable httpd -echo "init httpd finished." -fi -ln -s /data/private-yum-library/centos/ /var/www/html/ -ln -s /data/private-yum-library/epel/ /var/www/html/ -sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts -modifyYumHosts(){ -echo "#modify yum mapping hosts start" >> /etc/hosts -echo "${ip} yum.dataSophon.cn" >> /etc/hosts -echo "#modify yum mapping hosts end" >> /etc/hosts -source /etc/profile -source /root/.bash_profile -} -modifyYumHosts - -rm /etc/yum.repos.d/dataSophon.repo - -cat > /etc/yum.repos.d/dataSophon.repo << EOF -[dataSophon-base] -name=dataSophon-base -baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/BaseOS/ -gpgcheck=0 -enable=1 - -[dataSophon-AppStream] -name=dataSophon-AppStream -baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/AppStream/ -gpgcheck=0 -enabled=1 - -[dataSophon-epel] -name=dataSophon-epel -baseurl=http://yum.dataSophon.cn:8000/epel/8/x86_64/ -enabled=1 -gpgcheck=0 -EOF -yum clean all -yum makecache -echo "init-private-yum-library.sh finished." -echo "Done." - diff --git a/datasophon-init/bin/init-psmisc.sh b/datasophon-init/bin/init-psmisc.sh deleted file mode 100644 index 930587bc..00000000 --- a/datasophon-init/bin/init-psmisc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -rpm -qa | grep psmisc -if [ "$?" == "0" ]; then -echo "psmisc exists" -else - yum -y install psmisc - rpm -qa | grep psmisc - if [ "$?" == "0" ]; then - echo "psmisc install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-pssh.sh b/datasophon-init/bin/init-pssh.sh deleted file mode 100644 index 9f44c07f..00000000 --- a/datasophon-init/bin/init-pssh.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -PSSH_FOLDER_NAME=pssh - -PSSH_TAR_NAME=pssh.tar.gz -rpm -qa | grep pssh -if [ "$?" == "0" ]; then -echo "pssh exists" -else - yum -y install pssh - rpm -qa | grep pssh - if [ "$?" == "0" ]; then - echo "pssh install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-pytest_runner.sh b/datasophon-init/bin/init-pytest_runner.sh deleted file mode 100644 index 085bc959..00000000 --- a/datasophon-init/bin/init-pytest_runner.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -PYTEST_RUNNER_FOLDER_NAME=pytest_runner-5.2-py2.py3-none-any.whl - pip3 install ${PACKAGES_PATH}/${PYTEST_RUNNER_FOLDER_NAME} - echo "pytest_runner install successfully" - - diff --git a/datasophon-init/bin/init-python-rpm-macros.sh b/datasophon-init/bin/init-python-rpm-macros.sh deleted file mode 100644 index 4986d084..00000000 --- a/datasophon-init/bin/init-python-rpm-macros.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -MACROS_FOLDER_NAME=python-rpm-macros - -MACROS_TAR_NAME=python-rpm-macros.tar.gz -rpm -qa | grep python-rpm-macros -if [ "$?" == "0" ]; then -echo "python-rpm-macros exists" -else - yum -y install python-rpm-macros - rpm -qa | grep python-rpm-macros - if [ "$?" == "0" ]; then - echo "python-rpm-macros install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-python-srpm-macros.sh b/datasophon-init/bin/init-python-srpm-macros.sh deleted file mode 100644 index 1146808d..00000000 --- a/datasophon-init/bin/init-python-srpm-macros.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -SRPM_FOLDER_NAME=python-srpm-macros - -SRPM_TAR_NAME=python-srpm-macros.tar.gz -rpm -qa | grep python-srpm-macros -if [ "$?" == "0" ]; then -echo "python-srpm-macros exists" -else - yum -y install python-srpm-macros - rpm -qa | grep python-srpm-macros - if [ "$?" == "0" ]; then - echo "python-srpm-macros install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-python2-rpm-macros.sh b/datasophon-init/bin/init-python2-rpm-macros.sh deleted file mode 100644 index 46202c66..00000000 --- a/datasophon-init/bin/init-python2-rpm-macros.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -MACROS2_FOLDER_NAME=python2-rpm-macros - -MACROS2_TAR_NAME=python2-rpm-macros.tar.gz -rpm -qa | grep python2-rpm-macros -if [ "$?" == "0" ]; then -echo "python2-rpm-macros exists" -else - yum -y install python2-rpm-macros - rpm -qa | grep python-rpm-macros - if [ "$?" == "0" ]; then - echo "python2-rpm-macros install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-python36-devel.sh b/datasophon-init/bin/init-python36-devel.sh deleted file mode 100644 index 7fb0b7f3..00000000 --- a/datasophon-init/bin/init-python36-devel.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -PYTHON36_DEVEL_FOLDER_NAME=python36-devel - -PYTHON36_DEVEL_TAR_NAME=python36-devel.tar.gz -rpm -qa | grep python3 -if [ "$?" == "0" ]; then -echo "rpm -qa | grep python36-devel exists" -else - yum -y install python36-devel - rpm -qa | grep python3 - if [ "$?" == "0" ]; then - echo "python36-devel install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-redhat-lsb.sh b/datasophon-init/bin/init-redhat-lsb.sh deleted file mode 100644 index 0f7b5db4..00000000 --- a/datasophon-init/bin/init-redhat-lsb.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -REDHAT_LSB_FOLDER_NAME=redhat-lsb - -REDHAT_LSB_TAR_NAME=redhat-lsb.tar.gz -rpm -qa | grep redhat-lsb -if [ "$?" == "0" ]; then -echo "redhat-lsb exists" -else - yum -y install redhat-lsb* - rpm -qa | grep redhat-lsb* - if [ "$?" == "0" ]; then - echo "redhat-lsb install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-six.sh b/datasophon-init/bin/init-six.sh deleted file mode 100644 index 8fbda174..00000000 --- a/datasophon-init/bin/init-six.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -echo "${PACKAGES_PATH}" -SIX_FOLDER_NAME=six-1.15.0 -SIX_TAR_NAME=six-1.15.0.tar.gz - tar -zxvf ${PACKAGES_PATH}/${SIX_TAR_NAME} -C ${PACKAGES_PATH} - cd ${PACKAGES_PATH}/${SIX_FOLDER_NAME} - python3 setup.py install - cd ${INIT_BIN_PATH} - echo "six-1.15.0 install successfully" - - diff --git a/datasophon-init/bin/init-sourceSSHHostname.sh b/datasophon-init/bin/init-sourceSSHHostname.sh deleted file mode 100644 index 63e32d48..00000000 --- a/datasophon-init/bin/init-sourceSSHHostname.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo "StrictHostKeyChecking no" >~/.ssh/config diff --git a/datasophon-init/bin/init-ssh-copy-key.sh b/datasophon-init/bin/init-ssh-copy-key.sh deleted file mode 100644 index 1edbb709..00000000 --- a/datasophon-init/bin/init-ssh-copy-key.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# example: sh init-ssh-gen-key.sh - -filePath=$1 -INITAllHostNums=$2 -port=$3 -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -removeSSHAsk() { - sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config - sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config - sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config -} -copyKeyConfig(){ -# authorized_keys -# known_hosts -# scp -r /root/.ssh/ root@192.168.216.20:/root/ - -user=root -sshDir="/${user}/.ssh" - -function prop { - [ -f "${filePath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${filePath} | cut -d'=' -f2 -} -for ((i=1; i<=${INITAllHostNums}; i++)) -do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - echo $ip - echo $pwd - echo $port -/usr/bin/expect <<-EOF -set timeout -1 -spawn scp -P${port} -r $sshDir/ $user@$ip:/${user}/ -expect { - "yes/no" { send "yes\r"; exp_continue } - "password:" { send "$pwd\r" } - } - expect eof - EOF -done -echo -e "\nFinish copy ssh config." -} - -removeSSHAsk -copyKeyConfig - -echo "init-ssh-copy-key.sh finished." - - -echo "repai_init-ssh.sh finished." -echo "Done." - - - - diff --git a/datasophon-init/bin/init-ssh-gen-key.sh b/datasophon-init/bin/init-ssh-gen-key.sh deleted file mode 100644 index 8c7a1019..00000000 --- a/datasophon-init/bin/init-ssh-gen-key.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# example: sh init-ssh-gen-key.sh - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -sh ${INIT_BIN_PATH}/init-sshpackage.sh -sh ${INIT_BIN_PATH}/init-expect.sh - -removeSSHAsk() { - echo "begin removeSSHAsk....." - sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config - sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config - sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config -} - - -keygenConfig(){ -# ssh-keygen -t rsa -sshPath=/root/.ssh -if [ ! -r "${sshPath}/id_rsa.pub" ]; then -echo "id_rsa.pub nonexistent creating......" -/usr/bin/expect <<-EOF -set timeout 10 -spawn ssh-keygen -t rsa -expect { - "Enter file in which to save the key (/root/.ssh/id_rsa): " { send "\r"; exp_continue } - "Overwrite (y/n)? " { send "y\r"; exp_continue } - "Enter passphrase (empty for no passphrase): " { send "\r"; exp_continue } - "Enter same passphrase again: " { send "\r" } - } - expect eof - EOF - -wait -echo "Finish ssh-keygen -t rsa." -else -echo "id_rsa.pub exists" -fi -} - -configAuthorizedKeys(){ - user=root - sshDir="/${user}/.ssh" - cat ${sshDir}/id_rsa.pub >> ${sshDir}/authorized_keys -} -removeSSHAsk -keygenConfig -configAuthorizedKeys - -echo "init-ssh-gen-key.sh finished." -echo "Done." - - - - diff --git a/datasophon-init/bin/init-ssh-hadoop.sh b/datasophon-init/bin/init-ssh-hadoop.sh deleted file mode 100644 index 328723ad..00000000 --- a/datasophon-init/bin/init-ssh-hadoop.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# example: sh init-ssh-gen-key.sh - -filePath=$1 -initAllHostNums="$2" -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -DATASOPHON_PATH=$(dirname "${INIT_PATH}") -echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - - sshHadoopDir=/home/hadoop/.ssh/ - rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt - bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${filePath} ${initAllHostNums} - bash ${INIT_BIN_PATH}/init-pssh.sh - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" - pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-add-hadoop-user.sh - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p /home/hadoop/" - pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r /root/.ssh /home/hadoop/ - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "chown hadoop:hadoop -R '${sshHadoopDir}'" -echo "repair init-ssh-hadoop.sh finished." -echo "Done." - - - - diff --git a/datasophon-init/bin/init-sshpackage.sh b/datasophon-init/bin/init-sshpackage.sh deleted file mode 100644 index 70aa693c..00000000 --- a/datasophon-init/bin/init-sshpackage.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - -SSH_FOLDER_NAME=ssh -SSH_TAR_NAME=ssh.tar.gz - -ssh_rpm=`rpm -qa | grep openssh` -if [[ "$?" == "0" ]]; then - echo "ssh exists" - else - yum -y install openssh - echo "ssh-install finished." -fi - -echo "init-sshpackage.sh finished." -echo "Done." - - diff --git a/datasophon-init/bin/init-sshpass.sh b/datasophon-init/bin/init-sshpass.sh deleted file mode 100644 index 03d6c926..00000000 --- a/datasophon-init/bin/init-sshpass.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -echo "${PACKAGES_PATH}" -SSHPASS_FOLDER_NAME=sshpass - -SSHPASS_TAR_NAME=sshpass.tar.gz -rpm -qa | grep sshpass -if [ "$?" == "0" ]; then -echo "sshpass exists" -else - yum -y install sshpass - rpm -qa | grep sshpass - if [ "$?" == "0" ]; then - echo "init sshpass install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-stop-firewall.sh b/datasophon-init/bin/init-stop-firewall.sh deleted file mode 100644 index 03777a2c..00000000 --- a/datasophon-init/bin/init-stop-firewall.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# example: sh init-stop-firewall.sh -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -DATASOPHON_PATH=$(dirname "${INIT_PATH}") -echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -FIREWALL_STATUS=`firewall-cmd --state` -if [[ ${FIREWALL_STATUS} == "running" ]] -then - echo "Closing firewall." - systemctl stop firewalld.service - systemctl disable firewalld.service - echo "Firewall closed." -else - echo "Firewall closed." -fi -echo "init-stop-firewall.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-stop-selinux.sh b/datasophon-init/bin/init-stop-selinux.sh deleted file mode 100644 index f8b7d411..00000000 --- a/datasophon-init/bin/init-stop-selinux.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# example: sh init-stop-firewall.sh -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" - - -SELINUX_STATUS=`getenforce` -SELINUX_CONFIG_PATH="/etc/selinux/config" -if [[ ${SELINUX_STATUS} == "Enforcing" ]] -then - echo "Closing SELINUX." - setenforce 0 - echo "Disabling SELINUX." - sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" ${SELINUX_CONFIG_PATH} - echo "SELINUX closed." -else - echo "SELINUX closed." -fi - -echo "init-stop-selinux.sh finished." -echo "Done." diff --git a/datasophon-init/bin/init-system-conf.sh b/datasophon-init/bin/init-system-conf.sh deleted file mode 100644 index 7688c6ae..00000000 --- a/datasophon-init/bin/init-system-conf.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# example: sh init-system-conf.sh -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - - -# vi /etc/systemd/system.conf -# DefaultLimitNOFILE=102400000 -# DefaultLimitNPROC=102400000 -sed -i '/DefaultLimitNOFILE=/d' /etc/systemd/system.conf -sed -i '/DefaultLimitNPROC=/d' /etc/systemd/system.conf - -cat << EOF >> /etc/systemd/system.conf -DefaultLimitNOFILE=1024000 -DefaultLimitNPROC=1024000 -EOF - -# vi /etc/security/limits.conf -#* soft fsize unlimited -#* hard fsize unlimited -#* soft cpu unlimited -#* hard cpu unlimited -#* soft as unlimited -#* hard as unlimited -#* soft nofile 10240000 -#* hard nofile 10240000 -#* soft nproc 10240000 -#* hard nproc 10240000 - -sed -i '/* soft fsize/d' /etc/security/limits.conf -sed -i '/* hard fsize/d' /etc/security/limits.conf -sed -i '/* soft cpu/d' /etc/security/limits.conf -sed -i '/* hard cpu/d' /etc/security/limits.conf -sed -i '/* soft as/d' /etc/security/limits.conf -sed -i '/* hard as/d' /etc/security/limits.conf -sed -i '/* soft nofile/d' /etc/security/limits.conf -sed -i '/* hard nofile/d' /etc/security/limits.conf -sed -i '/* soft nproc/d' /etc/security/limits.conf -sed -i '/* hard nproc/d' /etc/security/limits.conf - -cat << EOF >> /etc/security/limits.conf -* soft fsize unlimited -* hard fsize unlimited -* soft cpu unlimited -* hard cpu unlimited -* soft as unlimited -* hard as unlimited -* soft nofile 1048576 -* hard nofile 1048576 -* soft nproc unlimited -* hard nproc unlimited -EOF - -# vi /etc/security/limits.d/20-nproc.conf -#* soft nproc 102400000 -#root soft nproc unlimited - -cat << EOF > /etc/security/limits.d/20-nproc.conf -# Default limit for number of user's processes to prevent -# accidental fork bombs. -# See rhbz #432903 for reasoning. - -* soft nproc unlimited -root soft nproc unlimited -EOF - -echo "kernel.pid_max=1000000" >> /etc/sysctl.conf -sysctl -p - -echo "init-system-conf finished." -echo "Done." diff --git a/datasophon-init/bin/init-test.sh b/datasophon-init/bin/init-test.sh deleted file mode 100644 index d01dcb98..00000000 --- a/datasophon-init/bin/init-test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -num1="$1" -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ]; then - BASE_DIR=$(dirname $(readlink $0)) -else - BASE_DIR=$(dirname $0) -fi -BASE_PATH=$( - cd ${BASE_DIR} - pwd -) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -INIT_SQL_PATH=${INIT_PATH}/sql -echo "INIT_SQL_PATH: ${INIT_SQL_PATH}" -#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DDL.sql; -#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DML.sql; - -mysql -udatasophon -p'datasophon' <> /usr/lib/tmpfiles.d/tmp.conf - echo "x /tmp/hsperfdata*/*" >> /usr/lib/tmpfiles.d/tmp.conf - echo "X /tmp/hsperfdata*" >> /usr/lib/tmpfiles.d/tmp.conf -} - -modifyHostname - -echo "init-tmp_pid.sh finished." diff --git a/datasophon-init/bin/init-websocket_client.sh b/datasophon-init/bin/init-websocket_client.sh deleted file mode 100644 index dccbb7d2..00000000 --- a/datasophon-init/bin/init-websocket_client.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -echo "${PACKAGES_PATH}" -WEBSOCKET_CLIENT_FOLDER_NAME=websocket_client-0.54.0 -WEBSOCKET_CLIENT_TAR_NAME=websocket_client-0.54.0.tar.gz - tar -zxvf ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_TAR_NAME} -C ${PACKAGES_PATH} - cd ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_FOLDER_NAME} - python3 setup.py install - cd ${INIT_PATH} - echo "websocket_client install successfully" - - diff --git a/datasophon-init/bin/init-xdg-utils.sh b/datasophon-init/bin/init-xdg-utils.sh deleted file mode 100644 index a8a2fb19..00000000 --- a/datasophon-init/bin/init-xdg-utils.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -XDG_FOLDER_NAME=xdg-utils -XDG_TAR_NAME=xdg-utils.tar.gz -rpm -qa | grep xdg-utils -if [ "$?" == "0" ]; then -echo "rpm -qa | grep xdg-utils exists" -else - yum -y install xdg-utils - rpm -qa | grep xdg-utils - if [ "$?" == "0" ]; then - echo "xdg-utils install successfully" - fi -fi - diff --git a/datasophon-init/bin/init-yum-hosts-mapping.sh b/datasophon-init/bin/init-yum-hosts-mapping.sh deleted file mode 100644 index b000bef2..00000000 --- a/datasophon-init/bin/init-yum-hosts-mapping.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -ip="$1" -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -if [ -L $0 ] -then - BASE_DIR=`dirname $(readlink $0)` -else - BASE_DIR=`dirname $0` -fi -BASE_PATH=$(cd ${BASE_DIR}; pwd) -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" - -rm -rf /etc/yum.repos.d/backup -mkdir -p /etc/yum.repos.d/backup -mv `find /etc/yum.repos.d/ -name "*.repo"` /etc/yum.repos.d/backup - -sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts -modifyYumHosts(){ -echo "#modify yum mapping hosts start" >> /etc/hosts -echo "${ip} yum.dataSophon.cn" >> /etc/hosts -echo "#modify yum mapping hosts end" >> /etc/hosts -} -modifyYumHosts -cat > /etc/yum.repos.d/dataSophon.repo << EOF -[dataSophon-base] -name=dataSophon-base -baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/BaseOS/ -gpgcheck=0 -enable=1 - -[dataSophon-AppStream] -name=dataSophon-AppStream -baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/AppStream/ -gpgcheck=0 -enabled=1 - -[dataSophon-epel] -name=dataSophon-epel -baseurl=http://yum.dataSophon.cn:8000/epel/8/x86_64/ -enabled=1 -gpgcheck=0 -EOF - -yum clean all - -yum makecache -echo "init-yum-hosts-mapping.sh finished." -echo "Done." diff --git a/datasophon-init/config/init-host-info-add.properties b/datasophon-init/config/init-host-info-add.properties deleted file mode 100644 index 290e51b3..00000000 --- a/datasophon-init/config/init-host-info-add.properties +++ /dev/null @@ -1,21 +0,0 @@ -# 1.Please provide the information of added hosts needed to be inited in the format specified below -# 2.dataSophon.ip.i(eg:i=1,2,3.....): -# 3.dataSophon.password.i: -# 4.dataSophon.ssh.port.i: -# 5.dataSophon.ssh.port.hostname.i: -dataSophon.ip.1=127.0.0.1(need to change) -dataSophon.password.1=your-node-root-password(need to change) -dataSophon.ssh.port.1=22 -dataSophon.ssh.port.hostname.1=your-node-hostname(need to change) - -dataSophon.ip.2=127.0.0.1(need to change) -dataSophon.password.2=your-node-root-password(need to change) -dataSophon.ssh.port.2=22 -dataSophon.ssh.port.hostname.2=your-node-hostname(need to change) - - -dataSophon.ip.3=127.0.0.1(need to change) -dataSophon.password.3=your-node-root-password(need to change) -dataSophon.ssh.port.3=22 -dataSophon.ssh.port.hostname.3=your-node-hostname(need to change) - diff --git a/datasophon-init/config/init-host-info.properties b/datasophon-init/config/init-host-info.properties deleted file mode 100644 index 676c1f3f..00000000 --- a/datasophon-init/config/init-host-info.properties +++ /dev/null @@ -1,15 +0,0 @@ -# 1.Please provide the information of hosts needed to be inited in the format specified below -# 2.dataSophon.ip.i(eg:i=1,2,3.....): -# 3.dataSophon.password.i: -# 4.dataSophon.ssh.port.i: -# 5.dataSophon.ssh.port.hostname.i: -dataSophon.ip.1=172.31.51.194 -dataSophon.password.1=max123!@# -dataSophon.ssh.port.1=22 -dataSophon.ssh.port.hostname.1=dataSophon0 - -dataSophon.ip.2=172.31.51.191 -dataSophon.password.2=max@123!@# -dataSophon.ssh.port.2=22 -dataSophon.ssh.port.hostname.2=dataSophon1 - diff --git a/datasophon-init/config/init.properties b/datasophon-init/config/init.properties deleted file mode 100644 index 797288ba..00000000 --- a/datasophon-init/config/init.properties +++ /dev/null @@ -1,28 +0,0 @@ -# Set the YUM source host IP -yum.repo.host.ip=172.31.51.194 - -#The Host information for installing the NMAP service -nmap.server.ip=172.31.51.194 -nmap.server.port=22 -nmap.server.password=max123!@# - -# The Host information for installing the NTP service(Master) -ntp.master.ip=172.31.51.194 - -# Install MySQL machine node information -mysql.ip=172.31.51.194 -mysql.host.ssh.port=22 -mysql.host.ssh.password=max123!@# - -# Set the MYSQL database login password -mysql.password=max2022sh - -# The total number of machines needed to be init. -init.host.num=2 - -# The total number of added machines needed to be init. -init.add.host.num=0 - -# Common Settings. -init.log.dir=./logs - diff --git a/datasophon-init/sbin/init.sh b/datasophon-init/sbin/init.sh deleted file mode 100644 index 7ef83418..00000000 --- a/datasophon-init/sbin/init.sh +++ /dev/null @@ -1,786 +0,0 @@ -#!/bin/bash -Action="$1" - -if [ $UID -ne 0 ]; then - echo Non root user. Please run as root. - exit 1 -fi -BASE_DIR=$(dirname $0) - -BASE_PATH=$( - cd ${BASE_DIR} - pwd -) -echo "Bash Path: ${BASE_PATH}" -INIT_PATH=$(dirname "${BASE_PATH}") -echo "INIT_PATH: ${INIT_PATH}" -DATASOPHON_PATH=$(dirname "${INIT_PATH}") -echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" -INIT_BIN_PATH=${INIT_PATH}/bin -echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" -INIT_CONFIG_PATH=${INIT_PATH}/config -echo "INIT_CONFIG_PATH: ${INIT_CONFIG_PATH}" -INIT_SBIN_PATH=${INIT_PATH}/sbin -echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" -PACKAGES_PATH=${INIT_PATH}/packages -echo "PACKAGES_PATH: ${PACKAGES_PATH}" -hostAllInfoPath=${INIT_CONFIG_PATH}/init-host-info.properties -echo "hostAllInfoPath: ${hostAllInfoPath}" -hostSingleInfoPath=${INIT_CONFIG_PATH}/init-host-info-add.properties -echo "hostSingleInfoPath: ${hostSingleInfoPath}" -FilePath=${INIT_CONFIG_PATH}/init.properties -echo "FilePath: ${FilePath}" -JDK_PATH=/opt/module -smallTimeOut=300 -middleTimeOut=600 -longTimeOut=1200 - -function prop { - [ -f "$FilePath" ] && grep -P "^\s*[^#]?${1}=.*$" $FilePath | cut -d'=' -f2 -} - -ntpMasterIP=$(prop "ntp.master.ip") -mysqlIP=$(prop "mysql.ip") -mysqlPort=$(prop "mysql.host.ssh.port") -mysqlHostSshPassword=$(prop "mysql.host.ssh.password") -mysqlPassword=$(prop "mysql.password") -nmapServerIp=$(prop "nmap.server.ip") -nmapServerPort=$(prop "nmap.server.port") -nmapServerPassword=$(prop "nmap.server.password") -initLogDir=$(prop "init.log.dir") -yumRepoIp=$(prop "yum.repo.host.ip") -initAllHostNums=$(prop "init.host.num") -initSingleHostNums=$(prop "init.add.host.num") - -echo "yumRepoIp: ${yumRepoIp}" - -initALL() { - function network() { - local timeout=1 - - local target=www.baidu.com - - local ret_code=$(curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1) - - if [ "x$ret_code" = "x200" ]; then - return 1 - else - return 0 - fi - - return 0 - } - - network - - if [ $? -eq 0 ]; then - echo -e "\033[31m 由于机器没有联网,请自行检查设置正确的机器时间! \033[0m" - read -p "Please confirm whether the time displayed by the machine is correct(yes/no):" isCorrect - if [ "$isCorrect" = "yes" ]; then - echo "机器时间设置正常,请进行如下环境初始化操作" - else - echo "机器时间不正确,请设置正确时间后,再进行 DataSophon 初始化环境操作" - exit - fi - else - echo "机器可以联网,无需自行检查系统时间是否正常" - fi - rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt - rm -rf ${INIT_BIN_PATH}/1.txt - rm -rf ${initLogDir}/installAllSuccess_$(date +%Y%m%d).log - - #如果文件不存在 - if [ ! -f "/data/private-yum-library.tar.gz" ]; then - echo "the initial work needn't use the provided YUM" - else - mv /etc/yum.repos.d/backup/* /etc/yum.repos.d - mkdir -p /etc/yum.repos.d/backup - mv $(find /etc/yum.repos.d/ -name "*.repo") /etc/yum.repos.d/backup - bash ${INIT_BIN_PATH}/init-stop-firewall.sh - bash ${INIT_BIN_PATH}/init-stop-selinux.sh - bash ${INIT_BIN_PATH}/init-private-yum-library.sh ${yumRepoIp} - fi - secretFreeAllLogin - checkSecretFreeAllLogin - - #close all Firewall - echo "closeAllFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log - echo "closeAllFirewall end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log - checkCloseAllFirewall - - #close all selinux - echo "closeAllSelinux start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-selinux.sh >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log - echo "closeAllSelinux end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log - - #close all Swap - echo "closeAllSwap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-swap.sh >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log - echo "closeAllSwap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log - checkcloseAllSwap - - #configure all slave node yum source - if [ ! -f "/data/private-yum-library.tar.gz" ]; then - echo "the initial work needn't use the provided YUM" - else - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-yum-hosts-mapping.sh ${yumRepoIp} >>${initLogDir}/modifyYumRepo_$(date +%Y%m%d).log - fi - - #optimiz system conf - echo "modifyAllSystemConf start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-system-conf.sh >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log - echo "modifyAllSystemConf end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log - - #Configure all hostname - setAllHostname - checkHostName - - #Configure all hosts - echo "modifyAllhostRelation start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-allhosts.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log - echo "modifyAllhostRelation end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-sourceSSHHostname.sh - installServerNmap - - #Configure NTP - initAllNtpChronyService - checkNtpChronyService - - #Configurelibxslt_devel - echo "installAlllibxsltdevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-libxslt-devel.sh >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log - echo "installAlllibxsltdevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log - checkLibxsltDevel - #Configure Psmisc - echo "installAllpsmisc start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-psmisc.sh >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log - echo "installAllpsmisc end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log - checkPsmisc - - echo "installAllPerlJSON start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-perl-JSON.sh >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log - echo "installAllPerlJSON end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log - - #Configure Mysql and DataSophon data - initMysqlDataSophon - initMysqlDevel - - #Configure Disable transparent-hugepage - echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-transparent-hugepage.sh >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log - echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log - checkTransparentHugepage - - #Configure JDK - echo "installAllJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - echo "installAllJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - checkJDK - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-tmp_pid.sh - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-xdg-utils.sh >>${initLogDir}/installXdg_$(date +%Y%m%d).log - checkXdg - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${middleTimeOut} -i bash ${INIT_BIN_PATH}/init-redhat-lsb.sh >>${initLogDir}/installRedhatLsb_$(date +%Y%m%d).log - checkRedhatLsb - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python2-rpm-macros.sh >>${initLogDir}/installPython2Macros_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-srpm-macros.sh >>${initLogDir}/installPythonSrpmMacros_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-rpm-macros.sh >>${initLogDir}/installPythonMacros_$(date +%Y%m%d).log - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-init-python-devel.sh >> ${initLogDir}/installPythonDevel_`date +%Y%m%d`.log - #checkPythonDevel - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cyrus-sasl.sh >>${initLogDir}/installCyrusSasl_$(date +%Y%m%d).log - checkCyrusSasl - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python36-devel.sh >>${initLogDir}/installPython36Devel_$(date +%Y%m%d).log - checkPython36Devel - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-gcc-c++.sh >>${initLogDir}/installGccC++_$(date +%Y%m%d).log - checkGccC - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-Cython.sh >>${initLogDir}/installCython_$(date +%Y%m%d).log - checkCython - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-six.sh >>${initLogDir}/installSix_$(date +%Y%m%d).log - checkSix - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-websocket_client.sh >>${initLogDir}/installWebsocketClient_$(date +%Y%m%d).log - checkWebsocketClient - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ecdsa.sh >>${initLogDir}/installEcdsa_$(date +%Y%m%d).log - checkecdsa - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-pytest_runner.sh >>${initLogDir}/installPytestRunner_$(date +%Y%m%d).log - checkPytestRunner - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-krb5-devel.sh >>${initLogDir}/installKrb5Devel_$(date +%Y%m%d).log - checkKrb5Devel - - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp_enable.sh >>${initLogDir}/installSingleNtpEnable_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-chmod-dev-null.sh >>${initLogDir}/chmodDevNull_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cleanBuff-async.sh >>${initLogDir}/cleanBuff_$(date +%Y%m%d).log - rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt - rm -rf ${INIT_BIN_PATH}/1.txt - initsource - source /etc/profile - source /root/.bash_profile - echo "The DataSophon deployment environment of added nodes has been inited successfully . Please proceed to the next step" >>${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log - cat ${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log - -} - -initsource() { - source /etc/profile - source /root/.bash_profile - echo $(java -version) -} - -testFun() { - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log -} - -#免密登录 -secretFreeAllLogin() { - echo "secretFreeAllLogin........................" - mkdir -p ${initLogDir} - echo "secretFreeAllLogin start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - rpm -qa | grep openssh - if [[ "$?" == "0" ]]; then - echo "ssh exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - echo "${INIT_BIN_PATH}" - else - bash ${INIT_BIN_PATH}/init-sshpackage.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - fi - rpm -qa | grep sshpass - if [[ "$?" == "0" ]]; then - echo "sshpass exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - else - bash ${INIT_BIN_PATH}/init-sshpass.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - fi - rpm -qa | grep expect-5.45 - if [[ "$?" == "0" ]]; then - echo "expect exists" - else - bash ${INIT_BIN_PATH}/init-expect.sh - fi - bash ${INIT_BIN_PATH}/init-ssh-gen-key.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostAllInfoPath} ${initAllHostNums} ${nmapServerPort} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - echo "secretFreeAllLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log -} - -#检查免密登录 -checkSecretFreeAllLogin() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - echo "${pwd}" - echo "${hostAllInfoPath}" - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'ls' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: All free login links have been init successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查所有的swap是否关闭 -checkcloseAllSwap() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /etc/sysctl.conf | grep vm.swappiness=0' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: All closing swap links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查所有的Firewall是否关闭 -checkCloseAllFirewall() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'firewall-cmd --state' >${initLogDir}/checkCloseAllFirewall.log - cat ${initLogDir}/checkCloseAllFirewall.log | grep running - if [ $? -eq 0 ]; then - echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - else - echo "${ip} close firewall successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - fi - done - echo "SUCCESS: All closing firewall links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#设置所有的的hostname -setAllHostname() { - echo "setAllHostname start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - hostname=$(prop "dataSophon.ssh.port.hostname.${i}") - - echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-hostname.sh ${hostname} >${initLogDir}/setAllHostname_$(date +%Y%m%d).log - done - echo "setAllHostname end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log -} - -#检查设置所有的的hostname -checkHostName() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # hostname - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'hostname' >${initLogDir}/checkHostName.log - cat ${initLogDir}/checkHostName.log | grep "${hostname}" - if [ $? -eq 0 ]; then - echo "${ip} set hostname successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: set hostname links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#安装nmap -installServerNmap() { - echo "installServerNmap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log - echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log - sshpass -p'${nmapServerPassword}' ssh -P${nmapServerPort} -o StrictHostKeyChecking=no root@${nmapServerIp} bash ${INIT_BIN_PATH}/init-nmap.sh >${initLogDir}/installServerNmap_$(date +%Y%m%d).log - echo "installServerNmap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log -} - -#初始化配置安装Ntp服务 -initAllNtpChronyService() { - echo "initAllNtpChronyService start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - if [ "${ntpMasterIP}" = "${ip}" ]; then - echo "masterntp" - echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-server.sh >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log - else - echo "slaventp" - echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-slave.sh ${ntpMasterIP} >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log - fi - done - echo "initAllNtpChronyService end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log -} - -#检查配置安装的Ntp服务 -checkNtpChronyService() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep chrony-' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set ntp Chrony have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装的libxslt-devel -checkLibxsltDevel() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep libxslt-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set libxslt devel have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装的Psmisc -checkPsmisc() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep psmisc' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set psmisc have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#配置安装mysql8以及初始化DataSophon数据库 -initMysqlDataSophon() { - echo "initMysqlDataSophon start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log - echo "${mysqlIP}" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log - sshpass -p'${mysqlHostSshPassword}' ssh -P${mysqlPort} -o StrictHostKeyChecking=no root@${mysqlIP} bash ${INIT_BIN_PATH}/init-mysql-datasophon.sh $mysqlPassword >${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log - echo "initMysqlDataSophon end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log -} - -#配置安装mysql-devel -initMysqlDevel() { - rm -rf ${INIT_BIN_PATH}/m.txt - echo "initMysqlDevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - - if [ "${mysqlIP}" = "${ip}" ]; then - echo "already install mysql" - else - echo -e "root@${ip}:${port}" >>${INIT_BIN_PATH}/m.txt - fi - done - echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-devel.sh >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log - #pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-client.sh >> ${initLogDir}/initMysqlDevel_`date +%Y%m%d`.log - rm -rf ${INIT_BIN_PATH}/m.txt - echo "initMysqlDevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log -} - -#检查配置配置安装Cython -checkCython() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep Cython' >${initLogDir}/checkCython.log - cat ${initLogDir}/checkCython.log | grep Cython - if [ $? -eq 0 ]; then - echo "${ip} set Cython successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set Cython links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} -#检查配置配置安装Six -checkSix() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep six' >${initLogDir}/checkSix.log - cat ${initLogDir}/checkSix.log | grep six - if [ $? -eq 0 ]; then - echo "${ip} set Six successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set Six links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装WebsocketClient -checkWebsocketClient() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep websocket-client' >${initLogDir}/checkWebsocketClient.log - cat ${initLogDir}/checkWebsocketClient.log | grep websocket-client - if [ $? -eq 0 ]; then - echo "${ip} set websocket-client successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set websocket-client links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#配置禁止透明大页 -checkTransparentHugepage() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep [never]' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: All transparent_hugepage links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装的jdk环境 -checkJDK() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'source /etc/profile ; java -version' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set JDK links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装的xdg-utils -checkXdg() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep xdg-utils' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set xdg-utils links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -#检查配置安装的redhat-lsb -checkRedhatLsb() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep redhat-lsb' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set redhat-lsb links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -checkecdsa() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep ecdsa' >${initLogDir}/checkecdsa.log - cat ${initLogDir}/checkecdsa.log | grep ecdsa - if [ $? -eq 0 ]; then - echo "${ip} set ecdsa successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set ecdsa links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -checkPytestRunner() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep pytest-runner' >${initLogDir}/checkPytestRunner.log - cat ${initLogDir}/checkPytestRunner.log | grep pytest-runner - if [ $? -eq 0 ]; then - echo "${ip} set pytest-runner successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set pytest-runner links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -checkKrb5Devel() { - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - function prop { - [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 - } - for ((i = 1; i <= ${initAllHostNums}; i++)); do - ip=$(prop "dataSophon.ip.${i}") #ip - pwd=$(prop "dataSophon.password.${i}") # password - port=$(prop "dataSophon.ssh.port.${i}") # port - sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep krb5-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log - else - echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log - echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log - cat ${initLogDir}/installAllError_$(date +%Y%m%d).log - rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log - exit - fi - done - echo "SUCCESS: Set krb5-devel links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log -} - -if [ "$Action" = "initAll" ]; then - initALL - echo "initALL....................." -fi -if [ "$Action" = "secretFreeAllLogin" ]; then - secretFreeAllLogin -fi -if [ "$Action" = "checkcloseAllSwap" ]; then - checkcloseAllSwap -fi - -if [ "$Action" = "testFun" ]; then - testFun -fi diff --git a/website/static/img/Initialization-process.png b/website/static/img/Initialization-process.png new file mode 100644 index 0000000000000000000000000000000000000000..c5dcdc2bc3439eda556ed4651336d2f575083624 GIT binary patch literal 30914 zcmeFZRa6`7x-LqgxEBZ%m$qoIqQzRIxTm-lXmNK46fF?6#ogWA-HN-r1*fRdqF_MtyeeC^$l@uhgF-S2G5D>7XrNmX>&u0h-Nc3nZ@Y8b# z+#Cc1Y6NNV4Es!(MxVS_rHet9ey~xuyXQj z6HZoicpOSj;6G1=CM0YoL_Iy8JRRd9tm(a-z{euAHQvgdL_|=Mq8%O=aiT+b@A-pt z;K@#Q4*}u+1GO;%3xX(0JL2CC3Y~Gfq;8ry4wI)Txn76GG67M#=67w9TL>RbF#{d= zMOc*9*&XxP$?Hf_Pm(6)*vRWw9Z`&f(yx=gXl@Cu79=ylWMdQ-UG1_|b1QGWBkF7E zMx99)rxgn4nLf_RZ5+Z&Q{tf>dT8bv=D+gZJr&14 z8Kl2Ux5}isU`s075R4%wiZ>MtBilGkPgcD&5l?IS`qU(c{aWa5<_!&{w0XlvQG-|F zaw)^MOc80NgY0CO;=?IiC4yFbc3gv?0YJWcY~~U~Fr_*<_0H|U|BUu{CgJDR%&Z_$ zYR=Z2Xd~ZAUO@#|j`=BbRTvG=o;=j=69n{5E5mWOUZ9=m8*16r4wI-1?}v~OD$uhX zX$?-@_&lP4)&7>wEhy)4*_-J)@$=tHM6gcgs8}P$InbBXaFLnqbn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FKSgDMAQ7calC;^Mb3X0zf zlZ;9_b!B`gPG<)1&#nd>+2IzCW`dWpw%=hhuU--7#LHTb#uPnOwK=)zw+C%03Of(! z{8iy)qPO1U;v&OaPHH?2wj;dZJE5ubZ1$GLE*>Q=$PJZ-5ot3}ONsWsC|UhvAEp_x zER7bSy1;E5eZrL7b-*SXjfQ&9eo@SER6+5Q@MiSo!z$`5`|F|kPD0Qt=_peI5-FP8 z)fL|r!`sU$FPaL+#~oq+y&6Yhf%JKWaOcp&E|XT19q)$Va+SxEScZUhp;&u%wa>a5x3`v>cVl#?BLSyo1zGe=tnMgRu}I# zKD;f6pHF;uoJ?6_#A0yeuygnth}z(3+9U1CYa|I|K1K(V5gU$q=^>O#bW)j8KxM)iW8}fmE!BT5haj5i|!EnC$#7YnSyGDAv zS}GrPxTstNwqdQalV#?kZ8Qrbul~$c!dPv(FBn(qFVYAo{0_))5GnQ5BMf7jbE!V2 zoZeY(C?FZbi$Jz3mSt7cLa_r?Yr^3@3ZEFI7XfotM8r7D@^nk;&R59$7kv%-g2`mU z_}18$|Kz*lI;it2S5;9gxSqo40aAq_JrO4)e6`N1kk}FCtloeTW|HoIU6|+g?eCZ8 xP@TB&G~+yu!aV260Lb$lb(HlA>}VRYC><{{iY-QLg|1 literal 0 HcmV?d00001 From a74e8ca3f2823e97a5a706ef780c5fcf0f04af58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Fri, 18 Aug 2023 17:08:45 +0800 Subject: [PATCH 03/11] first commit datasophon-init --- datasophon-init/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasophon-init/README.md b/datasophon-init/README.md index a55f2017..37b5a203 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -20,7 +20,7 @@ # dataSophon-init使用说明 前言:当前版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配 1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); -2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压; +2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压;链接:https://pan.baidu.com/s/1iqudVwDgg2x_OO35VLkkSg 提取码:6zrz 3、在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); 离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源,该步骤都是在主节点上操作): 配置脚本为:init-private-yum-library-${initOS}.sh From 159afb60697e7b79b1d747e15f540eedf1ac681f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Fri, 18 Aug 2023 17:14:35 +0800 Subject: [PATCH 04/11] first commit datasophon-init2 --- datasophon-init/bin/init-Cython.sh | 30 + datasophon-init/bin/init-add-hadoop-user.sh | 38 + datasophon-init/bin/init-allhosts.sh | 59 ++ datasophon-init/bin/init-chmod-dev-null.sh | 26 + datasophon-init/bin/init-cleanBuff-async.sh | 34 + datasophon-init/bin/init-cleanBuff.sh | 15 + datasophon-init/bin/init-close-swap.sh | 41 + .../bin/init-close-transparent-hugepage.sh | 27 + datasophon-init/bin/init-cyrus-sasl.sh | 21 + datasophon-init/bin/init-ecdsa.sh | 30 + datasophon-init/bin/init-expect.sh | 44 + datasophon-init/bin/init-gcc-c++.sh | 30 + datasophon-init/bin/init-hostIp-txt.sh | 43 + datasophon-init/bin/init-hostname.sh | 30 + datasophon-init/bin/init-java-policy.sh | 26 + datasophon-init/bin/init-jdk.sh | 108 +++ datasophon-init/bin/init-krb5-devel.sh | 36 + datasophon-init/bin/init-libtool.sh | 28 + datasophon-init/bin/init-libxslt-devel.sh | 27 + datasophon-init/bin/init-mysql-8.sh | 127 +++ datasophon-init/bin/init-mysql-datasophon.sh | 74 ++ datasophon-init/bin/init-mysql-devel.sh | 28 + datasophon-init/bin/init-nmap.sh | 27 + datasophon-init/bin/init-ntp-chrony-server.sh | 105 +++ datasophon-init/bin/init-ntp-chrony-slave.sh | 59 ++ datasophon-init/bin/init-ntp_enable.sh | 28 + datasophon-init/bin/init-openssl-devel.sh | 28 + datasophon-init/bin/init-perl-JSON.sh | 28 + .../bin/init-private-yum-library-centos8.sh | 114 +++ .../bin/init-private-yum-library-openEuler.sh | 103 +++ datasophon-init/bin/init-psmisc.sh | 28 + datasophon-init/bin/init-pssh.sh | 52 ++ datasophon-init/bin/init-pytest_runner.sh | 26 + datasophon-init/bin/init-python-rpm-macros.sh | 31 + .../bin/init-python-srpm-macros.sh | 31 + .../bin/init-python2-rpm-macros.sh | 31 + datasophon-init/bin/init-python36-devel.sh | 31 + datasophon-init/bin/init-redhat-lsb.sh | 31 + datasophon-init/bin/init-six.sh | 31 + datasophon-init/bin/init-sourceSSHHostname.sh | 2 + datasophon-init/bin/init-ssh-copy-key.sh | 70 ++ datasophon-init/bin/init-ssh-gen-key.sh | 74 ++ datasophon-init/bin/init-ssh-hadoop.sh | 36 + datasophon-init/bin/init-sshpackage.sh | 37 + datasophon-init/bin/init-sshpass.sh | 37 + datasophon-init/bin/init-stop-firewall.sh | 35 + datasophon-init/bin/init-stop-selinux.sh | 38 + datasophon-init/bin/init-system-conf.sh | 83 ++ datasophon-init/bin/init-test.sh | 32 + datasophon-init/bin/init-tmp_pid.sh | 27 + datasophon-init/bin/init-websocket_client.sh | 32 + datasophon-init/bin/init-xdg-utils.sh | 30 + .../bin/init-yum-hosts-mapping-centos8.sh | 56 ++ .../bin/init-yum-hosts-mapping-openEuler.sh | 49 ++ .../config/init-host-info-add.properties | 21 + .../config/init-host-info.properties | 15 + datasophon-init/config/init.properties | 36 + datasophon-init/sbin/init.sh | 831 ++++++++++++++++++ 58 files changed, 3247 insertions(+) create mode 100644 datasophon-init/bin/init-Cython.sh create mode 100644 datasophon-init/bin/init-add-hadoop-user.sh create mode 100644 datasophon-init/bin/init-allhosts.sh create mode 100644 datasophon-init/bin/init-chmod-dev-null.sh create mode 100644 datasophon-init/bin/init-cleanBuff-async.sh create mode 100644 datasophon-init/bin/init-cleanBuff.sh create mode 100644 datasophon-init/bin/init-close-swap.sh create mode 100644 datasophon-init/bin/init-close-transparent-hugepage.sh create mode 100644 datasophon-init/bin/init-cyrus-sasl.sh create mode 100644 datasophon-init/bin/init-ecdsa.sh create mode 100644 datasophon-init/bin/init-expect.sh create mode 100644 datasophon-init/bin/init-gcc-c++.sh create mode 100644 datasophon-init/bin/init-hostIp-txt.sh create mode 100644 datasophon-init/bin/init-hostname.sh create mode 100644 datasophon-init/bin/init-java-policy.sh create mode 100644 datasophon-init/bin/init-jdk.sh create mode 100644 datasophon-init/bin/init-krb5-devel.sh create mode 100644 datasophon-init/bin/init-libtool.sh create mode 100644 datasophon-init/bin/init-libxslt-devel.sh create mode 100644 datasophon-init/bin/init-mysql-8.sh create mode 100644 datasophon-init/bin/init-mysql-datasophon.sh create mode 100644 datasophon-init/bin/init-mysql-devel.sh create mode 100644 datasophon-init/bin/init-nmap.sh create mode 100644 datasophon-init/bin/init-ntp-chrony-server.sh create mode 100644 datasophon-init/bin/init-ntp-chrony-slave.sh create mode 100644 datasophon-init/bin/init-ntp_enable.sh create mode 100644 datasophon-init/bin/init-openssl-devel.sh create mode 100644 datasophon-init/bin/init-perl-JSON.sh create mode 100644 datasophon-init/bin/init-private-yum-library-centos8.sh create mode 100644 datasophon-init/bin/init-private-yum-library-openEuler.sh create mode 100644 datasophon-init/bin/init-psmisc.sh create mode 100644 datasophon-init/bin/init-pssh.sh create mode 100644 datasophon-init/bin/init-pytest_runner.sh create mode 100644 datasophon-init/bin/init-python-rpm-macros.sh create mode 100644 datasophon-init/bin/init-python-srpm-macros.sh create mode 100644 datasophon-init/bin/init-python2-rpm-macros.sh create mode 100644 datasophon-init/bin/init-python36-devel.sh create mode 100644 datasophon-init/bin/init-redhat-lsb.sh create mode 100644 datasophon-init/bin/init-six.sh create mode 100644 datasophon-init/bin/init-sourceSSHHostname.sh create mode 100644 datasophon-init/bin/init-ssh-copy-key.sh create mode 100644 datasophon-init/bin/init-ssh-gen-key.sh create mode 100644 datasophon-init/bin/init-ssh-hadoop.sh create mode 100644 datasophon-init/bin/init-sshpackage.sh create mode 100644 datasophon-init/bin/init-sshpass.sh create mode 100644 datasophon-init/bin/init-stop-firewall.sh create mode 100644 datasophon-init/bin/init-stop-selinux.sh create mode 100644 datasophon-init/bin/init-system-conf.sh create mode 100644 datasophon-init/bin/init-test.sh create mode 100644 datasophon-init/bin/init-tmp_pid.sh create mode 100644 datasophon-init/bin/init-websocket_client.sh create mode 100644 datasophon-init/bin/init-xdg-utils.sh create mode 100644 datasophon-init/bin/init-yum-hosts-mapping-centos8.sh create mode 100644 datasophon-init/bin/init-yum-hosts-mapping-openEuler.sh create mode 100644 datasophon-init/config/init-host-info-add.properties create mode 100644 datasophon-init/config/init-host-info.properties create mode 100644 datasophon-init/config/init.properties create mode 100644 datasophon-init/sbin/init.sh diff --git a/datasophon-init/bin/init-Cython.sh b/datasophon-init/bin/init-Cython.sh new file mode 100644 index 00000000..77b2e412 --- /dev/null +++ b/datasophon-init/bin/init-Cython.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +CYTHON_FOLDER_NAME=Cython-0.20 +CYTHON_TAR_NAME=Cython-0.20.tar.gz +tar -zxvf ${PACKAGES_PATH}/${CYTHON_TAR_NAME} -C ${PACKAGES_PATH} +cd ${PACKAGES_PATH}/${CYTHON_FOLDER_NAME} +python3 setup.py install +cd ${INIT_BIN_PATH} +echo "Cython install successfully" diff --git a/datasophon-init/bin/init-add-hadoop-user.sh b/datasophon-init/bin/init-add-hadoop-user.sh new file mode 100644 index 00000000..8fd7c45b --- /dev/null +++ b/datasophon-init/bin/init-add-hadoop-user.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +GROUP=hadoop +USER=hadoop + +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +egrep "^$GROUP" /etc/group >&/dev/null +if [ $? -ne 0 ]; then + groupadd $GROUP + echo "Successfully added GROUP: hadoop" +fi +egrep "^$USER" /etc/passwd >&/dev/null +if [ $? -ne 0 ]; then + useradd -g ${USER} ${USER} + echo "Successfully added USER: hadoop passwd: hadoop" +fi + +echo "init-add-hadoop-user.sh." +echo "Done." diff --git a/datasophon-init/bin/init-allhosts.sh b/datasophon-init/bin/init-allhosts.sh new file mode 100644 index 00000000..9e3ac0bc --- /dev/null +++ b/datasophon-init/bin/init-allhosts.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +hostAllInfoPath="$1" +initAllHostNums="$2" + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +REPAIR_PATH=$(dirname "${BASE_PATH}") +echo "REPAIR_PATH: ${REPAIR_PATH}" + +sed -i '/#modify etc hosts start/,/#modify etc hosts end/d' /etc/hosts +modifyHosts() { + cat /etc/hosts | grep yum + if [ $? -eq 0 ]; then + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts start' /etc/hosts + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password + echo "ip: ${ip}" + echo "${ip} ${hostname}" + sed -i '/#modify yum mapping hosts start/i '${ip}' '${hostname}'' /etc/hosts + done + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts end' /etc/hosts + else + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + echo "#modify etc hosts start" >>/etc/hosts + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # password + echo "ip: ${ip}" + echo "${ip} ${hostname}" + echo "${ip} ${hostname}" >>/etc/hosts + done + echo "#modify etc hosts end" >>/etc/hosts + fi + +} + +modifyHosts +sed -i 's/^[^#].*[0-9]-[0-9]/#&/g' /etc/hosts + +echo "init-hosts.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-chmod-dev-null.sh b/datasophon-init/bin/init-chmod-dev-null.sh new file mode 100644 index 00000000..2bbfece2 --- /dev/null +++ b/datasophon-init/bin/init-chmod-dev-null.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# example: sh init-expect.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +rm -rf /dev/null && mknod -m 0666 /dev/null c 1 3 +echo "INIT-chmod-dev-null.sh." +echo "Done." + diff --git a/datasophon-init/bin/init-cleanBuff-async.sh b/datasophon-init/bin/init-cleanBuff-async.sh new file mode 100644 index 00000000..18039100 --- /dev/null +++ b/datasophon-init/bin/init-cleanBuff-async.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi + +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" + +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +echo "BASE_PATH: ${BASE_PATH}" + +BIN_PATH=$(dirname "${BASE_PATH}")/bin +SCRIPTS_PATH=$(dirname "${BASE_PATH}")/scripts + +echo "SCRIPTS_PATH: $SCRIPTS_PATH" + +nohup sh ${INIT_BIN_PATH}/init-cleanBuff.sh >/dev/null 2>&1 & +#nohup sh $SCRIPTS_PATH/repair-cleanBuff.sh & diff --git a/datasophon-init/bin/init-cleanBuff.sh b/datasophon-init/bin/init-cleanBuff.sh new file mode 100644 index 00000000..a244fe8c --- /dev/null +++ b/datasophon-init/bin/init-cleanBuff.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "sync" +sync +sync +sync + +echo "sleep" +sleep 10 + +echo 1 >/proc/sys/vm/drop_caches +echo 2 >/proc/sys/vm/drop_caches +echo 3 >/proc/sys/vm/drop_caches + +echo "done" diff --git a/datasophon-init/bin/init-close-swap.sh b/datasophon-init/bin/init-close-swap.sh new file mode 100644 index 00000000..33492f7d --- /dev/null +++ b/datasophon-init/bin/init-close-swap.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +#swapoff /dev/centos/swap + +# /etc/fstab +# /dev/mapper/centos-swap swap swap defaults 0 0 +sed -ri 's/.*swap.*/#&/' /etc/fstab + +echo 0 >/proc/sys/vm/swappiness + +SWAP_STR=$(cat /etc/sysctl.conf | grep vm.swappiness) +if [ -z "${SWAP_STR}" ]; then + echo "vm.swappiness=0" >>/etc/sysctl.conf +else + sed -i '/vm.swappiness/d' /etc/sysctl.conf + echo "vm.swappiness=0" >>/etc/sysctl.conf +fi + +sysctl vm.swappiness=0 +swapoff -a && swapon -a +sysctl -p + +echo "Swap is closed." +echo "init-close-swap.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-close-transparent-hugepage.sh b/datasophon-init/bin/init-close-transparent-hugepage.sh new file mode 100644 index 00000000..a51cfb2d --- /dev/null +++ b/datasophon-init/bin/init-close-transparent-hugepage.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +echo never >/sys/kernel/mm/transparent_hugepage/enabled +echo never >/sys/kernel/mm/transparent_hugepage/defrag +cat /sys/kernel/mm/transparent_hugepage/defrag +cat /sys/kernel/mm/transparent_hugepage/enabled +echo 'echo never > /sys/kernel/mm/transparent_hugepage/defrag' >>/etc/rc.d/rc.local +echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >>/etc/rc.d/rc.local +echo "transparent_hugepage is closed." +echo "init-close-transparent-hugepage.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-cyrus-sasl.sh b/datasophon-init/bin/init-cyrus-sasl.sh new file mode 100644 index 00000000..c554b4db --- /dev/null +++ b/datasophon-init/bin/init-cyrus-sasl.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +yum -y install cyrus-sasl* + +echo "cyrus-sasl install successfully" diff --git a/datasophon-init/bin/init-ecdsa.sh b/datasophon-init/bin/init-ecdsa.sh new file mode 100644 index 00000000..757cfce8 --- /dev/null +++ b/datasophon-init/bin/init-ecdsa.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +ECDSA_FOLDER_NAME=ecdsa-0.14.1 +ECDSA_TAR_NAME=ecdsa-0.14.1.tar.gz +tar -zxvf ${PACKAGES_PATH}/${ECDSA_TAR_NAME} -C ${PACKAGES_PATH} +cd ${PACKAGES_PATH}/${ECDSA_FOLDER_NAME} +python3 setup.py install +cd ${INIT_PATH} +echo "ecdsa install successfully" diff --git a/datasophon-init/bin/init-expect.sh b/datasophon-init/bin/init-expect.sh new file mode 100644 index 00000000..fb6a3388 --- /dev/null +++ b/datasophon-init/bin/init-expect.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# example: sh init-expect.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +EXPECT_FOLDER_NAME=expect +EXPECT_TAR_NAME=expect.tar.gz +#存在python3-pexpect-4.3.1-3 导致判断不准确,直接安装 +#rpm -qa | grep expect-5 +#if [ "$?" == "0" ]; then +# echo "expect exists" +#else +# yum -y install expect +# rpm -qa | grep expect-5.45 +# if [ "$?" == "0" ]; then +# echo "expect exists" +# echo "init-expect.sh finished." +# echo "Done." +# fi +#fi + +yum -y install expect +echo "init-expect.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-gcc-c++.sh b/datasophon-init/bin/init-gcc-c++.sh new file mode 100644 index 00000000..f94f7956 --- /dev/null +++ b/datasophon-init/bin/init-gcc-c++.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +GCC_FOLDER_NAME=gcc-c++ +GCC_TAR_NAME=gcc-c++.tar.gz +rpm -qa | grep gcc-c++ +if [ "$?" == "0" ]; then + echo "rpm -qa | grep gcc-c++ exists" +else + yum -y install gcc-c++ + rpm -qa | grep gcc-c++ + if [ "$?" == "0" ]; then + echo "gcc-c++ install successfully" + fi +fi diff --git a/datasophon-init/bin/init-hostIp-txt.sh b/datasophon-init/bin/init-hostIp-txt.sh new file mode 100644 index 00000000..6951fc84 --- /dev/null +++ b/datasophon-init/bin/init-hostIp-txt.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# example: sh init-expect.sh +#TXT for initializing the cluster IP address list + +hostAllInfoPath="$1" +initAllHostNums="$2" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 +} +for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") + echo "ip: ${ip}" + echo "port: ${port}" + echo -e "root@${ip}:${port}" >>${INIT_BIN_PATH}/tmp_scp_host_info.txt +done + +echo "init-hostIp-txt.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-hostname.sh b/datasophon-init/bin/init-hostname.sh new file mode 100644 index 00000000..526f6a83 --- /dev/null +++ b/datasophon-init/bin/init-hostname.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +hostname=$1 +modifyHostname() { + echo "${hostname}" >/etc/hostname + echo "HOSTNAME=${hostname}" >/etc/sysconfig/network + echo "NOZEROCONF=yes" >>/etc/sysconfig/network + hostnamectl set-hostname ${hostname} + hostnamectl set-hostname --static ${hostname} +} + +modifyHostname + +echo "init-hostname.sh finished." diff --git a/datasophon-init/bin/init-java-policy.sh b/datasophon-init/bin/init-java-policy.sh new file mode 100644 index 00000000..4b60ed7c --- /dev/null +++ b/datasophon-init/bin/init-java-policy.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BBASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +ETC_HOST=/etc/hosts +source /etc/profile +sed -i '/modify java policy start/,/modify java policy end/d' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/grant {/a\//modify java policy end' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/modify java policy end/i\//modify java policy start' ${JAVA_HOME}/jre/lib/security/java.policy +sed -i '/modify java policy end/i\permission javax.management.MBeanTrustPermission "register";' ${JAVA_HOME}/jre/lib/security/java.policy +echo "init-java-policy.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-jdk.sh b/datasophon-init/bin/init-jdk.sh new file mode 100644 index 00000000..965a2f12 --- /dev/null +++ b/datasophon-init/bin/init-jdk.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +# example: sh init-jdk.sh +# instal and config jdk env +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +JDK_FOLDER_PATH=/usr/java +source /etc/profile +mkdir -p /usr/java +JDK_PATH_NAME="jdk1.8.0_333" +JDK_VERSION="1.8" +BASH_PROFILE_PATH="/root/.bash_profile" +BASHRC_PATH="/root/.bashrc" +ETC_PROFILE_PATH="/etc/profile" +JDK_TAR_NAME="jdk-8u333-linux-x64.tar.gz" + +jdkAvailable=$(java -version 2>&1 | awk 'NR==1{gsub(/"/,"");print $3}') +result=$(echo $jdkAvailable | grep $JDK_VERSION) +if [[ "$result" != "" ]]; then + echo "JDK installed.............................." +else + echo "JDK not installed.............................." + echo "JDK environment already sets" + pid="sed -i '/export JAVA_HOME/d' /etc/profile" + eval $pid + pid="sed -i '/export CLASSPATH/d' /etc/profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /root/.bash_profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /root/.bashrc" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bash_profile" + eval $pid + pid="sed -i '/source \/etc\/profile/d' /home/hadoop/.bashrc" + eval $pid + echo "Prepare to Install JDK..." + sleep 2s + mkdir -p ${JDK_FOLDER_PATH} + tar -zxvf ${PACKAGES_PATH}/${JDK_TAR_NAME} -C ${JDK_FOLDER_PATH} + JAVA_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}" + JRE_HOME="${JDK_FOLDER_PATH}/${JDK_PATH_NAME}/jre" + JAVA_SOURCE_ENV="source /etc/profile" + echo "export JAVA_HOME=$JAVA_HOME" >>/etc/profile + echo "export JRE_HOME=$JRE_HOME" >>/etc/profile + echo "export CLASSPATH=.:\$JRE_HOME/lib/rt.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar" >>/etc/profile + echo "export PATH=\$PATH:\$JAVA_HOME/bin" >>/etc/profile + echo ${JAVA_SOURCE_ENV} >>~/.bash_profile + echo ${JAVA_SOURCE_ENV} >>~/.bashrc + echo "Prepare to config BCPROV..." + JAVA_SECURITY_DIR="${JAVA_HOME}/jre/lib/security/java.security" + JAVA_BCPROV_DIR="${JAVA_HOME}/jre/lib/ext/" + JAVA_BCPROV_JAR="${PACKAGES_PATH}/bcprov-jdk15on-1.68.jar" + + JAVA_SECURITY_ARGS_ARR[0]="security.provider.1=sun.security.provider.Sun" + JAVA_SECURITY_ARGS_ARR[1]="security.provider.2=sun.security.rsa.SunRsaSign" + JAVA_SECURITY_ARGS_ARR[2]="security.provider.3=com.sun.net.ssl.internal.ssl.Provider" + JAVA_SECURITY_ARGS_ARR[3]="security.provider.4=com.sun.crypto.provider.SunJCE" + JAVA_SECURITY_ARGS_ARR[4]="security.provider.5=sun.security.jgss.SunProvider" + JAVA_SECURITY_ARGS_ARR[5]="security.provider.6=com.sun.security.sasl.Provider" + JAVA_SECURITY_ARGS_ARR[6]="security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI" + JAVA_SECURITY_ARGS_ARR[7]="security.provider.8=sun.security.smartcardio.SunPCSC" + JAVA_SECURITY_ARGS_ARR[8]="security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider" + + for element in ${JAVA_SECURITY_ARGS_ARR[@]}; do + JAVA_SECURITY_ARGS="${JAVA_SECURITY_ARGS}${element}\n" + done + + echo -e ${JAVA_SECURITY_ARGS} >>${JAVA_SECURITY_DIR} + cp -a ${JAVA_BCPROV_JAR} ${JAVA_BCPROV_DIR} + + echo "BCPROV Installed." + + echo "If you need to effect the environment variable in the current session, do it manually: " + source ${BASH_PROFILE_PATH} + source ${BASHRC_PATH} + source ${ETC_PROFILE_PATH} + jdk2=$(grep -n "export JAVA_HOME=.*" /home/hadoop/.bash_profile | cut -f1 -d':') + if [ -n "$jdk2" ]; then + echo "JDK HADOOP environment exists" + else + echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bash_profile + echo ${JAVA_SOURCE_ENV} >>/home/hadoop/.bashrc + echo "JDK HADOOP environment sets successfully" + fi + echo "JDK install successfully" + source /etc/profile +fi +echo "INIT-init-jdk.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-krb5-devel.sh b/datasophon-init/bin/init-krb5-devel.sh new file mode 100644 index 00000000..11e8d2ef --- /dev/null +++ b/datasophon-init/bin/init-krb5-devel.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +KRB5_FOLDER_NAME=krb5-devel +KRB5_TAR_NAME=krb5-devel.tar.gz +rpm -qa | grep krb5-devel +if [ "$?" == "0" ]; then + echo "rpm -qa | grep krb5-devel exists" +else + yum -y install krb5-devel + rpm -qa | grep krb5-devel + if [ "$?" == "0" ]; then + echo "krb5-devel install successfully" + fi +fi diff --git a/datasophon-init/bin/init-libtool.sh b/datasophon-init/bin/init-libtool.sh new file mode 100644 index 00000000..4cd938af --- /dev/null +++ b/datasophon-init/bin/init-libtool.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +rpm -qa | grep libtool +if [ "$?" == "0" ]; then + echo "rpm -qa | grep libtool exists" +else + yum -y install libtool + rpm -qa | grep libtool + if [ "$?" == "0" ]; then + echo "libtool install successfully" + fi +fi diff --git a/datasophon-init/bin/init-libxslt-devel.sh b/datasophon-init/bin/init-libxslt-devel.sh new file mode 100644 index 00000000..c2fad548 --- /dev/null +++ b/datasophon-init/bin/init-libxslt-devel.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +rpm -qa | grep libxslt-devel +if [ "$?" == "0" ]; then + echo "libxslt-devel exists" +else + yum -y install libxslt-devel + rpm -qa | grep libxslt-devel + if [ "$?" == "0" ]; then + echo "libxslt_devel install successfully" + fi +fi diff --git a/datasophon-init/bin/init-mysql-8.sh b/datasophon-init/bin/init-mysql-8.sh new file mode 100644 index 00000000..20410214 --- /dev/null +++ b/datasophon-init/bin/init-mysql-8.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +num1="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +rpm -qa | grep zlib-devel +if [ "$?" == "0" ]; then + echo "zlib-devel exists" +else + yum -y install zlib-devel + rpm -qa | grep zlib-devel + if [ "$?" == "0" ]; then + echo "zlib-devel install successfully" + fi +fi + +rpm -qa | grep bzip2-devel +if [ "$?" == "0" ]; then + echo "bzip2-devel exists" +else + yum -y install bzip2-devel + rpm -qa | grep bzip2-devel + if [ "$?" == "0" ]; then + echo "bzip2-devel install successfully" + fi +fi + +rpm -qa | grep openssl-devel +if [ "$?" == "0" ]; then + echo "openssl-devel exists" +else + yum -y install openssl-devel + rpm -qa | grep openssl-devel + if [ "$?" == "0" ]; then + echo "openssl-devel install successfully" + fi +fi + +rpm -qa | grep ncurses-devel +if [ "$?" == "0" ]; then + echo "ncurses-devel exists" +else + yum -y install ncurses-devel + rpm -qa | grep ncurses-devel + if [ "$?" == "0" ]; then + echo "ncurses-devel install successfully" + fi +fi + +MYSQL_FOLDER_NAME=mysql-community-8.0.28.el8.x86_64 +MYSQL_TAR_NAME=mysql-community-8.0.28.el8.x86_64.tar.gz + +echo "mysql start install mysql-community-8.0.28-1.el8.x86_64........." +tar -zxvf ${PACKAGES_PATH}/${MYSQL_TAR_NAME} -C ${PACKAGES_PATH} +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-common-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-libs-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-devel-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-client-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm +rpm -ivh ${PACKAGES_PATH}/${MYSQL_FOLDER_NAME}/mysql-community-server-8.0.28-1.el8.x86_64.rpm + +mysqld --initialize --user=mysql +systemctl start mysqld +systemctl enable mysqld +sleep 2 +echo "${num1}" + +if [ $(systemctl status mysqld | grep running | wc -l) -eq 1 ]; then + echo "mysql在运行" + tmp_passwd=$(grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}') + echo "临时密码:${tmp_passwd}" + #mysql -uroot -p"${tmp_passwd}" --connect-expired-password -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}';" + #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED BY '${num1}' PASSWORD EXPIRE NEVER;" + #mysql -uroot -p"${num1}" -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '${num1}';" + #mysql -uroot -p"${num1}" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;" + #mysql -uroot -p"${num1}" -e "FLUSH PRIVILEGES;" + + /usr/bin/mysqladmin -uroot -p''$tmp_passwd'' password ''$num1'' + mysql -uroot -p''$num1'' -e "update mysql.user set host='%' where user ='root';" + mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" + mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED BY '$num1' PASSWORD EXPIRE NEVER;" + echo "num1:'$num1'" + mysql -uroot -p''$num1'' -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '$num1';" + mysql -uroot -p''$num1'' -e "FLUSH PRIVILEGES;" + + cat >/etc/my.cnf </etc/chrony.conf </etc/chrony.conf </etc/chrony.conf </etc/yum.repos.d/dataSophon.repo <>${initLogDir}/installSingle_$(date +%Y%m%d).log + systemctl stop httpd + systemctl start httpd + +else + echo "init httpd begin." + yum install httpd + cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' + sed -i 's/Listen 80/Listen 8000/g' /etc/httpd/conf/httpd.conf + sed -i '/ServerName yum.dataSophon.cn:8000/d' /etc/httpd/conf/httpd.conf + sed -i '/#ServerName/a ServerName yum.dataSophon.cn:8000' /etc/httpd/conf/httpd.conf + systemctl start httpd + systemctl enable httpd + echo "init httpd finished." +fi +unlink /var/www/html/centos +ln -s /data/private-yum-library/repo/centos/ /var/www/html/ +#unlink /var/www/html/epel +#ln -s /data/datasophon-init/private-yum-library/epel/ /var/www/html/ +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts() { + echo "#modify yum mapping hosts start" >>/etc/hosts + echo "${ip} yum.dataSophon.cn" >>/etc/hosts + echo "#modify yum mapping hosts end" >>/etc/hosts + source /etc/profile + source /root/.bash_profile +} +modifyYumHosts + +rm /etc/yum.repos.d/dataSophon.repo + +cat >/etc/yum.repos.d/dataSophon.repo </etc/yum.repos.d/dataSophon.repo <>${initLogDir}/installSingle_$(date +%Y%m%d).log + systemctl stop httpd + systemctl start httpd + +else + echo "init httpd begin." + yum install httpd + cat /etc/httpd/conf/httpd.conf | grep 'Listen 8000' + sed -i 's/Listen 80/Listen 8000/g' /etc/httpd/conf/httpd.conf + sed -i '/ServerName yum.dataSophon.cn:8000/d' /etc/httpd/conf/httpd.conf + sed -i '/#ServerName/a ServerName yum.dataSophon.cn:8000' /etc/httpd/conf/httpd.conf + systemctl start httpd + systemctl enable httpd + echo "init httpd finished." +fi + +unlink /var/www/html/repo +ln -s /data/private-yum-library/repo /var/www/html/ +#unlink /var/www/html/epol +#ln -s /data/datasophon-init/private-yum-library/epol /var/www/html/ +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts() { + echo "#modify yum mapping hosts start" >>/etc/hosts + echo "${ip} yum.dataSophon.cn" >>/etc/hosts + echo "#modify yum mapping hosts end" >>/etc/hosts + source /etc/profile + source /root/.bash_profile +} +modifyYumHosts + +rm /etc/yum.repos.d/dataSophon.repo + +cat >/etc/yum.repos.d/dataSophon.repo <~/.ssh/config diff --git a/datasophon-init/bin/init-ssh-copy-key.sh b/datasophon-init/bin/init-ssh-copy-key.sh new file mode 100644 index 00000000..ab69fbe0 --- /dev/null +++ b/datasophon-init/bin/init-ssh-copy-key.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +INITAllHostNums=$2 +port=$3 +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +removeSSHAsk() { + sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config + sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config + sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config +} +copyKeyConfig() { + # authorized_keys + # known_hosts + # scp -r /root/.ssh/ root@192.168.216.20:/root/ + + user=root + sshDir="/${user}/.ssh" + + function prop { + [ -f "${filePath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${filePath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${INITAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo $ip + echo $pwd + echo $port + /usr/bin/expect <<-EOF +set timeout -1 +spawn scp -P${port} -r $sshDir/ $user@$ip:/${user}/ +expect { + "yes/no" { send "yes\r"; exp_continue } + "password:" { send "$pwd\r" } + } + expect eof + EOF + done + echo -e "\nFinish copy ssh config." +} + +removeSSHAsk +copyKeyConfig + +echo "init-ssh-copy-key.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-ssh-gen-key.sh b/datasophon-init/bin/init-ssh-gen-key.sh new file mode 100644 index 00000000..8c7a1019 --- /dev/null +++ b/datasophon-init/bin/init-ssh-gen-key.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +sh ${INIT_BIN_PATH}/init-sshpackage.sh +sh ${INIT_BIN_PATH}/init-expect.sh + +removeSSHAsk() { + echo "begin removeSSHAsk....." + sed -i '/^#.*UseDNS no/s/^#//g' /etc/ssh/sshd_config + sed -i '/^#.*StrictHostKeyChecking ask/s/^#//g' /etc/ssh/ssh_config + sed -i '/StrictHostKeyChecking ask/s/ask/no/g' /etc/ssh/ssh_config +} + + +keygenConfig(){ +# ssh-keygen -t rsa +sshPath=/root/.ssh +if [ ! -r "${sshPath}/id_rsa.pub" ]; then +echo "id_rsa.pub nonexistent creating......" +/usr/bin/expect <<-EOF +set timeout 10 +spawn ssh-keygen -t rsa +expect { + "Enter file in which to save the key (/root/.ssh/id_rsa): " { send "\r"; exp_continue } + "Overwrite (y/n)? " { send "y\r"; exp_continue } + "Enter passphrase (empty for no passphrase): " { send "\r"; exp_continue } + "Enter same passphrase again: " { send "\r" } + } + expect eof + EOF + +wait +echo "Finish ssh-keygen -t rsa." +else +echo "id_rsa.pub exists" +fi +} + +configAuthorizedKeys(){ + user=root + sshDir="/${user}/.ssh" + cat ${sshDir}/id_rsa.pub >> ${sshDir}/authorized_keys +} +removeSSHAsk +keygenConfig +configAuthorizedKeys + +echo "init-ssh-gen-key.sh finished." +echo "Done." + + + + diff --git a/datasophon-init/bin/init-ssh-hadoop.sh b/datasophon-init/bin/init-ssh-hadoop.sh new file mode 100644 index 00000000..765252ca --- /dev/null +++ b/datasophon-init/bin/init-ssh-hadoop.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# example: sh init-ssh-gen-key.sh + +filePath=$1 +initAllHostNums="$2" +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +sshHadoopDir=/home/hadoop/.ssh/ +rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt +bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${filePath} ${initAllHostNums} + +pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-add-hadoop-user.sh +pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p /home/hadoop/" +pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r /root/.ssh /home/hadoop/ +pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "chown hadoop:hadoop -R '${sshHadoopDir}'" +echo "repair init-ssh-hadoop.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-sshpackage.sh b/datasophon-init/bin/init-sshpackage.sh new file mode 100644 index 00000000..66c7a7bc --- /dev/null +++ b/datasophon-init/bin/init-sshpackage.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + +SSH_FOLDER_NAME=ssh +SSH_TAR_NAME=ssh.tar.gz + +ssh_rpm=$(rpm -qa | grep openssh) +if [[ "$?" == "0" ]]; then + echo "ssh exists" +else + yum -y install openssh + echo "ssh-install finished." +fi + +echo "init-sshpackage.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-sshpass.sh b/datasophon-init/bin/init-sshpass.sh new file mode 100644 index 00000000..91e186ce --- /dev/null +++ b/datasophon-init/bin/init-sshpass.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +SSHPASS_FOLDER_NAME=sshpass + +SSHPASS_TAR_NAME=sshpass.tar.gz +rpm -qa | grep sshpass +if [ "$?" == "0" ]; then + echo "sshpass exists" +else + yum -y install sshpass + rpm -qa | grep sshpass + if [ "$?" == "0" ]; then + echo "init sshpass install successfully" + fi +fi diff --git a/datasophon-init/bin/init-stop-firewall.sh b/datasophon-init/bin/init-stop-firewall.sh new file mode 100644 index 00000000..03777a2c --- /dev/null +++ b/datasophon-init/bin/init-stop-firewall.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# example: sh init-stop-firewall.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +FIREWALL_STATUS=`firewall-cmd --state` +if [[ ${FIREWALL_STATUS} == "running" ]] +then + echo "Closing firewall." + systemctl stop firewalld.service + systemctl disable firewalld.service + echo "Firewall closed." +else + echo "Firewall closed." +fi +echo "init-stop-firewall.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-stop-selinux.sh b/datasophon-init/bin/init-stop-selinux.sh new file mode 100644 index 00000000..f8b7d411 --- /dev/null +++ b/datasophon-init/bin/init-stop-selinux.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# example: sh init-stop-firewall.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" + + +SELINUX_STATUS=`getenforce` +SELINUX_CONFIG_PATH="/etc/selinux/config" +if [[ ${SELINUX_STATUS} == "Enforcing" ]] +then + echo "Closing SELINUX." + setenforce 0 + echo "Disabling SELINUX." + sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" ${SELINUX_CONFIG_PATH} + echo "SELINUX closed." +else + echo "SELINUX closed." +fi + +echo "init-stop-selinux.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-system-conf.sh b/datasophon-init/bin/init-system-conf.sh new file mode 100644 index 00000000..7688c6ae --- /dev/null +++ b/datasophon-init/bin/init-system-conf.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# example: sh init-system-conf.sh +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + + +# vi /etc/systemd/system.conf +# DefaultLimitNOFILE=102400000 +# DefaultLimitNPROC=102400000 +sed -i '/DefaultLimitNOFILE=/d' /etc/systemd/system.conf +sed -i '/DefaultLimitNPROC=/d' /etc/systemd/system.conf + +cat << EOF >> /etc/systemd/system.conf +DefaultLimitNOFILE=1024000 +DefaultLimitNPROC=1024000 +EOF + +# vi /etc/security/limits.conf +#* soft fsize unlimited +#* hard fsize unlimited +#* soft cpu unlimited +#* hard cpu unlimited +#* soft as unlimited +#* hard as unlimited +#* soft nofile 10240000 +#* hard nofile 10240000 +#* soft nproc 10240000 +#* hard nproc 10240000 + +sed -i '/* soft fsize/d' /etc/security/limits.conf +sed -i '/* hard fsize/d' /etc/security/limits.conf +sed -i '/* soft cpu/d' /etc/security/limits.conf +sed -i '/* hard cpu/d' /etc/security/limits.conf +sed -i '/* soft as/d' /etc/security/limits.conf +sed -i '/* hard as/d' /etc/security/limits.conf +sed -i '/* soft nofile/d' /etc/security/limits.conf +sed -i '/* hard nofile/d' /etc/security/limits.conf +sed -i '/* soft nproc/d' /etc/security/limits.conf +sed -i '/* hard nproc/d' /etc/security/limits.conf + +cat << EOF >> /etc/security/limits.conf +* soft fsize unlimited +* hard fsize unlimited +* soft cpu unlimited +* hard cpu unlimited +* soft as unlimited +* hard as unlimited +* soft nofile 1048576 +* hard nofile 1048576 +* soft nproc unlimited +* hard nproc unlimited +EOF + +# vi /etc/security/limits.d/20-nproc.conf +#* soft nproc 102400000 +#root soft nproc unlimited + +cat << EOF > /etc/security/limits.d/20-nproc.conf +# Default limit for number of user's processes to prevent +# accidental fork bombs. +# See rhbz #432903 for reasoning. + +* soft nproc unlimited +root soft nproc unlimited +EOF + +echo "kernel.pid_max=1000000" >> /etc/sysctl.conf +sysctl -p + +echo "init-system-conf finished." +echo "Done." diff --git a/datasophon-init/bin/init-test.sh b/datasophon-init/bin/init-test.sh new file mode 100644 index 00000000..d01dcb98 --- /dev/null +++ b/datasophon-init/bin/init-test.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +num1="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +INIT_SQL_PATH=${INIT_PATH}/sql +echo "INIT_SQL_PATH: ${INIT_SQL_PATH}" +#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DDL.sql; +#mysql -udatasophon -p'datasophon' <${INIT_SQL_PATH}/V1.1.0_DML.sql; + +mysql -udatasophon -p'datasophon' <> /usr/lib/tmpfiles.d/tmp.conf + echo "x /tmp/hsperfdata*/*" >> /usr/lib/tmpfiles.d/tmp.conf + echo "X /tmp/hsperfdata*" >> /usr/lib/tmpfiles.d/tmp.conf +} + +modifyHostname + +echo "init-tmp_pid.sh finished." diff --git a/datasophon-init/bin/init-websocket_client.sh b/datasophon-init/bin/init-websocket_client.sh new file mode 100644 index 00000000..dccbb7d2 --- /dev/null +++ b/datasophon-init/bin/init-websocket_client.sh @@ -0,0 +1,32 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +echo "${PACKAGES_PATH}" +WEBSOCKET_CLIENT_FOLDER_NAME=websocket_client-0.54.0 +WEBSOCKET_CLIENT_TAR_NAME=websocket_client-0.54.0.tar.gz + tar -zxvf ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_TAR_NAME} -C ${PACKAGES_PATH} + cd ${PACKAGES_PATH}/${WEBSOCKET_CLIENT_FOLDER_NAME} + python3 setup.py install + cd ${INIT_PATH} + echo "websocket_client install successfully" + + diff --git a/datasophon-init/bin/init-xdg-utils.sh b/datasophon-init/bin/init-xdg-utils.sh new file mode 100644 index 00000000..a8a2fb19 --- /dev/null +++ b/datasophon-init/bin/init-xdg-utils.sh @@ -0,0 +1,30 @@ +#!/bin/bash + + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +XDG_FOLDER_NAME=xdg-utils +XDG_TAR_NAME=xdg-utils.tar.gz +rpm -qa | grep xdg-utils +if [ "$?" == "0" ]; then +echo "rpm -qa | grep xdg-utils exists" +else + yum -y install xdg-utils + rpm -qa | grep xdg-utils + if [ "$?" == "0" ]; then + echo "xdg-utils install successfully" + fi +fi + diff --git a/datasophon-init/bin/init-yum-hosts-mapping-centos8.sh b/datasophon-init/bin/init-yum-hosts-mapping-centos8.sh new file mode 100644 index 00000000..dc6ef2eb --- /dev/null +++ b/datasophon-init/bin/init-yum-hosts-mapping-centos8.sh @@ -0,0 +1,56 @@ +#!/bin/bash +ip="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +rm -rf /etc/yum.repos.d/backup +mkdir -p /etc/yum.repos.d/backup +mv `find /etc/yum.repos.d/ -name "*.repo"` /etc/yum.repos.d/backup + +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts(){ +echo "#modify yum mapping hosts start" >> /etc/hosts +echo "${ip} yum.dataSophon.cn" >> /etc/hosts +echo "#modify yum mapping hosts end" >> /etc/hosts +} +modifyYumHosts +cat > /etc/yum.repos.d/dataSophon.repo << EOF +#centos8的基础repo包在iso镜像文件的BaseOS和AppStream下 +[dataSophon-base] +name=dataSophon-base +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/BaseOS/ +gpgcheck=0 +enable=1 + +[dataSophon-AppStream] +name=dataSophon-AppStream +baseurl=http://yum.dataSophon.cn:8000/centos/8/x86_64/AppStream/ +gpgcheck=0 +enabled=1 + +#初始化只包含从iso镜像中拷贝出来的基础repo源,如不能满足需求可以再次基础上配置epol扩展包YUM源 +#[dataSophon-epel] +#name=dataSophon-epel +#baseurl=http://yum.dataSophon.cn:8000/epel/8/x86_64/ +#enabled=1 +#gpgcheck=0 +EOF + +yum clean all + +yum makecache +echo "init-yum-hosts-mapping.sh finished." +echo "Done." +echo "yum repolist:" +echo "$(yum repolist)" diff --git a/datasophon-init/bin/init-yum-hosts-mapping-openEuler.sh b/datasophon-init/bin/init-yum-hosts-mapping-openEuler.sh new file mode 100644 index 00000000..56811f4c --- /dev/null +++ b/datasophon-init/bin/init-yum-hosts-mapping-openEuler.sh @@ -0,0 +1,49 @@ +#!/bin/bash +ip="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ] +then + BASE_DIR=`dirname $(readlink $0)` +else + BASE_DIR=`dirname $0` +fi +BASE_PATH=$(cd ${BASE_DIR}; pwd) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +rm -rf /etc/yum.repos.d/backup +mkdir -p /etc/yum.repos.d/backup +mv `find /etc/yum.repos.d/ -name "*.repo"` /etc/yum.repos.d/backup + +sed -i '/#modify yum mapping hosts start/,/#modify yum mapping hosts end/d' /etc/hosts +modifyYumHosts(){ +echo "#modify yum mapping hosts start" >> /etc/hosts +echo "${ip} yum.dataSophon.cn" >> /etc/hosts +echo "#modify yum mapping hosts end" >> /etc/hosts +} +modifyYumHosts +cat > /etc/yum.repos.d/dataSophon.repo << EOF +[dataSophon-base] +name=dataSophon-base +baseurl=http://yum.dataSophon.cn:8000/repo/ +gpgcheck=0 +enable=1 + +#初始化只包含从iso镜像中拷贝出来的基础repo源,如不能满足需求可以再次基础上配置epol扩展包YUM源 +#[dataSophon-epel] +#name=dataSophon-epel +#baseurl=http://yum.dataSophon.cn:8000/epel/ +#enabled=1 +#gpgcheck=0 +EOF + +yum clean all + +yum makecache +echo "init-yum-hosts-mapping.sh finished." +echo "Done." +echo "yum repolist:" +echo "$(yum repolist)" diff --git a/datasophon-init/config/init-host-info-add.properties b/datasophon-init/config/init-host-info-add.properties new file mode 100644 index 00000000..290e51b3 --- /dev/null +++ b/datasophon-init/config/init-host-info-add.properties @@ -0,0 +1,21 @@ +# 1.Please provide the information of added hosts needed to be inited in the format specified below +# 2.dataSophon.ip.i(eg:i=1,2,3.....): +# 3.dataSophon.password.i: +# 4.dataSophon.ssh.port.i: +# 5.dataSophon.ssh.port.hostname.i: +dataSophon.ip.1=127.0.0.1(need to change) +dataSophon.password.1=your-node-root-password(need to change) +dataSophon.ssh.port.1=22 +dataSophon.ssh.port.hostname.1=your-node-hostname(need to change) + +dataSophon.ip.2=127.0.0.1(need to change) +dataSophon.password.2=your-node-root-password(need to change) +dataSophon.ssh.port.2=22 +dataSophon.ssh.port.hostname.2=your-node-hostname(need to change) + + +dataSophon.ip.3=127.0.0.1(need to change) +dataSophon.password.3=your-node-root-password(need to change) +dataSophon.ssh.port.3=22 +dataSophon.ssh.port.hostname.3=your-node-hostname(need to change) + diff --git a/datasophon-init/config/init-host-info.properties b/datasophon-init/config/init-host-info.properties new file mode 100644 index 00000000..8ec64aef --- /dev/null +++ b/datasophon-init/config/init-host-info.properties @@ -0,0 +1,15 @@ +# 1.Please provide the information of hosts needed to be inited in the format specified below +# 2.dataSophon.ip.i(eg:i=1,2,3.....): +# 3.dataSophon.password.i: +# 4.dataSophon.ssh.port.i: +# 5.dataSophon.ssh.port.hostname.i: +dataSophon.ip.1=172.31.51.160 +dataSophon.password.1=max@123!@# +dataSophon.ssh.port.1=22 +dataSophon.ssh.port.hostname.1=dataSophon01 + +dataSophon.ip.2=172.31.51.161 +dataSophon.password.2=max@123!@# +dataSophon.ssh.port.2=22 +dataSophon.ssh.port.hostname.2=dataSophon02 + diff --git a/datasophon-init/config/init.properties b/datasophon-init/config/init.properties new file mode 100644 index 00000000..6c0b7403 --- /dev/null +++ b/datasophon-init/config/init.properties @@ -0,0 +1,36 @@ + +# Whether to configure the local offline yum source true:need/false:needless +yum.repo.need=true +# Set the YUM source host IP +yum.repo.host.ip=172.31.51.160 + +#The Host information for installing the NMAP service +nmap.server.ip=172.31.51.160 +nmap.server.port=22 +nmap.server.password=max@123!@# + +# The Host information for installing the NTP service(Master) +ntp.master.ip=172.31.51.160 + +# Install MySQL machine node information +mysql.ip=172.31.51.160 +mysql.host.ssh.port=22 +mysql.host.ssh.password=max@123!@# + +# Set the MYSQL database login password +mysql.password=datasophon123 + +# The total number of machines needed to be init. +init.host.num=2 + +# The total number of added machines needed to be init. +init.add.host.num=0 + +# Common Settings. +init.log.dir=./logs + +# server operating system Settings : openEuler/centos8/centos7...... +init.os=openEuler + + + diff --git a/datasophon-init/sbin/init.sh b/datasophon-init/sbin/init.sh new file mode 100644 index 00000000..a7d3aea7 --- /dev/null +++ b/datasophon-init/sbin/init.sh @@ -0,0 +1,831 @@ +#!/bin/bash +Action="$1" + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +BASE_DIR=$(dirname $0) + +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +echo "Bash Path: ${BASE_PATH}" +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +DATASOPHON_PATH=$(dirname "${INIT_PATH}") +echo "DATASOPHON_PATH: ${DATASOPHON_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_CONFIG_PATH=${INIT_PATH}/config +echo "INIT_CONFIG_PATH: ${INIT_CONFIG_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +hostAllInfoPath=${INIT_CONFIG_PATH}/init-host-info.properties +echo "hostAllInfoPath: ${hostAllInfoPath}" +hostSingleInfoPath=${INIT_CONFIG_PATH}/init-host-info-add.properties +echo "hostSingleInfoPath: ${hostSingleInfoPath}" +FilePath=${INIT_CONFIG_PATH}/init.properties +echo "FilePath: ${FilePath}" +JDK_PATH=/opt/module +smallTimeOut=300 +middleTimeOut=600 +longTimeOut=1200 + +function prop { + [ -f "$FilePath" ] && grep -P "^\s*[^#]?${1}=.*$" $FilePath | cut -d'=' -f2 +} + +ntpMasterIP=$(prop "ntp.master.ip") +mysqlIP=$(prop "mysql.ip") +mysqlPort=$(prop "mysql.host.ssh.port") +mysqlHostSshPassword=$(prop "mysql.host.ssh.password") +mysqlPassword=$(prop "mysql.password") +nmapServerIp=$(prop "nmap.server.ip") +nmapServerPort=$(prop "nmap.server.port") +nmapServerPassword=$(prop "nmap.server.password") +initLogDir=$(prop "init.log.dir") +yumRepoIp=$(prop "yum.repo.host.ip") +yumRepoNeed=$(prop "yum.repo.need") +initAllHostNums=$(prop "init.host.num") +initSingleHostNums=$(prop "init.add.host.num") +initOS=$(prop "init.os") + +echo "yumRepoIp: ${yumRepoIp}" + +initALL() { + + function network() { + local timeout=8 + local target=www.baidu.com + local ret_code=$(curl -I -s --connect-timeout ${timeout} -m 20 ${target} -w %{http_code} | tail -n1) + if [ "x$ret_code" = "x200" ]; then + return 1 + else + return 0 + fi + return 0 + } + + network + if [ $? -eq 0 ]; then + echo -e "\033[31m 由于机器没有联网,请自行检查设置正确的机器时间! \033[0m" + echo -e "\033[31m 由于机器没有联网,请自行设置好离线yum源! \033[0m" + read -p "Please confirm whether the time displayed by the machine is correct(yes/no):" isCorrect + if [ "$isCorrect" = "yes" ]; then + echo "机器时间设置正常,请进行如下环境初始化操作" + else + echo "机器时间不正确,请设置正确时间后,再进行 DataSophon 初始化环境操作" + exit + fi + else + echo "机器可以联网,无需自行检查系统时间是否正常" + fi + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + rm -rf ${initLogDir}/installAllSuccess_$(date +%Y%m%d).log + + bash ${INIT_BIN_PATH}/init-stop-firewall.sh + bash ${INIT_BIN_PATH}/init-stop-selinux.sh + + if [ "${yumRepoNeed}" == "true" ]; then + #如果文件不存在 + if [ ! -d "/data/private-yum-library" ]; then + echo "没有发现private-yum-library 离线yum资源目录,请确认是否正确配置离线yum源资源包......." + else + mv /etc/yum.repos.d/backup/* /etc/yum.repos.d + mkdir -p /etc/yum.repos.d/backup + mv $(find /etc/yum.repos.d/ -name "*.repo") /etc/yum.repos.d/backup + bash ${INIT_BIN_PATH}/init-private-yum-library-${initOS}.sh ${yumRepoIp} + fi + echo "yum repolist:" + echo "$(yum repolist)" + fi + + secretFreeAllLogin + checkSecretFreeAllLogin + + #Distribution resource pack 分发资源包 + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" + echo "Distribution resource pack start_time:$(date '+%Y%m%d %H:%M:%S')" + pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} + + #close all Firewall + echo "closeAllFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + echo "closeAllFirewall end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log + checkCloseAllFirewall + + #close all selinux + echo "closeAllSelinux start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-selinux.sh >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + echo "closeAllSelinux end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSelinux_$(date +%Y%m%d).log + + #close all Swap + echo "closeAllSwap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-swap.sh >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + echo "closeAllSwap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllSwap_$(date +%Y%m%d).log + checkcloseAllSwap + + #configure all slave node yum source + #因为安装配置yum离线源会涉及到服务器操作系统的版本问题,不同版本的操作系统离线源不同,完全自动化配置工作量巨大,由用户自己配置好 + if [ "${yumRepoNeed}" == "true" ]; then + if [ ! -d "/data/private-yum-library" ]; then + echo "没有发现private-yum-library目录,请确认是否正确配置离线yum源资源包......." + else + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-yum-hosts-mapping-${initOS}.sh ${yumRepoIp} >>${initLogDir}/modifyYumRepo_$(date +%Y%m%d).log + fi + fi + + #optimiz system conf + echo "modifyAllSystemConf start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-system-conf.sh >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + echo "modifyAllSystemConf end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllSystemConf_$(date +%Y%m%d).log + + #Configure all hostname + setAllHostname + checkHostName + + #Configure all hosts + echo "modifyAllhostRelation start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-allhosts.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + echo "modifyAllhostRelation end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifyAllhostRelation_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-sourceSSHHostname.sh + installServerNmap + + #Configure NTP + initAllNtpChronyService + checkNtpChronyService + + #Configurelibxslt_devel + echo "installAlllibxsltdevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-libxslt-devel.sh >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + echo "installAlllibxsltdevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAlllibxsltdevel_$(date +%Y%m%d).log + checkLibxsltDevel + #Configure Psmisc + echo "installAllpsmisc start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-psmisc.sh >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + echo "installAllpsmisc end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllpsmisc_$(date +%Y%m%d).log + checkPsmisc + + echo "installAllPerlJSON start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-perl-JSON.sh >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + echo "installAllPerlJSON end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllPerlJSON_$(date +%Y%m%d).log + + #Configure Mysql and DataSophon data + initMysqlDataSophon + initMysqlDevel + + #Configure Disable transparent-hugepage + echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-transparent-hugepage.sh >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log + checkTransparentHugepage + + #Configure JDK + echo "installAllJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + echo "installAllJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + checkJDK + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-tmp_pid.sh + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-xdg-utils.sh >>${initLogDir}/installXdg_$(date +%Y%m%d).log + checkXdg + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-gcc-c++.sh >>${initLogDir}/installGccC++_$(date +%Y%m%d).log + checkGccC + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-openssl-devel.sh >>${initLogDir}/installOpensslDevel_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-libtool.sh >>${initLogDir}/installLibtool_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-krb5-devel.sh >>${initLogDir}/installKrb5Devel_$(date +%Y%m%d).log + checkKrb5Devel + + #redhat-lsb 配置 和python环境配置暂不需要 + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${middleTimeOut} -i bash ${INIT_BIN_PATH}/init-redhat-lsb.sh >>${initLogDir}/installRedhatLsb_$(date +%Y%m%d).log + #checkRedhatLsb + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python2-rpm-macros.sh >>${initLogDir}/installPython2Macros_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-srpm-macros.sh >>${initLogDir}/installPythonSrpmMacros_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-rpm-macros.sh >>${initLogDir}/installPythonMacros_$(date +%Y%m%d).log + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-init-python-devel.sh >> ${initLogDir}/installPythonDevel_`date +%Y%m%d`.log + #checkPythonDevel + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cyrus-sasl.sh >>${initLogDir}/installCyrusSasl_$(date +%Y%m%d).log + #checkCyrusSasl + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python36-devel.sh >>${initLogDir}/installPython36Devel_$(date +%Y%m%d).log + #checkPython36Devel + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-Cython.sh >>${initLogDir}/installCython_$(date +%Y%m%d).log + #checkCython + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-six.sh >>${initLogDir}/installSix_$(date +%Y%m%d).log + #checkSix + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-websocket_client.sh >>${initLogDir}/installWebsocketClient_$(date +%Y%m%d).log + #checkWebsocketClient + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ecdsa.sh >>${initLogDir}/installEcdsa_$(date +%Y%m%d).log + #checkecdsa + + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-pytest_runner.sh >>${initLogDir}/installPytestRunner_$(date +%Y%m%d).log + #checkPytestRunner + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp_enable.sh >>${initLogDir}/installSingleNtpEnable_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-chmod-dev-null.sh >>${initLogDir}/chmodDevNull_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cleanBuff-async.sh >>${initLogDir}/cleanBuff_$(date +%Y%m%d).log + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + initsource + source /etc/profile + source /root/.bash_profile + echo "The DataSophon deployment environment of all nodes has been inited successfully . Please proceed to the next step" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log + cat ${initLogDir}/installAllSuccess_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllSuccess_$(date +%Y%m%d).log + +} + +initsource() { + source /etc/profile + source /root/.bash_profile + echo $(java -version) +} + +testFun() { + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log +} + +#免密登录 +secretFreeAllLogin() { + echo "secretFreeAllLogin........................" + mkdir -p ${initLogDir} + echo "secretFreeAllLogin start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + rpm -qa | grep openssh + if [[ "$?" == "0" ]]; then + echo "ssh exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + echo "${INIT_BIN_PATH}" + else + bash ${INIT_BIN_PATH}/init-sshpackage.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + fi + rpm -qa | grep sshpass + if [[ "$?" == "0" ]]; then + echo "sshpass exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + else + bash ${INIT_BIN_PATH}/init-sshpass.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + fi + rpm -qa | grep pssh + if [[ "$?" == "0" ]]; then + echo "pssh exists" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + else + bash ${INIT_BIN_PATH}/init-pssh.sh ${initOS} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + fi + + bash ${INIT_BIN_PATH}/init-expect.sh + + bash ${INIT_BIN_PATH}/init-ssh-gen-key.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostAllInfoPath} ${initAllHostNums} ${nmapServerPort} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log + echo "secretFreeAllLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log +} + +#检查免密登录 +checkSecretFreeAllLogin() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${pwd}" + echo "${hostAllInfoPath}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'ls' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' free login failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All free login links have been init successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查所有的swap是否关闭 +checkcloseAllSwap() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /etc/sysctl.conf | grep vm.swappiness=0' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close swap failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All closing swap links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查所有的Firewall是否关闭 +checkCloseAllFirewall() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'firewall-cmd --state' >${initLogDir}/checkCloseAllFirewall.log + cat ${initLogDir}/checkCloseAllFirewall.log | grep running + if [ $? -eq 0 ]; then + echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close firewall failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + else + echo "${ip} close firewall successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + fi + done + echo "SUCCESS: All closing firewall links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#设置所有的的hostname +setAllHostname() { + echo "setAllHostname start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") + + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-hostname.sh ${hostname} >${initLogDir}/setAllHostname_$(date +%Y%m%d).log + done + echo "setAllHostname end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setAllHostname_$(date +%Y%m%d).log +} + +#检查设置所有的的hostname +checkHostName() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # hostname + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'hostname' >${initLogDir}/checkHostName.log + cat ${initLogDir}/checkHostName.log | grep "${hostname}" + if [ $? -eq 0 ]; then + echo "${ip} set hostname successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set hostname failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: set hostname links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#安装nmap +installServerNmap() { + echo "installServerNmap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log + sshpass -p'${nmapServerPassword}' ssh -P${nmapServerPort} -o StrictHostKeyChecking=no root@${nmapServerIp} bash ${INIT_BIN_PATH}/init-nmap.sh >${initLogDir}/installServerNmap_$(date +%Y%m%d).log + echo "installServerNmap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installServerNmap_$(date +%Y%m%d).log +} + +#初始化配置安装Ntp服务 +initAllNtpChronyService() { + echo "initAllNtpChronyService start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + if [ "${ntpMasterIP}" = "${ip}" ]; then + echo "masterntp" + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-server.sh >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + else + echo "slaventp" + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-ntp-chrony-slave.sh ${ntpMasterIP} >${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log + fi + done + echo "initAllNtpChronyService end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initAllNtpChronyService_$(date +%Y%m%d).log +} + +#检查配置安装的Ntp服务 +checkNtpChronyService() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep chrony-' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set ntp failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set ntp Chrony have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的libxslt-devel +checkLibxsltDevel() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep libxslt-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set libxslt devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set libxslt devel have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的Psmisc +checkPsmisc() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep psmisc' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set psmisc failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set psmisc have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#配置安装mysql8以及初始化DataSophon数据库 +initMysqlDataSophon() { + echo "initMysqlDataSophon start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + echo "${mysqlIP}" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + sshpass -p'${mysqlHostSshPassword}' ssh -P${mysqlPort} -o StrictHostKeyChecking=no root@${mysqlIP} bash ${INIT_BIN_PATH}/init-mysql-datasophon.sh $mysqlPassword >${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log + echo "initMysqlDataSophon end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDataSophon_$(date +%Y%m%d).log +} + +#配置安装mysql-devel +initMysqlDevel() { + rm -rf ${INIT_BIN_PATH}/m.txt + echo "initMysqlDevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + + if [ "${mysqlIP}" = "${ip}" ]; then + echo "already install mysql" + else + echo -e "root@${ip}:${port}" >>${INIT_BIN_PATH}/m.txt + fi + done + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-devel.sh >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/m.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-mysql-client.sh >> ${initLogDir}/initMysqlDevel_`date +%Y%m%d`.log + rm -rf ${INIT_BIN_PATH}/m.txt + echo "initMysqlDevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initMysqlDevel_$(date +%Y%m%d).log +} + +#检查配置配置安装Cython +checkCython() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep Cython' >${initLogDir}/checkCython.log + cat ${initLogDir}/checkCython.log | grep Cython + if [ $? -eq 0 ]; then + echo "${ip} set Cython successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set Cython failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set Cython links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} +#检查配置配置安装Six +checkSix() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep six' >${initLogDir}/checkSix.log + cat ${initLogDir}/checkSix.log | grep six + if [ $? -eq 0 ]; then + echo "${ip} set Six successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set Six failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set Six links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装WebsocketClient +checkWebsocketClient() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep websocket-client' >${initLogDir}/checkWebsocketClient.log + cat ${initLogDir}/checkWebsocketClient.log | grep websocket-client + if [ $? -eq 0 ]; then + echo "${ip} set websocket-client successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set websocket-client failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set websocket-client links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#配置禁止透明大页 +checkTransparentHugepage() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep [never]' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' close transparent_hugepage failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: All transparent_hugepage links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的jdk环境 +checkJDK() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'source /etc/profile ; java -version' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set jdk failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set JDK links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的xdg-utils +checkXdg() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep xdg-utils' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set xdg-utils failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set xdg-utils links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +#检查配置安装的redhat-lsb +checkRedhatLsb() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep redhat-lsb' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set redhat-lsb failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set redhat-lsb links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkecdsa() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep ecdsa' >${initLogDir}/checkecdsa.log + cat ${initLogDir}/checkecdsa.log | grep ecdsa + if [ $? -eq 0 ]; then + echo "${ip} set ecdsa successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set ecdsa failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set ecdsa links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkPytestRunner() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'pip3 list | grep pytest-runner' >${initLogDir}/checkPytestRunner.log + cat ${initLogDir}/checkPytestRunner.log | grep pytest-runner + if [ $? -eq 0 ]; then + echo "${ip} set pytest-runner successfully" >>${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set pytest-runner failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set pytest-runner links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkGccC() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep gcc-c++' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set gcc-c++ failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set gcc-c++ failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set gcc-c++ links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +checkKrb5Devel() { + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep krb5-devel' >${initLogDir}/installAll_$(date +%Y%m%d).log + else + echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAll_$(date +%Y%m%d).log + echo "ERROR: '${ip}' set krb5-devel failed" >>${initLogDir}/installAllError_$(date +%Y%m%d).log + cat ${initLogDir}/installAllError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installAllError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: Set krb5-devel links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log +} + +if [ "$Action" = "initAll" ]; then + initALL + echo "initALL....................." +fi +if [ "$Action" = "secretFreeAllLogin" ]; then + secretFreeAllLogin +fi +if [ "$Action" = "checkcloseAllSwap" ]; then + checkcloseAllSwap +fi + +if [ "$Action" = "testFun" ]; then + testFun +fi From 617701e08d13955c9b3631a54c161dda724b4476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Fri, 18 Aug 2023 17:20:49 +0800 Subject: [PATCH 05/11] first commit logs --- .../sbin/logs/installAll_20230818.log | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 datasophon-init/sbin/logs/installAll_20230818.log diff --git a/datasophon-init/sbin/logs/installAll_20230818.log b/datasophon-init/sbin/logs/installAll_20230818.log new file mode 100644 index 00000000..e35f8c8a --- /dev/null +++ b/datasophon-init/sbin/logs/installAll_20230818.log @@ -0,0 +1,22 @@ +172.31.51.160 free login successfully +172.31.51.161 free login successfully +172.31.51.160 close firewall successfully +172.31.51.161 close firewall successfully +172.31.51.160 close swap successfully +172.31.51.161 close swap successfully +172.31.51.160 set hostname successfully +172.31.51.161 set hostname successfully +172.31.51.160 set ntp successfully +172.31.51.161 set ntp successfully +172.31.51.160 set libxslt devel successfully +172.31.51.161 set libxslt devel successfully +172.31.51.160 set psmisc successfully +172.31.51.161 set psmisc successfully +172.31.51.160 close transparent_hugepage successfully +172.31.51.161 close transparent_hugepage successfully +172.31.51.160 set jdk successfully +172.31.51.161 set jdk successfully +172.31.51.160 set xdg-utils successfully +172.31.51.161 set xdg-utils successfully +172.31.51.160 set krb5-devel successfully +172.31.51.161 set krb5-devel successfully From 2ea4654477395696375f7e6e9b86734eec574a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Fri, 18 Aug 2023 17:32:02 +0800 Subject: [PATCH 06/11] commit README.md --- datasophon-init/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datasophon-init/README.md b/datasophon-init/README.md index 37b5a203..38a4b6d3 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -71,6 +71,7 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql ### init.properties 说明 +yum.repo.need:填写是否需要部署私有化yum源(true:需要/false:不需要,如服务器不能连接外网必须部署私有化yum源) yum.repo.host.ip:填写即将部署私有化yum源的节点的内网IP(即执行init脚本的节点IP,推荐在主节点上进行) namp.server.ip=:填写未来要部署的datasophon管理端的节点内网IP namp.server.port:填写未来要部署的datasophon管理端节点的SSH端口号,默认22 @@ -82,7 +83,8 @@ mysql.host.ssh.password: 填写未来要部署mysql数据库的节点服务器 mysql.password: 填写未来要部署mysql数据库的root密码,这个密码不要有特殊字符比如‘,’、‘$’等,可在初始化完成之后再自行设置高复杂度密码 init.host.num: 填写未来要初始化的服务器数量 init.add.host.num: 填写未来要初始化的新增服务器节点数量,全量初始化时无需修改 -init.log.dir=./logs :设置初始化服务器环境时日志存放目录 +init.log.dir :设置初始化服务器环境时日志存放目录 +init.os :填写服务器操作系统类型openEuler/centos8/centos7...... ### init-host-info.properties 说明 @@ -101,13 +103,13 @@ dataSophon.ssh.port.hostname.i=dataSophon0 #预备安装dataSophon集群的节 PS:执行的 cd /data/datasophon-init/sbin -bash init.sh initAll +bash init.sh initAll (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) source /etc/profile 当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" -##当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64 +##当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64、openEuler-22.03 ##当前初始化模块支持的mysql为:mysql-community-8.0.28 ##自动安装的JDK为:jdk-8u333 From 269fc9a74e43a4109eed7fe2708d0cb0407d1c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Mon, 21 Aug 2023 09:11:53 +0800 Subject: [PATCH 07/11] README.md format optimization --- datasophon-init/README.md | 140 +++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/datasophon-init/README.md b/datasophon-init/README.md index 38a4b6d3..60467d9f 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -16,82 +16,82 @@ English

-

觉得不错的话,star fork下,欢迎社区开发者共建DataSophon

-# dataSophon-init使用说明 -前言:当前版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配 -1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); -2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压;链接:https://pan.baidu.com/s/1iqudVwDgg2x_OO35VLkkSg 提取码:6zrz -3、在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); - 离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源,该步骤都是在主节点上操作): - 配置脚本为:init-private-yum-library-${initOS}.sh - ①首先创建目录 'mkdir -p /data/private-yum-library_temp'然后将和操作系统匹配的操作系统iso文件移动到/data/目录下; - ②在/data目录下创建private-yum-library目录:'mkdir -p /data/private-yum-library'; - ③执行挂载操作系统命令:mount -o loop /data/openEuler-22.03-LTS-SP2-everything-x86_64-dvd.iso /data/private-yum-library_temp - 这种挂载重启服务器之后会失效,所以我们挂载完成后将ios内的文件全部拷贝出来做离线yum源用; - ④在private-yum-library目录下创建两个子目录 repo 和 epel; - ⑤将private-yum-library_temp目录下的文件全部拷贝到/data/private-yum-library/repo目录下:cp -r /data/private-yum-library_temp/* /data/private-yum-library/repo - 另外不同操作系统挂载后所产生的目录不同,比如centos8的repo有两个BaseOS和AppStream; - ⑥将原本的yum源的配置文件进行备份 :mkdir -p /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak - ⑦剩下的工作就交给脚本工具自己去处理了,epel目录是为了给需要自行配置离线eprl源的用户准备的,如果能配置epel建议进行配置,因为很多操作系统额外的很多工具包都在对应的epel中 - -4、集群NTP时钟默认使用Chrony,如使用其它的方式请自行安装配置,并将sbin/init.sh 脚本中的 initALL() 方法中的‘initAllNtpChronyService’ 和 ‘checkNtpChronyService’方法注释掉避免重复安装; -5、脚本的初始化需要用到python环境,主要用到pssh进行集群间的命令执行控制,目前packages目录中pssh.tar.gz中已经内置了三个安装包 - pssh-2.3.1-5.el7.noarch.rpm 需要python2.7的支持 - pssh-2.3.1-29.el8.noarch.rpm 需要python3.6的支持 - pssh-2.3.4-1.el9.noarch.rpm 需要python3.9的支持 - Centos7和8中的repo中已经存在对应的rpm格式的pssh包了,目前openEuler22.03中还没有pssh相关的安装包 +

觉得不错的话,star fork下,欢迎社区开发者共建DataSophon

+ +# dataSophon-init使用说明 + +前言:当前版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配 +1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); +2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压;下载链接:https://pan.baidu.com/s/1iqudVwDgg2x_OO35VLkkSg 提取码:6zrz +3、在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); +离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源,该步骤都是在主节点上操作): + 详情可查看配置脚本:init-private-yum-library-${initOS}.sh + ①首先创建目录 'mkdir -p /data/private-yum-library_temp'然后将和操作系统匹配的操作系统iso文件移动到/data/目录下; + ②在/data目录下创建private-yum-library目录:'mkdir -p /data/private-yum-library'; + ③执行挂载操作系统命令:mount -o loop /data/openEuler-22.03-LTS-SP2-everything-x86_64-dvd.iso /data/private-yum-library_temp,这种挂载重启服务器之后会失效,所以我们挂载完成后将ios内的文件全部拷贝出来做离线yum源用; + ④在private-yum-library目录下创建两个子目录 repo 和 epel; + ⑤将private-yum-library_temp目录下的文件全部拷贝到/data/private-yum-library/repo目录下:cp -r /data/private-yum-library_temp/* /data/private-yum-library/repo,另外不同操作系统挂载后所产生的目录不同,比如centos8的repo有两个BaseOS和AppStream; + ⑥将原本的yum源的配置文件进行备份 :mkdir -p /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak; + ⑦剩下的工作就交给脚本工具自己去处理了,epel目录是为了给需要自行配置离线eprl源的用户准备的,如果能配置epel建议进行配置,因为很多操作系统额外的很多工具包都在对应的epel中; + +4、集群NTP时钟默认使用Chrony,如使用其它的方式请自行安装配置,并将sbin/init.sh 脚本中的 initALL() 方法中的‘initAllNtpChronyService’ 和 ‘checkNtpChronyService’方法注释掉避免重复安装; +5、脚本的初始化需要用到python环境,主要用到pssh进行集群间的命令执行控制,目前packages目录中pssh.tar.gz中已经内置了三个安装包: + pssh-2.3.1-5.el7.noarch.rpm 需要python2.7的支持; + pssh-2.3.1-29.el8.noarch.rpm 需要python3.6的支持; + pssh-2.3.4-1.el9.noarch.rpm 需要python3.9的支持; + Centos7和8中的repo中已经存在对应的rpm格式的pssh包了,目前openEuler22.03中还没有pssh相关的安装包, 其它版本pssh的rpm包下载工具地址:http://rpmfind.net/linux/rpm2html/search.php?query=pssh,可以根据操作系统和python版本进行适配 -6、服务器操作系统的iso文件建议使用everything版本的,这样包含的依赖包更全一点; +6、服务器操作系统的iso文件建议使用everything版本的,这样包含的依赖包更全一点; -dataSophon-init目录结构如下: -[root@localhost datasophon-init]# ls -l -总用量 8 -drwxr-xr-x 2 root root 4096 8月 10 17:09 bin -drwxr-xr-x 2 root root 99 7月 28 16:10 config -drwxr-xr-x 8 root root 4096 8月 9 13:47 packages -drwxr-xr-x 2 root root 189 7月 27 11:35 remove -drwxr-xr-x 3 root root 50 8月 10 20:02 sbin -drwxr-xr-x 2 root root 70 8月 7 10:54 sql +# dataSophon-init目录结构如下: +[root@localhost datasophon-init]# ls -l +总用量 8 +drwxr-xr-x 2 root root 4096 8月 10 17:09 bin +drwxr-xr-x 2 root root 99 7月 28 16:10 config +drwxr-xr-x 8 root root 4096 8月 9 13:47 packages +drwxr-xr-x 2 root root 189 7月 27 11:35 remove +drwxr-xr-x 3 root root 50 8月 10 20:02 sbin +drwxr-xr-x 2 root root 70 8月 7 10:54 sql -上面的各个目录解释如下: +## 上面的各个目录解释如下: -* bin:datasophon 服务器集群环境配置初始化程序脚本(单个模块初始化脚本所在目录,无需手动管理) -* config:datasophon 服务器集群环境一键初始化所需配置文件目录,需要用户手动修改 -* packages:初始化过程需要的依赖安装包存放目录 -* remove:卸载环境脚本 -* sbin:一键初始化环境脚本所在目录 -* sql:datasophon数据库初始化sql脚本所在目录 +* bin:datasophon 服务器集群环境配置初始化程序脚本(单个模块初始化脚本所在目录,无需手动管理); +* config:datasophon 服务器集群环境一键初始化所需配置文件目录,需要用户手动修改; +* packages:初始化过程需要的依赖安装包存放目录; +* remove:卸载环境脚本; +* sbin:一键初始化环境脚本所在目录; +* sql:datasophon数据库初始化sql脚本所在目录; -在 config 目录下面有三个配置文件: -* init.properties:主要配置私有化 yum 源安装节点信息、namp 安装节点信息、mysql 数据库安装节点信息、修复机器总数,以及修复模块日志存放位置。用户根据需要自行修改相关配置项; +### 在 config 目录下面有三个配置文件: +* init.properties:主要配置私有化 yum 源安装节点信息、namp 安装节点信息、mysql 数据库安装节点信息、修复机器总数、服务器操作系统类型、以及修复模块日志存放位置。用户根据需要自行修改相关配置项; * init-host-info.properties:节点全量修复,需要配置此文件,具体配置所有节点内网 Ip、密码、端口号以及主机名; * init-host-info-add.properties:集群新增节点时,需要配置此文件,具体配置新增节点内网 Ip、密码、端口号以及主机名; ### init.properties 说明 -yum.repo.need:填写是否需要部署私有化yum源(true:需要/false:不需要,如服务器不能连接外网必须部署私有化yum源) -yum.repo.host.ip:填写即将部署私有化yum源的节点的内网IP(即执行init脚本的节点IP,推荐在主节点上进行) -namp.server.ip=:填写未来要部署的datasophon管理端的节点内网IP -namp.server.port:填写未来要部署的datasophon管理端节点的SSH端口号,默认22 -namp.server.password:填写未来要部署的datasophon管理端节点的密码,这个密码最好不要有特殊字符比如‘,’、‘$’等 -ntp.master.ip: 填写未来要部署ntp时钟同步的主节点服务器IP(推荐主节点) -mysql.ip: 填写未来要部署mysql数据库的节点服务器IP(推荐主节点) -mysql.host.ssh.port: 填写未来要部署mysql数据库的节点服务器SSH端口,默认为22 -mysql.host.ssh.password: 填写未来要部署mysql数据库的节点服务器的密码 -mysql.password: 填写未来要部署mysql数据库的root密码,这个密码不要有特殊字符比如‘,’、‘$’等,可在初始化完成之后再自行设置高复杂度密码 -init.host.num: 填写未来要初始化的服务器数量 -init.add.host.num: 填写未来要初始化的新增服务器节点数量,全量初始化时无需修改 -init.log.dir :设置初始化服务器环境时日志存放目录 -init.os :填写服务器操作系统类型openEuler/centos8/centos7...... +* yum.repo.need:填写是否需要部署私有化yum源(true:需要/false:不需要,如服务器不能连接外网必须部署私有化yum源); +* yum.repo.host.ip:填写即将部署私有化yum源的节点的内网IP(即执行init脚本的节点IP,推荐在主节点上进行); +* namp.server.ip=:填写未来要部署的datasophon管理端的节点内网IP; +* namp.server.port:填写未来要部署的datasophon管理端节点的SSH端口号,默认22; +* namp.server.password:填写未来要部署的datasophon管理端节点的密码,这个密码最好不要有特殊字符比如‘,’、‘$’等; +* ntp.master.ip: 填写未来要部署ntp时钟同步的主节点服务器IP(推荐主节点); +* mysql.ip: 填写未来要部署mysql数据库的节点服务器IP(推荐主节点); +* mysql.host.ssh.port: 填写未来要部署mysql数据库的节点服务器SSH端口,默认为22; +* mysql.host.ssh.password: 填写未来要部署mysql数据库的节点服务器的密码; +* mysql.password: 填写未来要部署mysql数据库的root密码,这个密码不要有特殊字符比如‘,’、‘$’等,可在初始化完成之后再自行设置高复杂度密码; +* init.host.num: 填写未来要初始化的服务器数量; +* init.add.host.num: 填写未来要初始化的新增服务器节点数量,全量初始化时无需修改; +* init.log.dir :设置初始化服务器环境时日志存放目录; +* init.os :填写服务器操作系统类型openEuler/centos8/centos7......; ### init-host-info.properties 说明 -dataSophon.ip.i=172.31.51.194 #预备安装dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量) -dataSophon.password.i=xxxxx #预备安装dataSophon集群的节点的登录密码 -dataSophon.ssh.port.i=22 #预备安装dataSophon集群的节点的SSH端口默认22 -dataSophon.ssh.port.hostname.i=dataSophon0 #预备安装dataSophon集群的节点的主机名 +* dataSophon.ip.i=172.31.51.194 #预备安装dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量); +* dataSophon.password.i=xxxxx #预备安装dataSophon集群的节点的登录密码; +* dataSophon.ssh.port.i=22 #预备安装dataSophon集群的节点的SSH端口默认22; +* dataSophon.ssh.port.hostname.i=dataSophon01 #预备安装dataSophon集群的节点的主机名; ## 全量初始化流程 @@ -99,19 +99,19 @@ dataSophon.ssh.port.hostname.i=dataSophon0 #预备安装dataSophon集群的节 ![img](website/static/img/Initialization-process.png) ### 执行初始化脚本 + 完成上述步骤后,执行如下命令即可开始一键初始化任务。 -PS:执行的 -cd /data/datasophon-init/sbin -bash init.sh initAll (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) -source /etc/profile +cd /data/datasophon-init/sbin +bash init.sh initAll (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) +source /etc/profile -当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 -其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" +当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 +其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" -##当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64、openEuler-22.03 -##当前初始化模块支持的mysql为:mysql-community-8.0.28 -##自动安装的JDK为:jdk-8u333 +#### 当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64、openEuler-22.03 +####当前初始化模块支持的mysql为:mysql-community-8.0.28 +####自动安装的JDK为:jdk-8u333 From a16544a594414832fcae684d8a702b9009a14699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B5=B7?= Date: Tue, 22 Aug 2023 15:57:18 +0800 Subject: [PATCH 08/11] =?UTF-8?q?Added=20the=20node=20initialization=20cap?= =?UTF-8?q?ability=20README.md=20file=20=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datasophon-init/README.md | 21 +- datasophon-init/bin/init-singlehosts.sh | 62 +++ datasophon-init/bin/init-ssh-hadoop.sh | 1 - datasophon-init/sbin/init.sh | 498 +++++++++++++++++++++++- 4 files changed, 573 insertions(+), 9 deletions(-) create mode 100644 datasophon-init/bin/init-singlehosts.sh diff --git a/datasophon-init/README.md b/datasophon-init/README.md index 60467d9f..3ac00662 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -93,6 +93,13 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql * dataSophon.ssh.port.i=22 #预备安装dataSophon集群的节点的SSH端口默认22; * dataSophon.ssh.port.hostname.i=dataSophon01 #预备安装dataSophon集群的节点的主机名; +### init-host-info-add.properties 说明 + +* dataSophon.ip.i=172.31.51.162 #预备新增dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量); +* dataSophon.password.i=xxxxx #预备新增安装dataSophon集群的节点的登录密码; +* dataSophon.ssh.port.i=22 #预备新增安装dataSophon集群的节点的SSH端口默认22; +* dataSophon.ssh.port.hostname.i=dataSophon05 #预备新增安装dataSophon集群的节点的主机名; + ## 全量初始化流程 @@ -104,14 +111,24 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql cd /data/datasophon-init/sbin bash init.sh initAll (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) -source /etc/profile +PS:执行完毕之后如果服务器的终端未关闭,可能会出现一些命令无效的情况,此时需要手动在终端执行 ‘source /etc/profile ’使环境变量生效,或者关闭终端重新打开 当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" #### 当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64、openEuler-22.03 ####当前初始化模块支持的mysql为:mysql-community-8.0.28 -####自动安装的JDK为:jdk-8u333 +####自动安装的JDK为:jdk-8u333(jdk在安装datasophon的时候会自动配置,初始化工具不会再次进行重复配置) + + +## 新增节点初始化流程 + +将config/init.properties文件中的'init.add.host.num'参数修改为即将新增加的节点的实际数量,只支持整数; +编辑config/init-host-info-add.properties,将文件中的指定信息按照既定格式进行修改,主要包括新增节点的ip、password、sshport、hostname; +完成上述步骤后,执行如下命令即可开始一键初始化任务。 +cd /data/datasophon-init/sbin +bash init.sh initSingleNode (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) +PS:执行完毕之后如果服务器的终端未关闭,可能会出现一些命令无效的情况,此时需要手动在终端执行 ‘source /etc/profile ’使环境变量生效,或者关闭终端重新打开 diff --git a/datasophon-init/bin/init-singlehosts.sh b/datasophon-init/bin/init-singlehosts.sh new file mode 100644 index 00000000..0deb3838 --- /dev/null +++ b/datasophon-init/bin/init-singlehosts.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +hostAllInfoPath="$1" +initAllHostNums="$2" + +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) + +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" +INIT_BIN_PATH=${INIT_PATH}/bin +echo "INIT_BIN_PATH: ${INIT_BIN_PATH}" +INIT_SBIN_PATH=${INIT_PATH}/sbin +echo "INIT_SBIN_PATH: ${INIT_SBIN_PATH}" +PACKAGES_PATH=${INIT_PATH}/packages +echo "PACKAGES_PATH: ${PACKAGES_PATH}" +ETC_HOST=/etc/hosts +sed -i '/#modify etc hosts start/,/#modify etc hosts end/d' /etc/hosts +modifyHosts() { + cat /etc/hosts | grep yum + if [ $? -eq 0 ]; then + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts start' /etc/hosts + while read line || [[ -n ${line} ]]; do + ip=$(echo $line | cut -d " " -f1) + port=$(echo $line | cut -d " " -f3) + hostname=$(echo $line | cut -d " " -f4) + echo "ip: ${ip}" + echo "port: ${port}" + echo "resule:${ip} ${hostname}" + sed -i '/#modify yum mapping hosts start/i '${ip}' '${hostname}'' /etc/hosts + done <${hostAllInfoPath} + sed -i '/#modify yum mapping hosts start/i\#modify etc hosts end' /etc/hosts + else + echo "#modify etc hosts start" >>/etc/hosts + while read line || [[ -n ${line} ]]; do + ip=$(echo $line | cut -d " " -f1) + port=$(echo $line | cut -d " " -f3) + hostname=$(echo $line | cut -d " " -f4) + echo "ip: ${ip}" + echo "port: ${port}" + echo "${ip} ${hostname}" >>/etc/hosts + done <${hostAllInfoPath} + echo "#modify etc hosts end" >>/etc/hosts + fi +} + +modifyHosts +sed -i 's/^[^#].*[0-9]-[0-9]/#&/g' /etc/hosts + +echo "init-singlehosts.sh finished." +echo "Done." diff --git a/datasophon-init/bin/init-ssh-hadoop.sh b/datasophon-init/bin/init-ssh-hadoop.sh index 765252ca..9b5c08b1 100644 --- a/datasophon-init/bin/init-ssh-hadoop.sh +++ b/datasophon-init/bin/init-ssh-hadoop.sh @@ -27,7 +27,6 @@ echo "PACKAGES_PATH: ${PACKAGES_PATH}" sshHadoopDir=/home/hadoop/.ssh/ rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${filePath} ${initAllHostNums} - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-add-hadoop-user.sh pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p /home/hadoop/" pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r /root/.ssh /home/hadoop/ diff --git a/datasophon-init/sbin/init.sh b/datasophon-init/sbin/init.sh index a7d3aea7..ff2dbaa3 100644 --- a/datasophon-init/sbin/init.sh +++ b/datasophon-init/sbin/init.sh @@ -56,6 +56,7 @@ initOS=$(prop "init.os") echo "yumRepoIp: ${yumRepoIp}" +#初始化所有节点 initALL() { function network() { @@ -186,11 +187,11 @@ initALL() { echo "closeAllTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllTransparentHugepage_$(date +%Y%m%d).log checkTransparentHugepage - #Configure JDK - echo "installAllJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - echo "installAllJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log - checkJDK + #Configure JDK(datasophon在安装的时候会自动安装jdk,这里不在重复安装) + #echo "installAllJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + #echo "installAllJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installAllJDK_$(date +%Y%m%d).log + #checkJDK pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-tmp_pid.sh @@ -253,6 +254,116 @@ initALL() { } +#初始化新增加的单节点 +initSingleNode() { + mkdir -p ${initLogDir}/logs + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + rm -rf ${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log + + secretFreeSingleNodeLogin + checkSecretFreeSingleNodeLogin + + #Distribution resource pack 分发资源包 + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" + echo "Distribution resource pack start_time:$(date '+%Y%m%d %H:%M:%S')" + pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} + + #close all Firewall + echo "closeSingleNodeFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeFirewall_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeSingleNodeFirewall_$(date +%Y%m%d).log + echo "closeSingleNodeFirewall end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeFirewall_$(date +%Y%m%d).log + checkCloseSingleNodeFirewall + + #close all selinux + echo "closeSingleNodeSelinux start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeSelinux_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-selinux.sh >>${initLogDir}/closeSingleNodeSelinux_$(date +%Y%m%d).log + echo "closeSingleNodeSelinux end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeSelinux_$(date +%Y%m%d).log + + #close all Swap + echo "closeSingleNodeSwap start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeSwap_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-swap.sh >>${initLogDir}/closeSingleNodeSwap_$(date +%Y%m%d).log + echo "closeSingleNodeSwap end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeSwap_$(date +%Y%m%d).log + checkCloseSingleNodeSwap + + #configure all slave node yum source + #因为安装配置yum离线源会涉及到服务器操作系统的版本问题,不同版本的操作系统离线源不同,完全自动化配置工作量巨大,由用户自己配置好 + if [ "${yumRepoNeed}" == "true" ]; then + if [ ! -d "/data/private-yum-library" ]; then + echo "没有发现private-yum-library目录,请确认是否正确配置离线yum源资源包......." + else + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-yum-hosts-mapping-${initOS}.sh ${yumRepoIp} >>${initLogDir}/modifySingleNodeYumRepo_$(date +%Y%m%d).log + fi + fi + + echo "modifySingleNodeSystemConf start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifySingleNodeSystemConf_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-system-conf.sh >>${initLogDir}/modifySingleNodeSystemConf_$(date +%Y%m%d).log + echo "modifySingleNodeSystemConf end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifySingleNodeSystemConf_$(date +%Y%m%d).log + + setSingleNodeHostname + checkSingleNodeHostName + + modifySingleNodeHostRelation + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-sourceSSHHostname.sh + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp-chrony-slave.sh ${ntpMasterIP} + checkSingleNodeNtpService + + echo "installSingleNodelibxsltdevel start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodelibxsltdevel_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-libxslt-devel.sh >>${initLogDir}/installSingleNodelibxsltdevel_$(date +%Y%m%d).log + echo "installSingleNodelibxsltdevel end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodelibxsltdevel_$(date +%Y%m%d).log + checkSingleNodeLibxsltDevel + + echo "installSingleNodepsmisc start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodepsmisc_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-psmisc.sh >>${initLogDir}/installSingleNodepsmisc_$(date +%Y%m%d).log + echo "installSingleNodepsmisc end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodepsmisc_$(date +%Y%m%d).log + checkSingleNodePsmisc + + echo "installSingleNodePerlJSON start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodePerlJSON_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-perl-JSON.sh >>${initLogDir}/installSingleNodePerlJSON_$(date +%Y%m%d).log + echo "installSingleNodePerlJSON end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodePerlJSON_$(date +%Y%m%d).log + + echo "closeSingleNodeTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeTransparentHugepage_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-close-transparent-hugepage.sh >>${initLogDir}/closeSingleNodeTransparentHugepage_$(date +%Y%m%d).log + echo "closeSingleNodeTransparentHugepage start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeTransparentHugepage_$(date +%Y%m%d).log + checkSingleNodeTransparentHugepage + + #datasophon在安装的时候会自动安装jdk,这里不在重复安装 + #echo "installSingleNodeJDK start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodeJDK_$(date +%Y%m%d).log + #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-jdk.sh >>${initLogDir}/installSingleNodeJDK_$(date +%Y%m%d).log + #echo "installSingleNodeJDK end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/installSingleNodeJDK_$(date +%Y%m%d).log + #checkSingleNodeJDK + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifySingleNodeJavaPolicy_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-tmp_pid.sh + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-xdg-utils.sh >>${initLogDir}/installSingleNodeXdg_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-gcc-c++.sh >>${initLogDir}/installSingleNodeGccC++_$(date +%Y%m%d).log + checkSingleNodeGccC + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-openssl-devel.sh >>${initLogDir}/installSingleNodeOpensslDevel_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-libtool.sh >>${initLogDir}/installSingleNodeLibtool_$(date +%Y%m%d).log + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-krb5-devel.sh >>${initLogDir}/installSingleNodeKrb5Devel_$(date +%Y%m%d).log + checkSingleNodeKrb5Devel + + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp_enable.sh >>${initLogDir}/installSingleNodeNtpEnable_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-chmod-dev-null.sh >>${initLogDir}/initSingleNodeChmodDevNull_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cleanBuff-async.sh >>${initLogDir}/initSingleNodeCleanBuff_$(date +%Y%m%d).log + rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt + rm -rf ${INIT_BIN_PATH}/1.txt + initsource + source /etc/profile + source /root/.bash_profile + echo "The DataSophon deployment environment of added nodes has been inited successfully . Please proceed to the next step" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log + +} + initsource() { source /etc/profile source /root/.bash_profile @@ -263,6 +374,7 @@ testFun() { pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-java-policy.sh >>${initLogDir}/modifyJavaPolicy_$(date +%Y%m%d).log } +#---------------------------initAll fun start-------------------------------# #免密登录 secretFreeAllLogin() { echo "secretFreeAllLogin........................" @@ -814,10 +926,384 @@ checkKrb5Devel() { done echo "SUCCESS: Set krb5-devel links have been inited successfully" >>${initLogDir}/installAllSuccess_$(date +%Y%m%d).log } +#---------------------------initAll fun end-------------------------------# + +#---------------------------init add Single node fun strat-------------------------------# + +secretFreeSingleNodeLogin() { + echo "secretFreeSingleNodeLogin start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostSingleInfoPath} ${initSingleHostNums} ${nampServerPort} >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostSingleInfoPath} ${initSingleHostNums} >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log + echo "secretFreeSingleNodeLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log +} + +checkSecretFreeSingleNodeLogin() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + echo "${BASE_PATH}" + echo "${pwd}" + echo "${hostSingleInfoPath}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'ls' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' free login failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' free login failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added free login links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkCloseSingleNodeFirewall() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'firewall-cmd --state' >${initLogDir}/checkCloseSingleNodeFirewall.log + cat ${initLogDir}/checkCloseSingleNodeFirewall.log | grep running + if [ $? -eq 0 ]; then + echo "ERROR: The added '${ip}' close firewall failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' close firewall failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + else + echo "The added ${ip} close firewall successfully" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + fi + done + echo "SUCCESS:The added closing firewall links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkCloseSingleNodeSwap() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /etc/sysctl.conf | grep vm.swappiness=0' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' close swap failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' close swap failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added closing swap links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +setSingleNodeHostname() { + echo "setSingleNodeHostname start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setSingleNodeHostname_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") + echo "${ip}" + echo "${pwd}" + echo "${port}" + echo "${BASE_PATH}" + echo "root@${ip}:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setSingleNodeHostname_$(date +%Y%m%d).log + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} bash ${INIT_BIN_PATH}/init-hostname.sh ${hostname} >${initLogDir}/setSingleNodeHostname_$(date +%Y%m%d).log + done + echo "setSingleNodeHostname start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/setSingleNodeHostname_$(date +%Y%m%d).log +} + +checkSingleNodeHostName() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + hostname=$(prop "dataSophon.ssh.port.hostname.${i}") # hostname + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'hostname' >${initLogDir}/checkHostName.log + cat ${initLogDir}/checkHostName.log | grep "${hostname}" + if [ $? -eq 0 ]; then + echo "The added ${ip} hostname sets successfully" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' hostname failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' hostname failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added hostname links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +modifySingleNodeHostRelation() { + rm -rf ${INIT_BIN_PATH}/tmp_host_info.txt + rm -rf ${INIT_BIN_PATH}/tmp_host_all_info.txt + initTotalHostNums=$(expr $initAllHostNums + $initSingleHostNums) + echo "modifySingleNodeHostRelation start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ipSingle=$(prop "dataSophon.ip.${i}") #ip + passwordSingle=$(prop "dataSophon.password.${i}") # password + portSingle=$(prop "dataSophon.ssh.port.${i}") # port + hostnameSingle=$(prop "dataSophon.ssh.port.hostname.${i}") + echo "${ip}" + echo "${pwd}" + echo "${port}" + echo "${BASE_PATH}" + echo -e "${ipSingle} ${passwordSingle} ${portSingle} ${hostnameSingle}" >>${INIT_BIN_PATH}/tmp_host_all_info.txt + echo "${ipSingle} ${passwordSingle} ${portSingle} ${hostnameSingle}" >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + done + + function prop { + [ -f "${hostAllInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostAllInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initAllHostNums}; i++)); do + ipAll=$(prop "dataSophon.ip.${i}") #ip + passwordAll=$(prop "dataSophon.password.${i}") # password + portAll=$(prop "dataSophon.ssh.port.${i}") # port + hostnameAll=$(prop "dataSophon.ssh.port.hostname.${i}") + echo "${ip}" + echo "${pwd}" + echo "${port}" + echo "${BASE_PATH}" + echo -e "${ipAll} ${passwordAll} ${portAll} ${hostnameAll}" >>${INIT_BIN_PATH}/tmp_host_all_info.txt + echo "${ipAll} ${passwordAll} ${portAll} ${hostnameAll}" >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + done + hostInfoPath=${INIT_BIN_PATH}/tmp_host_all_info.txt + while read line || [[ -n ${line} ]]; do + ip=$(echo $line | cut -d " " -f1) + port=$(echo $line | cut -d " " -f3) + echo -e "root@${ip}:${port}" >>${INIT_BIN_PATH}/tmp_host_info.txt + done <${hostInfoPath} + pscp.pssh -h ${INIT_BIN_PATH}/tmp_host_info.txt ${INIT_BIN_PATH}/tmp_host_all_info.txt ${INIT_BIN_PATH}/ + echo "${hostInfoPath} ${initTotalHostNums}" >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + pssh -h ${INIT_BIN_PATH}/tmp_host_info.txt -i bash ${INIT_BIN_PATH}/init-singlehosts.sh ${hostInfoPath} ${initTotalHostNums} >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + echo "modifySingleNodeHostRelation end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/modifySingleNodeHostRelation_$(date +%Y%m%d).log + rm -rf ${INIT_BIN_PATH}/tmp_host_info.txt + rm -rf ${INIT_BIN_PATH}/tmp_host_all_info.txt +} + +checkSingleNodeNtpService() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep chrony-' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set ntp failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set ntp failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS:The added nodes ntp have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkSingleNodeLibxsltDevel() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep libxslt-devel' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set libxslt devel failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set libxslt devel failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS:The added nodes Set libxslt devel have been inited successfully" >>${initLogDir}/installSingleSuccess_$(date +%Y%m%d).log +} + +checkSingleNodePsmisc() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep psmisc' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set psmisc failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set psmisc failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added nodes set psmisc have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkSingleNodeTransparentHugepage() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'cat /sys/kernel/mm/transparent_hugepage/enabled | grep [never]' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' close transparent_hugepage failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' close transparent_hugepage failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added nodes transparent_hugepage links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkSingleNodeJDK() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'source /etc/profile ; java -version' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set jdk failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set jdk failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added nodes set JDK links have been inited successfully" >>${initLogDir}/installSingleodeSuccess_$(date +%Y%m%d).log +} + +checkSingleNodeGccC() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep gcc-c++' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set gcc-c++ failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set gcc-c++ failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added nodes set gcc-c++ links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +checkSingleNodeKrb5Devel() { + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + function prop { + [ -f "${hostSingleInfoPath}" ] && grep -P "^\s*[^#]?${1}=.*$" ${hostSingleInfoPath} | cut -d'=' -f2 + } + for ((i = 1; i <= ${initSingleHostNums}; i++)); do + ip=$(prop "dataSophon.ip.${i}") #ip + pwd=$(prop "dataSophon.password.${i}") # password + port=$(prop "dataSophon.ssh.port.${i}") # port + echo "${ip}" + echo "${pwd}" + echo "${port}" + sshpass -p'${pwd}' ssh -P${port} -o StrictHostKeyChecking=no root@${ip} 'rpm -qa | grep krb5-devel' >${initLogDir}/installSingleNode_$(date +%Y%m%d).log + else + echo "ERROR: The added '${ip}' set krb5-devel failed" >>${initLogDir}/installSingleNode_$(date +%Y%m%d).log + echo "ERROR: The added '${ip}' set krb5-devel failed" >>${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + cat ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + rm -rf ${initLogDir}/installSingleNodeError_$(date +%Y%m%d).log + exit + fi + done + echo "SUCCESS: The added nodes set krb5-devel links have been inited successfully" >>${initLogDir}/installSingleNodeSuccess_$(date +%Y%m%d).log +} + +#---------------------------init add Single node fun end-------------------------------# if [ "$Action" = "initAll" ]; then initALL - echo "initALL....................." + echo "initAll....................." +fi +if [ "$Action" = "initSingleNode" ]; then + initSingleNode fi if [ "$Action" = "secretFreeAllLogin" ]; then secretFreeAllLogin From 991e1625242765a7fd313d308d5e753db1f62a55 Mon Sep 17 00:00:00 2001 From: liu-hai Date: Wed, 30 Aug 2023 17:15:59 +0800 Subject: [PATCH 09/11] =?UTF-8?q?[Improvement][Api]=20https://github.com/d?= =?UTF-8?q?atavane/datasophon/issues/364=20=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/assembly.xml | 13 ++++++ .../java/com/datasophon/common/Constants.java | 3 ++ .../datasophon/common/utils/HostUtils.java | 18 ++++++++ .../api/master/DispatcherWorkerActor.java | 44 +++++++++++++++++-- .../api/master/HostConnectActor.java | 30 +++++++++---- .../api/utils/ExecuteShellScriptUtils.java | 25 +++++++++++ scripts/dispatcher-worker.sh | 30 +++++++++++++ 7 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 datasophon-service/src/main/java/com/datasophon/api/utils/ExecuteShellScriptUtils.java create mode 100644 scripts/dispatcher-worker.sh diff --git a/datasophon-api/src/main/resources/assembly.xml b/datasophon-api/src/main/resources/assembly.xml index 93a70431..a8a20fbd 100644 --- a/datasophon-api/src/main/resources/assembly.xml +++ b/datasophon-api/src/main/resources/assembly.xml @@ -96,6 +96,19 @@ unix + + + ${basedir}/../scripts + + *.sh + + 0755 + 0755 + true + scripts + + unix + diff --git a/datasophon-common/src/main/java/com/datasophon/common/Constants.java b/datasophon-common/src/main/java/com/datasophon/common/Constants.java index 6de4c347..0b0c449b 100644 --- a/datasophon-common/src/main/java/com/datasophon/common/Constants.java +++ b/datasophon-common/src/main/java/com/datasophon/common/Constants.java @@ -47,6 +47,7 @@ public final class Constants { public static final String WORKER_PACKAGE_NAME = "datasophon-worker.tar.gz"; public static final String WORKER_SCRIPT_PATH = INSTALL_PATH + "/datasophon-worker/script/"; public static final String WORKER_PATH = INSTALL_PATH + "/datasophon-worker"; + public static final String SHELL_SCRIPT_PATH = "/scripts"; public static final String CLUSTER_ID = "cluster_id"; public static final String MANAGED = "managed"; @@ -255,4 +256,6 @@ private Constants() { * root user */ public static final String ROOT = "root"; + + public static final String DISPATCHER_WORK = "dispatcher-worker.sh"; } diff --git a/datasophon-common/src/main/java/com/datasophon/common/utils/HostUtils.java b/datasophon-common/src/main/java/com/datasophon/common/utils/HostUtils.java index 92e4fc33..55932f6d 100644 --- a/datasophon-common/src/main/java/com/datasophon/common/utils/HostUtils.java +++ b/datasophon-common/src/main/java/com/datasophon/common/utils/HostUtils.java @@ -84,4 +84,22 @@ public static String getIp(String hostName) { } } + public static String getLocalIp() { + try { + InetAddress ip = InetAddress.getLocalHost(); + return ip.getHostAddress(); + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + + public static String getLocalHostName() { + try { + InetAddress ip = InetAddress.getLocalHost(); + return ip.getHostName(); + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + } diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java b/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java index fc02741c..5cad4a10 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java +++ b/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java @@ -19,17 +19,23 @@ package com.datasophon.api.master; +import cn.hutool.core.io.FileUtil; import com.datasophon.api.master.handler.host.CheckWorkerMd5Handler; import com.datasophon.api.master.handler.host.DecompressWorkerHandler; import com.datasophon.api.master.handler.host.DispatcherWorkerHandlerChain; import com.datasophon.api.master.handler.host.InstallJDKHandler; import com.datasophon.api.master.handler.host.StartWorkerHandler; import com.datasophon.api.master.handler.host.UploadWorkerHandler; +import com.datasophon.api.utils.CommonUtils; +import com.datasophon.api.utils.ExecuteShellScriptUtils; import com.datasophon.api.utils.MessageResolverUtils; import com.datasophon.api.utils.MinaUtils; +import com.datasophon.common.Constants; import com.datasophon.common.command.DispatcherHostAgentCommand; +import com.datasophon.common.enums.InstallState; import com.datasophon.common.model.HostInfo; +import com.datasophon.common.utils.HostUtils; import org.apache.sshd.client.session.ClientSession; import scala.Option; @@ -40,6 +46,8 @@ import akka.actor.UntypedActor; import cn.hutool.core.util.ObjectUtil; +import java.nio.charset.Charset; + public class DispatcherWorkerActor extends UntypedActor { private static final Logger logger = LoggerFactory.getLogger(DispatcherWorkerActor.class); @@ -54,6 +62,8 @@ public void preRestart(Throwable reason, Option message) throws Exceptio public void onReceive(Object message) throws Throwable { DispatcherHostAgentCommand command = (DispatcherHostAgentCommand) message; HostInfo hostInfo = command.getHostInfo(); + String localIp = HostUtils.getLocalIp(); + String localHostName = HostUtils.getLocalHostName(); logger.info("start dispatcher host agent :{}", hostInfo.getHostname()); hostInfo.setMessage( MessageResolverUtils.getMessage( @@ -62,9 +72,37 @@ public void onReceive(Object message) throws Throwable { MinaUtils.openConnection( hostInfo.getHostname(), hostInfo.getSshPort(), hostInfo.getSshUser()); DispatcherWorkerHandlerChain handlerChain = new DispatcherWorkerHandlerChain(); - handlerChain.addHandler(new UploadWorkerHandler()); - handlerChain.addHandler(new CheckWorkerMd5Handler()); - handlerChain.addHandler(new DecompressWorkerHandler()); + if(hostInfo.getIp().equals(localIp)){ + String currDir = System.getProperty("user.dir"); + String executeShellPath = currDir+ Constants.SHELL_SCRIPT_PATH + Constants.SLASH+Constants.DISPATCHER_WORK; + logger.info("start dispatcher manage node host agent,execute shell path :{}", executeShellPath); + String md5 = FileUtil.readString( + Constants.MASTER_MANAGE_PACKAGE_PATH + + Constants.SLASH + + Constants.WORKER_PACKAGE_NAME + ".md5", Charset.defaultCharset()).trim(); + int exeCode = ExecuteShellScriptUtils.executeShellScript(executeShellPath,md5); + if(0 == exeCode){ + logger.info("distribution datasophon-worker.tar.gz success"); + logger.info("md5.verification datasophon-worker.tar.gz success"); + logger.info("decompress datasophon-worker.tar.gz success"); + hostInfo.setProgress(50); + hostInfo.setMessage(MessageResolverUtils + .getMessage("installation.package.decompressed.success.and.modify.configuration.file")); + }else { + logger.error("dispatcher manage node host agent failed"); + hostInfo.setErrMsg("dispatcher manage node host agent failed"); + hostInfo.setMessage(MessageResolverUtils + .getMessage("dispatcher manage node host agent failed")); + CommonUtils.updateInstallState(InstallState.FAILED, hostInfo); + throw new RuntimeException("---- dispatcher manage node host agent failed ----"); + } + + }else { + handlerChain.addHandler(new UploadWorkerHandler()); + handlerChain.addHandler(new CheckWorkerMd5Handler()); + handlerChain.addHandler(new DecompressWorkerHandler()); + } + handlerChain.addHandler(new InstallJDKHandler()); handlerChain.addHandler( new StartWorkerHandler(command.getClusterId(), command.getClusterFrame())); diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/HostConnectActor.java b/datasophon-service/src/main/java/com/datasophon/api/master/HostConnectActor.java index 4e2f7a83..a876cccf 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/master/HostConnectActor.java +++ b/datasophon-service/src/main/java/com/datasophon/api/master/HostConnectActor.java @@ -25,6 +25,7 @@ import com.datasophon.common.model.CheckResult; import com.datasophon.common.model.HostInfo; +import com.datasophon.common.utils.HostUtils; import org.apache.sshd.client.session.ClientSession; import scala.Option; @@ -48,22 +49,33 @@ public void preRestart(Throwable reason, Option message) throws Exceptio @Override public void onReceive(Object message) throws Throwable { if (message instanceof HostCheckCommand) { + String localIp = HostUtils.getLocalIp(); + String localHostName = HostUtils.getLocalHostName(); + logger.info("datasophon manager install hostname and ip :"+localHostName+",",localIp); HostCheckCommand hostCheckCommand = (HostCheckCommand) message; HostInfo hostInfo = hostCheckCommand.getHostInfo(); logger.info("start host check:{}", hostInfo.getHostname()); - ClientSession session = - MinaUtils.openConnection( - hostInfo.getHostname(), hostInfo.getSshPort(), hostInfo.getSshUser()); - if (ObjectUtil.isNotNull(session)) { + if(hostInfo.getIp().equals(localIp)){ + logger.info("datasophon manager node doesn't need to be checked"); hostInfo.setCheckResult( new CheckResult( Status.CHECK_HOST_SUCCESS.getCode(), Status.CHECK_HOST_SUCCESS.getMsg())); - } else { - hostInfo.setCheckResult( - new CheckResult( - Status.CONNECTION_FAILED.getCode(), - Status.CONNECTION_FAILED.getMsg())); + }else { + ClientSession session = + MinaUtils.openConnection( + hostInfo.getHostname(), hostInfo.getSshPort(), hostInfo.getSshUser()); + if (ObjectUtil.isNotNull(session)) { + hostInfo.setCheckResult( + new CheckResult( + Status.CHECK_HOST_SUCCESS.getCode(), + Status.CHECK_HOST_SUCCESS.getMsg())); + } else { + hostInfo.setCheckResult( + new CheckResult( + Status.CONNECTION_FAILED.getCode(), + Status.CONNECTION_FAILED.getMsg())); + } MinaUtils.closeConnection(session); } logger.info("end host check:{}", hostInfo.getHostname()); diff --git a/datasophon-service/src/main/java/com/datasophon/api/utils/ExecuteShellScriptUtils.java b/datasophon-service/src/main/java/com/datasophon/api/utils/ExecuteShellScriptUtils.java new file mode 100644 index 00000000..f8e78c9a --- /dev/null +++ b/datasophon-service/src/main/java/com/datasophon/api/utils/ExecuteShellScriptUtils.java @@ -0,0 +1,25 @@ +package com.datasophon.api.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +import com.datasophon.api.master.DispatcherWorkerActor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExecuteShellScriptUtils { + private static final Logger logger = LoggerFactory.getLogger(ExecuteShellScriptUtils.class); + public static int executeShellScript(String shellScriptPath,String params) throws IOException, InterruptedException { + logger.info("start executeShellScript:{}", shellScriptPath); + ProcessBuilder pb = new ProcessBuilder("sh",shellScriptPath,params); + //pb.inheritIO(); + Process p = pb.start(); + /*BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line; + while ((line = reader.readLine()) != null){ + System.out.println(line); + }*/ + return p.waitFor(); + } +} diff --git a/scripts/dispatcher-worker.sh b/scripts/dispatcher-worker.sh new file mode 100644 index 00000000..3f5abd30 --- /dev/null +++ b/scripts/dispatcher-worker.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# example: sh init-jdk.sh +# instal and config jdk env +workmd5="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +cp /opt/datasophon/DDP/packages/datasophon-worker.tar.gz /opt/datasophon/ +checkworkmd5=$(md5sum /opt/datasophon/DDP/packages/datasophon-worker.tar.gz | awk '{print $1}') +if [ "$checkworkmd5" = "$workmd5" ]; then + echo "md5效验通过" +else + echo "md5效验不通过" + exit 1 +fi +tar -zxvf /opt/datasophon/datasophon-worker.tar.gz -C /opt/datasophon/ From f692171287e87b6be58688f734ab5f846bb1acd7 Mon Sep 17 00:00:00 2001 From: liu-hai Date: Thu, 14 Sep 2023 11:39:03 +0800 Subject: [PATCH 10/11] =?UTF-8?q?[Improvement][datasophon-init]=20?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datasophon-init/README.md | 99 ++++++++++-------- datasophon-init/bin/dispatcher-worker.sh | 30 ++++++ datasophon-init/bin/init-ssh-hadoop.sh | 4 - .../config/init-host-info.properties | 9 +- datasophon-init/config/init.properties | 6 +- datasophon-init/sbin/init.sh | 53 ++++------ website/static/img/initadd-process.png | Bin 0 -> 14060 bytes website/static/img/initall-process.png | Bin 0 -> 21208 bytes 8 files changed, 115 insertions(+), 86 deletions(-) create mode 100644 datasophon-init/bin/dispatcher-worker.sh create mode 100644 website/static/img/initadd-process.png create mode 100644 website/static/img/initall-process.png diff --git a/datasophon-init/README.md b/datasophon-init/README.md index 3ac00662..a9a453c1 100644 --- a/datasophon-init/README.md +++ b/datasophon-init/README.md @@ -18,32 +18,14 @@

觉得不错的话,star fork下,欢迎社区开发者共建DataSophon

-# dataSophon-init使用说明 +# dataSophon-init模块使用说明 -前言:当前版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配 -1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); -2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压;下载链接:https://pan.baidu.com/s/1iqudVwDgg2x_OO35VLkkSg 提取码:6zrz -3、在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); -离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源,该步骤都是在主节点上操作): - 详情可查看配置脚本:init-private-yum-library-${initOS}.sh - ①首先创建目录 'mkdir -p /data/private-yum-library_temp'然后将和操作系统匹配的操作系统iso文件移动到/data/目录下; - ②在/data目录下创建private-yum-library目录:'mkdir -p /data/private-yum-library'; - ③执行挂载操作系统命令:mount -o loop /data/openEuler-22.03-LTS-SP2-everything-x86_64-dvd.iso /data/private-yum-library_temp,这种挂载重启服务器之后会失效,所以我们挂载完成后将ios内的文件全部拷贝出来做离线yum源用; - ④在private-yum-library目录下创建两个子目录 repo 和 epel; - ⑤将private-yum-library_temp目录下的文件全部拷贝到/data/private-yum-library/repo目录下:cp -r /data/private-yum-library_temp/* /data/private-yum-library/repo,另外不同操作系统挂载后所产生的目录不同,比如centos8的repo有两个BaseOS和AppStream; - ⑥将原本的yum源的配置文件进行备份 :mkdir -p /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak; - ⑦剩下的工作就交给脚本工具自己去处理了,epel目录是为了给需要自行配置离线eprl源的用户准备的,如果能配置epel建议进行配置,因为很多操作系统额外的很多工具包都在对应的epel中; +## 一、使用前须知 +当前组件的版本是根据centos8.5和openEuler-22.03进行开发适配的,其它类型和版本的操作系统目前没有进行详细的测试验证可能存在兼容性问题,需要对shell脚本和本地YUM离线安装包进行适配,主要是因为不同的操作系统一些依赖包不一样; -4、集群NTP时钟默认使用Chrony,如使用其它的方式请自行安装配置,并将sbin/init.sh 脚本中的 initALL() 方法中的‘initAllNtpChronyService’ 和 ‘checkNtpChronyService’方法注释掉避免重复安装; -5、脚本的初始化需要用到python环境,主要用到pssh进行集群间的命令执行控制,目前packages目录中pssh.tar.gz中已经内置了三个安装包: - pssh-2.3.1-5.el7.noarch.rpm 需要python2.7的支持; - pssh-2.3.1-29.el8.noarch.rpm 需要python3.6的支持; - pssh-2.3.4-1.el9.noarch.rpm 需要python3.9的支持; - Centos7和8中的repo中已经存在对应的rpm格式的pssh包了,目前openEuler22.03中还没有pssh相关的安装包, - 其它版本pssh的rpm包下载工具地址:http://rpmfind.net/linux/rpm2html/search.php?query=pssh,可以根据操作系统和python版本进行适配 -6、服务器操作系统的iso文件建议使用everything版本的,这样包含的依赖包更全一点; +## 二、组件说明 -# dataSophon-init目录结构如下: +### dataSophon-init目录结构如下: [root@localhost datasophon-init]# ls -l 总用量 8 drwxr-xr-x 2 root root 4096 8月 10 17:09 bin @@ -51,13 +33,13 @@ drwxr-xr-x 2 root root 99 7月 28 16:10 config drwxr-xr-x 8 root root 4096 8月 9 13:47 packages drwxr-xr-x 2 root root 189 7月 27 11:35 remove drwxr-xr-x 3 root root 50 8月 10 20:02 sbin -drwxr-xr-x 2 root root 70 8月 7 10:54 sql +drwxr-xr-x 2 root root 70 8月 7 10:54 sql -## 上面的各个目录解释如下: +### 上面的各个目录解释如下: -* bin:datasophon 服务器集群环境配置初始化程序脚本(单个模块初始化脚本所在目录,无需手动管理); -* config:datasophon 服务器集群环境一键初始化所需配置文件目录,需要用户手动修改; +* bin:datasophon服务器集群环境配置初始化程序脚本(单个模块初始化脚本所在目录,无需手动管理); +* config:datasophon服务器集群环境一键初始化所需配置文件目录,需要用户手动修改; * packages:初始化过程需要的依赖安装包存放目录; * remove:卸载环境脚本; * sbin:一键初始化环境脚本所在目录; @@ -66,16 +48,16 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql ### 在 config 目录下面有三个配置文件: * init.properties:主要配置私有化 yum 源安装节点信息、namp 安装节点信息、mysql 数据库安装节点信息、修复机器总数、服务器操作系统类型、以及修复模块日志存放位置。用户根据需要自行修改相关配置项; -* init-host-info.properties:节点全量修复,需要配置此文件,具体配置所有节点内网 Ip、密码、端口号以及主机名; -* init-host-info-add.properties:集群新增节点时,需要配置此文件,具体配置新增节点内网 Ip、密码、端口号以及主机名; +* init-host-info.properties:节点全量初始化,需要配置此文件,具体配置所有节点内网 Ip、密码、端口号以及主机名; +* init-host-info-add.properties:集群新增节点初始化时,需要配置此文件,具体配置新增节点内网 Ip、密码、端口号以及主机名; -### init.properties 说明 +#### init.properties 说明 -* yum.repo.need:填写是否需要部署私有化yum源(true:需要/false:不需要,如服务器不能连接外网必须部署私有化yum源); +* yum.repo.need:填写是否需要部署私有化yum源(true:需要/false:不需要,如服务器不能连接外网必须部署私有化yum源用来离线安装所需的rpm依赖); * yum.repo.host.ip:填写即将部署私有化yum源的节点的内网IP(即执行init脚本的节点IP,推荐在主节点上进行); -* namp.server.ip=:填写未来要部署的datasophon管理端的节点内网IP; +* namp.server.ip:填写未来要部署的datasophon管理端的节点内网IP; * namp.server.port:填写未来要部署的datasophon管理端节点的SSH端口号,默认22; -* namp.server.password:填写未来要部署的datasophon管理端节点的密码,这个密码最好不要有特殊字符比如‘,’、‘$’等; +* namp.server.password:填写未来要部署的datasophon管理端节点的密码,这个密码最好不要有特殊字符比如‘,’、‘$’等以免因为特殊符号的原因导致认证失败; * ntp.master.ip: 填写未来要部署ntp时钟同步的主节点服务器IP(推荐主节点); * mysql.ip: 填写未来要部署mysql数据库的节点服务器IP(推荐主节点); * mysql.host.ssh.port: 填写未来要部署mysql数据库的节点服务器SSH端口,默认为22; @@ -84,26 +66,53 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql * init.host.num: 填写未来要初始化的服务器数量; * init.add.host.num: 填写未来要初始化的新增服务器节点数量,全量初始化时无需修改; * init.log.dir :设置初始化服务器环境时日志存放目录; -* init.os :填写服务器操作系统类型openEuler/centos8/centos7......; +* init.os :填写服务器操作系统类型openEuler、centos8; -### init-host-info.properties 说明 +#### init-host-info.properties 说明 * dataSophon.ip.i=172.31.51.194 #预备安装dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量); * dataSophon.password.i=xxxxx #预备安装dataSophon集群的节点的登录密码; * dataSophon.ssh.port.i=22 #预备安装dataSophon集群的节点的SSH端口默认22; * dataSophon.ssh.port.hostname.i=dataSophon01 #预备安装dataSophon集群的节点的主机名; -### init-host-info-add.properties 说明 +#### init-host-info-add.properties 说明(需要对新增的节点进行初始化时才需要配置此文件 ,可以新增1-n个) * dataSophon.ip.i=172.31.51.162 #预备新增dataSophon集群的节点内网IP(i表示1-n的取值,n为集群节点数量); * dataSophon.password.i=xxxxx #预备新增安装dataSophon集群的节点的登录密码; * dataSophon.ssh.port.i=22 #预备新增安装dataSophon集群的节点的SSH端口默认22; * dataSophon.ssh.port.hostname.i=dataSophon05 #预备新增安装dataSophon集群的节点的主机名; +## 三、组件使用说明(以下为针对首次使用) + +1、将datasophon-init整个目录的内容放到规划的集群主节点的/data目录下(mkdir /data); +2、将packages.tar.gz 离线依赖库移到主节点的 /data/datasophon-init下并解压;下载链接:https://pan.baidu.com/s/1iqudVwDgg2x_OO35VLkkSg 提取码:6zrz +3、准备服务器操作系统对应的iso镜像文件,建议使用everything版本的,这样包含的依赖包更全一点; +4、离线YUM源配置:在未连接互联网的情况下预备安装datasophon的服务器已经配置好离线yum源,能够通过yum命令安装依赖包(此步骤为必须,因为初始化脚本中使用了"yum -y install xxxx"的方式安装依赖,如果没有yum源会导致安装失败 ); +离线YUM源配置方法(Ps:能连公网的用户就不用配置离线yum源了,直接配置为公共的源此时需要配置“yum.repo.need=false",该步骤都是在主节点上操作): + 详情可查看配置脚本:init-private-yum-library-${initOS}.sh + ①首先创建目录 'mkdir -p /data/private-yum-library_temp'然后将和操作系统匹配的操作系统iso文件移动到/data/目录下; + ②在/data目录下创建private-yum-library目录:'mkdir -p /data/private-yum-library'; + ③执行挂载操作系统命令:mount -o loop /data/openEuler-22.03-LTS-SP2-everything-x86_64-dvd.iso /data/private-yum-library_temp,这种挂载重启服务器之后会失效,所以我们挂载完成后将ios内的文件全部拷贝出来做离线yum源用; + ④在private-yum-library目录下创建两个子目录 repo 和 epel; + ⑤将private-yum-library_temp目录下的文件全部拷贝到/data/private-yum-library/repo目录下:cp -r /data/private-yum-library_temp/* /data/private-yum-library/repo,另外不同操作系统挂载后所产生的目录不同,比如centos8的repo有两个BaseOS和AppStream; + ⑥将原本的yum源的配置文件进行备份 :mkdir -p /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak; + ⑦剩下的工作就交给脚本工具自己去处理了,epel目录是为了给需要自行配置离线eprl源的用户准备的,如果能配置epel建议进行配置,因为很多操作系统额外的很多工具包都在对应的epel中,配置之后在未来集群需要安装额外的扩展时会很方便; + +5、集群时钟源配置:集群NTP时钟默认使用Chrony,如使用其它的方式请自行安装配置,并将sbin/init.sh 脚本中的 initALL() 方法中的‘initAllNtpChronyService’ 和 ‘checkNtpChronyService’方法注释掉避免重复安装; +6、脚本的初始化需要用到python环境,主要用到pssh进行集群间的命令执行控制,目前packages目录中pssh.tar.gz中已经内置了三个安装包: + pssh-2.3.1-5.el7.noarch.rpm 需要python2.7的支持; + pssh-2.3.1-29.el8.noarch.rpm 需要python3.6的支持; + pssh-2.3.4-1.el9.noarch.rpm 需要python3.9的支持; + Centos8中的repo中已经存在对应的rpm格式的pssh包了,目前openEuler22.03中还没有pssh相关的安装包, + 其它版本pssh的rpm包下载工具地址:http://rpmfind.net/linux/rpm2html/search.php?query=pssh,可以根据操作系统和python版本进行适配 ; +7、修改config 目录下的配置文件,根据自己需要配置的节点实际情况进行修改,如果配置文件配置错误会导致初始化失败; -## 全量初始化流程 -![img](website/static/img/Initialization-process.png) + +## 四、首次全量初始化操作 + +### 全量初始化脚本的流程 +![img](website/static/img/initall-process.png) ### 执行初始化脚本 @@ -111,19 +120,21 @@ drwxr-xr-x 2 root root 70 8月 7 10:54 sql cd /data/datasophon-init/sbin bash init.sh initAll (等待程序执行完毕,中间需要有一次确认服务器时间的确认项需要选择) -PS:执行完毕之后如果服务器的终端未关闭,可能会出现一些命令无效的情况,此时需要手动在终端执行 ‘source /etc/profile ’使环境变量生效,或者关闭终端重新打开 +PS:执行完毕之后如果服务器的终端未关闭,可能会出现一些命令无效的情况,此时需要手动在终端执行 ‘source /etc/profile ’使环境变量生效,或者关闭终端重新打开 ; -当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8、jdk等整个过程需要一定的时间,可以查看log目录下的安装日志 +当执行完 bash init.sh initAll 之后,会看到有下面输出很多的日志,因为需要配置本地离线yum源以及安装mysql8等整个过程需要一定的时间,可以查看log目录下的安装日志 其中mysql初始化的数据库默认为datasophon,初始化过程中会自动创建用户"datasophon"密码为"datasophon" #### 当前初始化模块支持的操作系统版本为:CentOS-8.5.2111-x86_64、openEuler-22.03 -####当前初始化模块支持的mysql为:mysql-community-8.0.28 -####自动安装的JDK为:jdk-8u333(jdk在安装datasophon的时候会自动配置,初始化工具不会再次进行重复配置) +#### 当前初始化模块支持的mysql为:mysql-community-8.0.28 -## 新增节点初始化流程 +## 五、集群新增节点初始化操作 +### 新增节点初始化流程 +![img](website/static/img/initadd-process.png) -将config/init.properties文件中的'init.add.host.num'参数修改为即将新增加的节点的实际数量,只支持整数; +### 执行初始化脚本 +将config/init.properties文件中的'init.add.host.num'参数修改为即将新增加的节点的实际数量(init.host.num参数为当前已有的节点数量),只支持整数; 编辑config/init-host-info-add.properties,将文件中的指定信息按照既定格式进行修改,主要包括新增节点的ip、password、sshport、hostname; 完成上述步骤后,执行如下命令即可开始一键初始化任务。 cd /data/datasophon-init/sbin diff --git a/datasophon-init/bin/dispatcher-worker.sh b/datasophon-init/bin/dispatcher-worker.sh new file mode 100644 index 00000000..3f5abd30 --- /dev/null +++ b/datasophon-init/bin/dispatcher-worker.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# example: sh init-jdk.sh +# instal and config jdk env +workmd5="$1" +if [ $UID -ne 0 ]; then + echo Non root user. Please run as root. + exit 1 +fi +if [ -L $0 ]; then + BASE_DIR=$(dirname $(readlink $0)) +else + BASE_DIR=$(dirname $0) +fi +BASE_PATH=$( + cd ${BASE_DIR} + pwd +) +INIT_PATH=$(dirname "${BASE_PATH}") +echo "INIT_PATH: ${INIT_PATH}" + +cp /opt/datasophon/DDP/packages/datasophon-worker.tar.gz /opt/datasophon/ +checkworkmd5=$(md5sum /opt/datasophon/DDP/packages/datasophon-worker.tar.gz | awk '{print $1}') +if [ "$checkworkmd5" = "$workmd5" ]; then + echo "md5效验通过" +else + echo "md5效验不通过" + exit 1 +fi +tar -zxvf /opt/datasophon/datasophon-worker.tar.gz -C /opt/datasophon/ diff --git a/datasophon-init/bin/init-ssh-hadoop.sh b/datasophon-init/bin/init-ssh-hadoop.sh index 9b5c08b1..4f5a93db 100644 --- a/datasophon-init/bin/init-ssh-hadoop.sh +++ b/datasophon-init/bin/init-ssh-hadoop.sh @@ -2,8 +2,6 @@ # example: sh init-ssh-gen-key.sh -filePath=$1 -initAllHostNums="$2" if [ -L $0 ]; then BASE_DIR=$(dirname $(readlink $0)) else @@ -25,8 +23,6 @@ PACKAGES_PATH=${INIT_PATH}/packages echo "PACKAGES_PATH: ${PACKAGES_PATH}" sshHadoopDir=/home/hadoop/.ssh/ -rm -rf ${INIT_BIN_PATH}/tmp_scp_host_info.txt -bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${filePath} ${initAllHostNums} pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-add-hadoop-user.sh pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p /home/hadoop/" pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r /root/.ssh /home/hadoop/ diff --git a/datasophon-init/config/init-host-info.properties b/datasophon-init/config/init-host-info.properties index 8ec64aef..f03d2e13 100644 --- a/datasophon-init/config/init-host-info.properties +++ b/datasophon-init/config/init-host-info.properties @@ -4,12 +4,17 @@ # 4.dataSophon.ssh.port.i: # 5.dataSophon.ssh.port.hostname.i: dataSophon.ip.1=172.31.51.160 -dataSophon.password.1=max@123!@# +dataSophon.password.1=dataSophon@123!@# dataSophon.ssh.port.1=22 dataSophon.ssh.port.hostname.1=dataSophon01 dataSophon.ip.2=172.31.51.161 -dataSophon.password.2=max@123!@# +dataSophon.password.2=dataSophon@123!@# dataSophon.ssh.port.2=22 dataSophon.ssh.port.hostname.2=dataSophon02 +dataSophon.ip.3=172.31.51.162 +dataSophon.password.3=dataSophon@123!@# +dataSophon.ssh.port.3=22 +dataSophon.ssh.port.hostname.3=dataSophon02 + diff --git a/datasophon-init/config/init.properties b/datasophon-init/config/init.properties index 6c0b7403..f44ab41e 100644 --- a/datasophon-init/config/init.properties +++ b/datasophon-init/config/init.properties @@ -7,7 +7,7 @@ yum.repo.host.ip=172.31.51.160 #The Host information for installing the NMAP service nmap.server.ip=172.31.51.160 nmap.server.port=22 -nmap.server.password=max@123!@# +nmap.server.password=datasophon@123!@# # The Host information for installing the NTP service(Master) ntp.master.ip=172.31.51.160 @@ -15,7 +15,7 @@ ntp.master.ip=172.31.51.160 # Install MySQL machine node information mysql.ip=172.31.51.160 mysql.host.ssh.port=22 -mysql.host.ssh.password=max@123!@# +mysql.host.ssh.password=datasophon@123!@# # Set the MYSQL database login password mysql.password=datasophon123 @@ -29,7 +29,7 @@ init.add.host.num=0 # Common Settings. init.log.dir=./logs -# server operating system Settings : openEuler/centos8/centos7...... +# server operating system Settings : openEuler?centos8 init.os=openEuler diff --git a/datasophon-init/sbin/init.sh b/datasophon-init/sbin/init.sh index ff2dbaa3..f48885a2 100644 --- a/datasophon-init/sbin/init.sh +++ b/datasophon-init/sbin/init.sh @@ -109,11 +109,21 @@ initALL() { secretFreeAllLogin checkSecretFreeAllLogin + #Create a tmp_scp_host_info file 创建一个临时需要进行拷贝分发资源包的host信息文件 + echo "Create a tmp_scp_host_info start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + echo "Create a tmp_scp_host_info start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + #Distribution resource pack 分发资源包 pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" echo "Distribution resource pack start_time:$(date '+%Y%m%d %H:%M:%S')" pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} + #Create hadoop users and groups 创建hadoop用户和组 + echo "Create hadoop users and groups start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + echo "Create hadoop users and groups end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + #close all Firewall echo "closeAllFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeAllFirewall_$(date +%Y%m%d).log @@ -209,37 +219,6 @@ initALL() { pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-krb5-devel.sh >>${initLogDir}/installKrb5Devel_$(date +%Y%m%d).log checkKrb5Devel - #redhat-lsb 配置 和python环境配置暂不需要 - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${middleTimeOut} -i bash ${INIT_BIN_PATH}/init-redhat-lsb.sh >>${initLogDir}/installRedhatLsb_$(date +%Y%m%d).log - #checkRedhatLsb - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python2-rpm-macros.sh >>${initLogDir}/installPython2Macros_$(date +%Y%m%d).log - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-srpm-macros.sh >>${initLogDir}/installPythonSrpmMacros_$(date +%Y%m%d).log - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python-rpm-macros.sh >>${initLogDir}/installPythonMacros_$(date +%Y%m%d).log - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-init-python-devel.sh >> ${initLogDir}/installPythonDevel_`date +%Y%m%d`.log - #checkPythonDevel - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cyrus-sasl.sh >>${initLogDir}/installCyrusSasl_$(date +%Y%m%d).log - #checkCyrusSasl - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-python36-devel.sh >>${initLogDir}/installPython36Devel_$(date +%Y%m%d).log - #checkPython36Devel - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -t ${smallTimeOut} -i bash ${INIT_BIN_PATH}/init-Cython.sh >>${initLogDir}/installCython_$(date +%Y%m%d).log - #checkCython - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-six.sh >>${initLogDir}/installSix_$(date +%Y%m%d).log - #checkSix - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-websocket_client.sh >>${initLogDir}/installWebsocketClient_$(date +%Y%m%d).log - #checkWebsocketClient - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ecdsa.sh >>${initLogDir}/installEcdsa_$(date +%Y%m%d).log - #checkecdsa - - #pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-pytest_runner.sh >>${initLogDir}/installPytestRunner_$(date +%Y%m%d).log - #checkPytestRunner - pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-ntp_enable.sh >>${initLogDir}/installSingleNtpEnable_$(date +%Y%m%d).log pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-chmod-dev-null.sh >>${initLogDir}/chmodDevNull_$(date +%Y%m%d).log pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-cleanBuff-async.sh >>${initLogDir}/cleanBuff_$(date +%Y%m%d).log @@ -264,11 +243,21 @@ initSingleNode() { secretFreeSingleNodeLogin checkSecretFreeSingleNodeLogin + #Create a tmp_scp_host_info file 创建一个临时需要进行拷贝分发资源包的host信息文件 + echo "Create a tmp_scp_host_info start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-hostIp-txt.sh ${hostSingleInfoPath} ${initSingleHostNums} >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + echo "Create a tmp_scp_host_info start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/CreateTmpScpHostInfoFile_$(date +%Y%m%d).log + #Distribution resource pack 分发资源包 pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i "mkdir -p '${DATASOPHON_PATH}'" echo "Distribution resource pack start_time:$(date '+%Y%m%d %H:%M:%S')" pscp.pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -r ${INIT_PATH} ${DATASOPHON_PATH} + #Create hadoop users and groups 创建hadoop用户和组 + echo "Create hadoop users and groups start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + echo "Create hadoop users and groups end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/initsshhadoopLogin_$(date +%Y%m%d).log + #close all Firewall echo "closeSingleNodeFirewall start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/closeSingleNodeFirewall_$(date +%Y%m%d).log pssh -h ${INIT_BIN_PATH}/tmp_scp_host_info.txt -i bash ${INIT_BIN_PATH}/init-stop-firewall.sh >>${initLogDir}/closeSingleNodeFirewall_$(date +%Y%m%d).log @@ -404,7 +393,6 @@ secretFreeAllLogin() { bash ${INIT_BIN_PATH}/init-ssh-gen-key.sh >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostAllInfoPath} ${initAllHostNums} ${nmapServerPort} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log - bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostAllInfoPath} ${initAllHostNums} >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log echo "secretFreeAllLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeAllLogin_$(date +%Y%m%d).log } @@ -933,7 +921,6 @@ checkKrb5Devel() { secretFreeSingleNodeLogin() { echo "secretFreeSingleNodeLogin start_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log bash ${INIT_BIN_PATH}/init-ssh-copy-key.sh ${hostSingleInfoPath} ${initSingleHostNums} ${nampServerPort} >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log - bash ${INIT_BIN_PATH}/init-ssh-hadoop.sh ${hostSingleInfoPath} ${initSingleHostNums} >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log echo "secretFreeSingleNodeLogin end_time:$(date '+%Y%m%d %H:%M:%S')" >>${initLogDir}/secretFreeSingleNodeLogin_$(date +%Y%m%d).log } diff --git a/website/static/img/initadd-process.png b/website/static/img/initadd-process.png new file mode 100644 index 0000000000000000000000000000000000000000..ce9f680fd4483be81963d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4}F4De{Iz?uxtQl)H}1TC8oo#>rCiKBROG#aRD zcBrJ{>zkgoka;0xdN*1q*I((_`t1ZX9ka8c-5|do-!Z6*MUnW4{b3P5#$@7wMl8b# zaE>nF#D@DMl>5j({Di}PyYYLTUtvK>Z}7Vln9;UU*y0~%ZM-1E7I<0xM6KhPJjIwa z)UUJa#Ni@q%78)E{)QIV;-O4D!_M)E`tkEWw!t+Iaejw+`}g0ep-Hx6z0@kPRZ$1B zl99TLEz$LE`;I5}2=c!Tk1~fGuuRYvkO=IW%1~FL5lrzXaP}e1?Y*m2;Jw z5N}KX^2f8Fyv+j@ErjfFiI!uu?1jHZxvcN-1Z4c~+kP_{MGe+U&oLBF8AaV$g@rw{YtNDDE2mc@e|Ju1FAlYZjY%$zLF_Nhy r!vE@9VshxI-9G~KAHGI*%>G$Vg`>=uCJz5CHUecu^#{fGP2c=K#Gb@d literal 0 HcmV?d00001 diff --git a/website/static/img/initall-process.png b/website/static/img/initall-process.png new file mode 100644 index 0000000000000000000000000000000000000000..4ee56a39151544845db8961eb9157d4c45b915fe GIT binary patch literal 21208 zcmc({cU+U()-8;pf*=G0L1_Vz-c+QQ2mz_mdleB;L^@K0&<#cDU3!t;r8lMb-dkv) zcL)SX;EQf?pMBqR_j}HJ?!DiiPu4F_U30E6#~5?@DJe)1;8EaVVPO%-NK2?-VO_e4 zg@sLudl~bK;9Pn?7M4n)jD(n)qrql;ZSf?3NokB@i^8VRr0S^wqXvuJEV8q7zkG>i z5vk{eysQCx)O97Z6uLRAO`FV8l7f+DW@-%koH!?&tvJ^4`g* zGcc-%##?-(w>gW!M$sy|Iq8o-eb2q7Wxxp8!=vq8Xb{k4EwZ&@xQ%O|yz zK*OR$SgT2Oh4;DU)8V$>&K$*rmmaWB7k^jY=p1_EJS;^QupXm!8$J8ztCaFvbHv;e zbkSvyT|;Oq6>c*3cfja0CD$LM~G$`UDRZ>@|8JH!3JlwBjg zP{Oa^7JIa87jCk610cR|@d1uHbrix#{bqs6)=r}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|u`xzb zjunn}z}c>G)Re;ct&92vVyYFT>}F7~j7$xVZadzMI!8Pn#u3%g;mYE0a`nw&;S|jT zZ2qzT7*f;PSY)48qS76xgCS(J_K=znS^%`q|99K!$>eBaUHd~l#zLLC1F@dX;$YoI lUc$Nt!E*Qb>*4V^b%#M{ Date: Thu, 14 Sep 2023 11:39:49 +0800 Subject: [PATCH 11/11] =?UTF-8?q?[Improvement][datasophon-init]=20?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datasophon-init/config/init.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasophon-init/config/init.properties b/datasophon-init/config/init.properties index f44ab41e..fcf011da 100644 --- a/datasophon-init/config/init.properties +++ b/datasophon-init/config/init.properties @@ -29,7 +29,7 @@ init.add.host.num=0 # Common Settings. init.log.dir=./logs -# server operating system Settings : openEuler?centos8 +# server operating system Settings : openEuler\centos8 init.os=openEuler