Skip to content

天楚锐齿

人工智能 云计算 大数据 物联网 IT 通信 嵌入式

天楚锐齿

  • 下载
  • 物联网
  • 云计算
  • 大数据
  • 人工智能
  • Linux&Android
  • 网络
  • 通信
  • 嵌入式
  • 杂七杂八

简单化的ganglia安装脚本

2018-03-12

支持rhel5.x (centos5.x)和rhel6.x:

#!/bin/bash

function UsageHelp()
{
echo
echo “Usage: $1 [-h][<[server][client]>]”
echo “example: $1 server”
echo
echo “Install ganglia to host.”
echo
echo “-h:     Show help information.”
echo “server: Install server to host.”
echo “client: Install client to host.”
echo
}

if [ $# -gt 1 ] ; then
UsageHelp $0
exit 0
fi
if [ $# -lt 1 ] ; then
UsageHelp $0
exit 0
fi
type=$1
if [ “$type” != “server” ] ; then
if [ “$type” != “client” ] ; then
UsageHelp $0
exit 0
fi
fi

#################### GCC ######################################
yesOrNo=”y”
read -t 5 -p ” ===> gcc installed? (y/n, default is ‘y’) ” yesOrNo
if [ $? -ne 0 ] ; then
yesOrNo=”y”
fi
if [ “$yesOrNo” == “” ] ; then
yesOrNo=”y”
fi
if [ “$yesOrNo” == “n” ] ; then
echo “ERROR: gcc isn’t installed.”
exit -1
fi
#################### X11 ######################################
if [ “$type” == “server” ] ; then
yesOrNo=”y”
read -t 5 -p ” ===> X11 installed? (y/n, default is ‘y’) ” yesOrNo
if [ $? -ne 0 ] ; then
yesOrNo=”y”
fi
if [ “$yesOrNo” == “” ] ; then
yesOrNo=”y”
fi
if [ “$yesOrNo” == “n” ] ; then
echo “ERROR: X11 isn’t installed.”
exit -1
fi
fi
sleep 2

#################### APR ######################################
echo “Install APR ==========================================>”
if [ ! -f “/usr/local/apr/bin/apr-1-config” ] ; then
if [ -f “apr-1.4.5.tar.gz” ] ; then
set -x
tar -zxvf apr-1.4.5.tar.gz
cd apr-1.4.5
./configure
make clean
make
make install
cd ..
set +x
else
echo “ERROR: apr-1.4.5.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### APR-UTIL ######################################
echo “Install APR-UTIL ==========================================>”
if [ ! -f “/usr/local/apr/bin/apu-1-config” ] ; then
if [ -f “apr-util-1.3.12.tar.gz” ] ; then
set -x
tar -zxvf apr-util-1.3.12.tar.gz
cd apr-util-1.3.12
./configure –with-apr=/usr/local/apr/bin/apr-1-config
make clean
make
make install
cd ..
set +x
else
echo “ERROR: apr-util-1.3.12.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### CONFUSE ######################################
echo “Install CONFUSE ==========================================>”
if [ ! -f “/usr/local/include/confuse.h” ] ; then
if [ -f “confuse-2.7.tar.gz” ] ; then
set -x
tar -zxvf confuse-2.7.tar.gz
cd confuse-2.7
./configure –with-pic
make clean
make
make install
cd ..
set +x
else
echo “ERROR: confuse-2.7.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### EXPAT ######################################
echo “Install EXPAT ==========================================>”
if [ ! -f “/usr/local/include/expat.h” ] ; then
if [ -f “expat-2.0.1.tar.gz” ] ; then
set -x
tar -zxvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure
make clean
make
make install
cd ..
set +x
else
echo “ERROR: expat-2.0.1.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### XML-PARSER ######################################
echo “Install XML-PARSER ==========================================>”
if [ ! -d “/usr/local/lib64/perl5/XML/Parser” ] ; then
if [ ! -d “/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/XML/Parser” ] ; then
if [ -f “XML-Parser-2.41.tar.gz” ] ; then
set -x
tar -zxvf XML-Parser-2.41.tar.gz
cd XML-Parser-2.41
perl Makefile.PL
make
make install
cd ..
set +x
else
echo “ERROR: XML-Parser-2.41.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi
fi

#################### INTLTOOL ######################################
echo “Install INTLTOOL ==========================================>”
if [ ! -f “/usr/local/bin/intltoolize” ] ; then
if [ -f “intltool-0.40.6.tar.gz” ] ; then
set -x
tar -zxvf intltool-0.40.6.tar.gz
cd intltool-0.40.6
./configure
make clean
make
make install
cd ..
set +x
else
echo “ERROR: intltool-0.40.6.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### RRDTOOL ######################################
if [ “$type” == “server” ] ; then
echo “Install RRDTOOL ==========================================>”
if [ ! -f “/usr/bin/rrdtool” ] ; then
if [ -f “rrdtool-1.4.5.tar.gz” ] ; then
set -x
tar -zxvf rrdtool-1.4.5.tar.gz
cd rrdtool-1.4.5
./configure –prefix=/usr/
make clean
make
make install
which rrdtool
ldconfig
cd ..
set +x
else
echo “ERROR: rrdtool-1.4.5.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi
fi

#################### PCRE ######################################
echo “Install PCRE ==========================================>”
if [ ! -f “/usr/local/bin/pcregrep” ] ; then
if [ -f “pcre-8.12.tar.gz” ] ; then
set -x
tar -zxvf pcre-8.12.tar.gz
cd pcre-8.12
./configure
make clean
make
make install
cd ..
set +x
else
echo “ERROR: pcre-8.12.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### PYTHON ######################################
echo “Install PYTHON ==========================================>”
if [ ! -f “/usr/local/python/lib/libpython2.7.so” ] ; then
if [ -f “Python-2.7.2.tgz” ] ; then
set -x
rm -f /usr/local/lib/libpython2.7.a
tar -zxvf Python-2.7.2.tgz
cd Python-2.7.2
./configure –enable-shared –prefix=/usr/local/python
make clean
make
make install
echo /usr/local/python/lib > /etc/ld.so.conf.d/libpython.conf
ldconfig
ldconfig -p|grep libpython
ldconfig -v|grep libpython
sed -i “s/PATH=/PATH=\/usr\/local\/python\/bin:/” ~/.bash_profile
. ~/.bash_profile
rm -f /usr/local/lib/libpython2.7.a
cp libpython2.7.a /usr/lib/
cd ..
set +x
else
echo “ERROR: Python-2.7.2.tgz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### GANGLIA ######################################
echo “Install GANGLIA ==========================================>”
if [ ! -f “/usr/bin/ganglia-config” ] ; then
if [ -f “ganglia-3.1.7.tar.gz” ] ; then
set -x
service gmetad stop
service gmond stop
rm -rf /var/lib/ganglia/rrds/*
tar -zxvf ganglia-3.1.7.tar.gz
cd ganglia-3.1.7
if [ “$type” == “server” ] ; then
./configure –with-gmetad –enable-gexec –with-libapr=/usr/local/apr/bin/apr-1-config –sysconfdir=/etc/ganglia –with-python=/usr/local/python
else
./configure –with-libapr=/usr/local/apr/bin/apr-1-config –sysconfdir=/etc/ganglia –with-python=/usr/local/python
fi
make clean
sed -i ‘s/LIBS =/LIBS = -lm -lutil /’ gmond/modules/python/Makefile
make
make install
mkdir /etc/ganglia
if [ “$type” == “server” ] ; then
cd gmetad
cp gmetad.init /etc/rc.d/init.d/gmetad
cp gmetad.conf /etc/ganglia/gmetad.conf
chkconfig –add gmetad
chkconfig –list | grep gmetad
mkdir -p /var/lib/ganglia/rrds
chown nobody:nobody /var/lib/ganglia/rrds
sed -i “s/data_source \”my cluster\” localhost/data_source \”CLOUD\” 10 localhost/” /etc/ganglia/gmetad.conf
sed -i “s/# gridname \”MyGrid\”/gridname \”Hanborq\”/” /etc/ganglia/gmetad.conf
service gmetad start
sleep 1
telnet localhost 8651 | grep “HOST NAME”
cd ..
fi
cd gmond
gmond -t > /etc/ganglia/gmond.conf
cp gmond.init /etc/rc.d/init.d/gmond
chkconfig –add gmond
chkconfig –list gmond | grep gmond
sed -i “s/user = nobody/user = root/” /etc/ganglia/gmond.conf
sed -i “s/name = \”unspecified\”/name = \”CLOUD\”/” /etc/ganglia/gmond.conf
service gmond start
sleep 1
telnet localhost 8649
cd ..
cd ..
set +x
else
echo “ERROR: ganglia-3.1.7.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

if [ “$type” == “server” ] ; then
#################### OPENSSL ######################################
echo “Install OPENSSL ==========================================>”
if [ ! -f “/usr/local/ssl/lib/libcrypto.so” ] ; then
if [ -f “openssl-1.0.0d.tar.gz” ] ; then
set -x
tar -zxvf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
./config -fPIC enable-shared
make clean
make
make install
echo /usr/local/ssl/lib > /etc/ld.so.conf.d/libssl.conf
ldconfig
ldconfig -p|grep libssl
ldconfig -v|grep libssl
cd ..
set +x
else
echo “ERROR: openssl-1.0.0d.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### APACHE ######################################
echo “Install APACHE ==========================================>”
if [ ! -f “/usr/local/httpd/bin/httpd” ] ; then
if [ -f “httpd-2.2.19.tar.gz” ] ; then
set -x
tar -zxvf httpd-2.2.19.tar.gz
cd httpd-2.2.19
./configure –prefix=/usr/local/httpd –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr/bin/apu-1-config –with-ssl=/usr/local/ssl –enable-modules=so –enable-dav –enable-ssl –enable-maintainer-mode –enable-rewrite
make clean
make
make install
sed -i ‘/# LoadModule foo_module/a\LoadModule php5_module        modules/libphp5.so\nAddType application/x-httpd-php         .php .php4 .php3 .phtml\nAddType  application/x-httpd-php-source  .phps’ /usr/local/httpd/conf/httpd.conf
sed -i “s/DirectoryIndex index.html/DirectoryIndex index.html index.php/” /usr/local/httpd/conf/httpd.conf
cd ..
set +x
else
echo “ERROR: httpd-2.2.19.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### PHP ######################################
echo “Install PHP ==========================================>”
if [ ! -f “/usr/local/php/bin/php” ] ; then
if [ -f “php-5.3.6.tar.gz” ] ; then
set -x
tar -zxvf php-5.3.6.tar.gz
cd php-5.3.6
./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php –with-apxs2=/usr/local/httpd/bin/apxs –with-openssl=/usr/local/ssl
make clean
make
make install
cp php.ini-production /usr/local/php/php.ini
sed -i “s/;date.timezone =/date.timezone = PRC/” /usr/local/php/php.ini
cp libs/libphp5.so /usr/local/httpd/modules/
cd ..
set +x
else
echo “ERROR: php-5.3.6.tar.gz doesn’t exist.”
cd ..
exit -1
fi
sleep 5
fi

#################### Ganglia WEB ######################################
echo “Install Ganglia WEB ==========================================>”
set -x
cd ganglia-3.1.7
mkdir /usr/local/httpd/htdocs/ganglia
cp -a web/* /usr/local/httpd/htdocs/ganglia/
cd ..
set +x

#################### START APACHE ######################################
echo “Start APACHE ==========================================>”
set -x
/usr/local/httpd/bin/apachectl stop
sleep 3
/usr/local/httpd/bin/apachectl start
set +x

fi

#################### SELF Ganglia_io.py ######################################
echo “Install SELF Ganglia_io.py ==========================================>”
set -x
mkdir /usr/lib64/ganglia/python_modules
\cp -f ganglia_io.py /usr/lib64/ganglia/python_modules/
\cp -f ganglia_hadoop_proc.py /usr/lib64/ganglia/python_modules/
\cp -f ganglia_hbase_proc.py /usr/lib64/ganglia/python_modules/
\cp -f ganglia_onest_proc.py /usr/lib64/ganglia/python_modules/
mkdir /etc/ganglia/conf.d
\cp -f ganglia_io.pyconf /etc/ganglia/conf.d/
\cp -f ganglia_hadoop_proc.pyconf /etc/ganglia/conf.d/
\cp -f ganglia_hbase_proc.pyconf /etc/ganglia/conf.d/
\cp -f ganglia_onest_proc.pyconf /etc/ganglia/conf.d/
service gmond stop
sleep 3
service gmond start
set +x

echo “>>>>>>>>>>>>>>>>>> Ganglia Installing Finished <<<<<<<<<<<<<<<<<<<<<<<<“

1,859次阅读

Post navigation

前一篇:

Windows单网卡绑定多IP

后一篇:

RHEL5.x的KichStart配置文件

发表回复 取消回复

要发表评论,您必须先登录。

个人介绍

需要么,有事情这里找联系方式:关于天楚锐齿

=== 美女同欣赏,好酒共品尝 ===

微信扫描二维码赞赏该文章:

扫描二维码分享该文章:

分类

  • Linux&Android (81)
  • Uncategorized (1)
  • 下载 (28)
  • 云计算 (38)
  • 人工智能 (9)
  • 大数据 (35)
  • 嵌入式 (34)
  • 杂七杂八 (35)
  • 物联网 (65)
  • 网络 (25)
  • 通信 (22)

归档

近期文章

  • 飞书机器人发送卡片interactive消息
  • Springboot JPA实现对数据库表统一的增删改查
  • WEB的内容安全策略CSP(Content-Security-Policy)
  • CSS利用@media和viewport实现响应式布局自动适配手机电脑等
  • VUE前端增加国际化支持

近期评论

  • linux爱好者 发表在《Linux策略路由及iptables mangle、ip rule、ip route关系及一种Network is unreachable错误》
  • maxshu 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • Ambition 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • Ambition 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • maxshu 发表在《Android9下用ethernet 的Tether模式来做路由器功能》

阅读量

  • 使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序 - 23,810次阅读
  • 卸载深信服Ingress、SecurityDesktop客户端 - 18,519次阅读
  • 车机技术之车规级Linux-Automotive Grade Linux(AGL) - 10,570次阅读
  • linux下的unbound DNS服务器设置详解 - 9,323次阅读
  • 在Android9下用ndk编译vSomeIP和CommonAPI以及使用例子 - 9,136次阅读
  • linux的tee命令导致ssh客户端下的shell卡住不动 - 8,639次阅读
  • Linux策略路由及iptables mangle、ip rule、ip route关系及一种Network is unreachable错误 - 8,126次阅读
  • 车机技术之360°全景影像(环视)系统 - 8,088次阅读
  • 车机技术之Android Automotive - 7,940次阅读
  • Windows下安装QEMU并在qemu上安装ubuntu和debian - 7,840次阅读

其他操作

  • 注册
  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org

联系方式

地址
深圳市科技园

时间
周一至周五:  9:00~12:00,14:00~18:00
周六和周日:10:00~12:00

标签

android AT命令 CAN centos docker Hadoop hdfs ip java kickstart linux mapreduce mini6410 modem nova OAuth openstack os python socket ssh uboot 内核 协议 安装 嵌入式 性能 报表 授权 操作系统 数据 数据库 月报 模型 汽车 深信服 源代码 统计 编译 脚本 虚拟机 调制解调器 车机 金融 鉴权
© 2025 天楚锐齿