RedHat linux 默认是安装了yum软件的,但是由于激活认证的原因让redhat无法直接进行yum安装一些软件,如果我们需要在redhat下直接yum安装软件,我们只用把yum的源修改成CentOS的就好了,然后把源里面的变量全部修改成实际的值,这样就能使用yum直接安装我们需要的软件了。

使用说明

(先将/etc/yum.repos.d的内容移到其他地方,将下载后的.repo复制到/etc/yum.repos.d中)

cd /etc/yum.repos.d/

mv redhat.repo /home/hadoop/

mv rhel-source.repo /home/hadoop/

1、到http://mirrors.163.com的 centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repos.d中(注意:需要联网)

Centos 5    wget  http://mirrors.163.com/.help/CentOS5-Base-163.repo

Centos 6    wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

vi  /etc/yum.repos.d/CentOS6-Base-163.repo

修改:(将全部的$releasever 改为:6)

如将baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/ 

中的$releasever 改为:6

即:baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

编辑完后保存,运行:

yum clean all 清除原有缓存

yum makecache 获取yum列表

就会看到:

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:03
base/filelists_db | 5.3 MB 00:41

.........

后面的省略

安装好了,即可以试试:yum install gcc g++

下面很上面的内容无关

d) 安装程序包
yum install rrdtool-devel
yum install compat-expat1
yum install httpd
yum install gcc g++
yum -y install apr-util-devel
yum install pcre-devel
yum install zlib-devel
yum instal php
yum install php-gd
yum install xorg-x11-server-Xorg

准备环境

# lsb_release -a

[root@host2 yum.repos.d]# lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.2 (Santiago)
Release: 6.2
Codename: Santiago

S1、安装gmond

在本地软件库中搜索gmond安装包
    [root@stonex ~]# yum search ganglia-gmond
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.ustc.edu.cn
     * extras: centos.ustc.edu.cn
     * updates: centos.ustc.edu.cn
    Warning: No matches found for: ganglia-gmond
    No Matches found
    
    显示搜索失败,可能是当前RPM发行版中没有Ganglia安装包。
    
    [root@stonex ~]# rpm -Uvh \
    > http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    warning: /var/tmp/rpm-tmp.L2dC50: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
    Preparing...                ########################################### [100%]
       1:epel-release           ########################################### [100%]
    [root@stonex ~]#
     
    再搜索(首次执行会下载epel/primary_db)
    [root@stonex ~]# yum search ganglia-gmond
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    省略了一些行......
    ganglia-gmond.x86_64 : Ganglia Monitoring daemon
    ganglia-gmond-python.x86_64 : Ganglia Monitor daemon python DSO and metric modules
    省略了一些行......
    [root@stonex ~]# 
    
    安装
    [root@stonex ~]# yum install ganglia-gmond -y
    yum安装会自动解决头疼的依赖包问题

S2、安装gmetad

和gmond安装中介绍的相同,如果本地软件库不提供gmetad,那么需要安装EPEL。
    [root@stonex ~]# yum install ganglia-gmetad -y
    会发现安装了以下依赖包:
    Dependency Installed:
      dejavu-fonts-common.noarch 0:2.30-2.el6 dejavu-lgc-sans-mono-fonts.noarch 0:2.30-2.el6 dejavu-sans-mono-fonts.noarch 0:2.30-2.el6 fontpackages-filesystem.noarch 0:1.41-1.1.el6   rrdtool.x86_64 0:1.3.8-6.el6

S3、安装gweb

Wiki:http://sourceforge.net/apps/trac/ganglia/wiki/ganglia-web-2#Installation

在进行gweb的安装和配置前,请先检查是否已经
    满足下面需求:
        Apache Web Server
        PHP 5.2及更新版本
        PHP JSON 扩展的安装和启用
        
    首先安装Apache和PHP 5
    [root@stonex ~]# yum install httpd php
    会发现安装了以下依赖包:
    Dependency Installed:
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1   httpd-tools.x86_64 0:2.2.15-29.el6.centos   mailcap.noarch 0:2.1.31-2.el6   php-cli.x86_64 0:5.3.3-27.el6_5   php-common.x86_64 0:5.3.3-27.el6_5
    
    需要启用PHP的JSON扩展,JSON已经包含在PHP 5.2及更新版本中。
    通过检查/etc/php.d/json.ini文件来检查JSON扩展的状态,如果已经启用JSON扩展,在该文件中应该包含类似下面语句的内容:
    extension=json.ini
    
    下载最新版本的gweb(https://sourceforge.net/projects/ganglia/files/gweb/)
    本示例当前最新版本为3.5.12
    [root@stonex ~]# wget http://ncu.dl.sourceforge.net/project/ganglia/ganglia-web/3.5.12/ganglia-web-3.5.12.tar.gz
    [root@stonex down]# tar -zxvf ganglia-web-3.5.12.tar.gz
    [root@stonex down]# cd ganglia-web-3.5.12
    
    编译Makefile
    [root@stonex ganglia-web-3.5.12]# vim Makefile
    可以查看一些用户默认配置:
    ##########################################################
    # User configurables:
    ##########################################################
    # Location where gweb should be installed to (excluding conf, dwoo dirs).
    GDESTDIR = /usr/share/ganglia-webfrontend

# Location where default apache configuration should be installed to.
    GCONFDIR = /etc/ganglia-web

# Gweb statedir (where conf dir and Dwoo templates dir are stored)
    GWEB_STATEDIR = /var/lib/ganglia-web

# Gmetad rootdir (parent location of rrd folder)
    GMETAD_ROOTDIR = /var/lib/ganglia

APACHE_USER = www-data
    ##########################################################
    
    修改默认配置:
    GDESTDIR = /var/www/html/ganglia2
    APACHE_USER = apache

注意:GDESTDIR 和 APACHE_USER 要与APACHE的配置文件(/etc/httpd/conf/httpd.conf)中的  DocumentRoot 、 apache保持一致

 make install

S4、状态检查

检查httpd是否启动:
    [root@stonex ~]# service httpd status
    启动httpd:
    [root@stonex ~]# service httpd start
    
    检查gmetad是否启动:
    [root@stonex ~]# service gmetad status
    启动gmetad:
    [root@stonex ~]# service gmetad start
    
    检查本地gmond是否启动:
    [root@stonex ~]# service gmond status
    启动gmond:
    [root@stonex ~]# service gmond start

S5、关闭SELinux

如果你跳过这一步,打开http://<server ip address>/ganglia2会出现以下异常:
    There was an error collecting ganglia data (127.0.0.1:8652): fsockopen error: Permission denied
    
    SELinux是什么?
    http://wiki.centos.org/zh/HowTos/SELinux
    
    查看SELinux状态:
    [root@stonex ~]# sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /selinux
    Current mode:                   permissive
    Mode from config file:          enforcing
    Policy version:                 24
    Policy from config file:        targeted
    
    关闭SELinux:
    [root@stonex ~]# setenforce 0
    setenforce 这个指令可以即时切换 Enforcing 及 Permissive 这两个模式,但这些改动在系统重新开机时不会被保留。
    要想在下次开机后生效,需要在 /etc/selinux/config 内修改 SELINUX= 这一行为 enforcing。

S6、访问Ganglia监控平台

http://<server ip address>/ganglia2/
    
    目录“/ganglia2”可以在 ganglia-web的Makefile文件中GDESTDIR被修改,修改后需要重新编译

来源:http://blog.csdn.net/xxd851116/article/details/21527055

redhad借用CentOs yum 安装的更多相关文章

  1. centos yum 安装 mongodb 以及php扩展

    centos yum 安装 mongodb 以及php扩展 投稿:hebedich 字体:[增加 减小] 类型:转载 MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用 ...

  2. 【转】CentOS yum安装和卸载软件的使用方法

    在CentOS yum安装和卸载软件的使用方法安装方法安装一个软件时.   CentOS yum -y install httpd安装多个相类似的软件时   CentOS yum -y install ...

  3. CentOS yum 安装LAMP PHP5.4版本

    CentOS yum 安装LAMP PHP5.4版本 [日期:2015-06-04] 来源:Linux社区  作者:rogerzhanglijie [字体:大 中 小]     Linux系统版本:C ...

  4. CentOS yum安装mcrypt

    CentOS yum安装mcrypt   本篇排错的前提是只想用yum安装,不想使用源码包编译安装. php依赖一下包:   #yum install libmcrypt libmcrypt-deve ...

  5. CentOS yum安装mcrypt详细图解教程

    CentOS yum安装mcrypt详细图解教程 在Linux的发行版CentOS 6.3 系统下,LAMP(Linux+Apache+Mysql+php)环境搭建好后发现PHPMyadmin提示 “ ...

  6. centos yum 安装php5.6

    centos yum 安装php5.6 卸载 php之前的版本: yum remove -y php-common 配置源 CentOS 6.5的源 rpm -Uvh http://ftp.iij.a ...

  7. linux centos yum安装LAMP环境

    centos 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源 ...

  8. centos yum 安装问题

    yum [Errno 256] No more mirrors to try 解决方法 输入下面的命令即可解决问题: yum clean all yum makecache 导致 centos安装软件 ...

  9. linux centos yum 安装 rar

    linux yum安装rar时,可能会出现无资源的错误,只需把配置好资源即可,具体操作如下: 1.# vi /etc/yum.repos.d/dag.repo 2.将以下内容写入文件中 [dag] n ...

随机推荐

  1. Codeforces 295A Greg and Array

    传送门 A. Greg and Array time limit per test 1.5 seconds memory limit per test 256 megabytes input stan ...

  2. JS 在线网站

    JS 在线压缩网站 国内压缩js网站http://tool.css-js.com/ uglifyjs 压缩js网站http://lisperator.net/uglifyjs JS在线格式化网站 ht ...

  3. .NET/MVC-发布到IIS6.1提示未能加载程序集System.Web.Http.WebHost

    http://www.bubuko.com/infodetail-1128065.html vs2013发布后,自己的用iis7.0可以发布这个网站,但是用服务器2008 IIS6.1发布这个网站一直 ...

  4. cheerio, dom操作模块

    cheerio 为服务器特别定制的,快速.灵活.实施的jQuery核心实现. Introduction 将HTML告诉你的服务器 var cheerio = require('cheerio'), $ ...

  5. 提示用户一直输入数字(默认为正整数),当用户输入end的时候显示当前输入数字中的最大值。

    string input = ""; ; while (input != "end") { Console.WriteLine("请输入一个正整数,输 ...

  6. nginx+php出现502 不能解析

    到php-fpm下面查看配置文件看引用的文件,找到listening 在nginx里面配置为sock方式

  7. Bootstrap新手学习笔记——css

    Css模块: 1.网格系统: class前缀:.col-xs-*,.col-sm-*,.col-md-*,.col-lg-* <div class="container"&g ...

  8. Google搜索命令语法大全

    以下是目前所有的Google搜索命令语法,它不同于Google的帮助文档,因为这里介绍 了几个Google不推荐使用的命令语法.大多数的Google搜索命令语法有它特有的使用格式,希望大家能正确使用. ...

  9. c# 改变图片的大小(w,h)

    本文介绍获取网络上的图片将其大小尺寸改成自己想要的 /// <summary> /// 图片大小裁剪 /// </summary> /// <param name=&qu ...

  10. asp.net过滤数据中有异常数据字符串

    /// <summary> /// 过滤数据 /// </summary> /// <param name="_str"></param& ...