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. _stdcall与_cdecl(了解)

    调用约定(Calling Convention)是指在程序设计语言中为了实现函数调用而建立的一种协议.这种协议规定了该语言的函数中的参数传送方式.参数是否可变和由谁来处理堆栈等问题.不同的语言定义了不 ...

  2. XSS Filter Evasion Cheat Sheet 中文版

    前言 译者注: 翻译本文的最初原因是当我自己看到这篇文章后,觉得它是非常有价值.但是这么著名的一个备忘录却一直没有人把它翻译成中文版.很多人仅仅是简单的把文中的 各种代码复制下来,然后看起来很刁的发在 ...

  3. WCF中的标准绑定

    使用过WCF的童鞋们都很清楚,绑定是必须的.我将这些绑定总结了下. 一.标准绑定简要说明 1.basicHttpBinding 基于WS-I Basic Profile 1.1 的web服务,所需的. ...

  4. 使用guava带来的方便

    ​    ​guava是在原先google-collection 的基础上发展过来的,是一个比较优秀的外部开源包,最近项目中使用的比较多,列举一些点.刚刚接触就被guava吸引了... ​    ​这 ...

  5. BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler错误的解决方法

    出现这个问题是因为我的spring3.0里的包是单独引用的,缺少了别的包 譬如Configuration problem: Unable to locate Spring NamespaceHandl ...

  6. UML(统一建模语言)

    最近看了一个UML图,所以特意来了解一下UML 统一建模语言 锁定 同义词 UML(统一建模语言)一般指统一建模语言 本词条由“科普中国”百科科学词条编写与应用工作项目 审核 . Unified Mo ...

  7. sql 去除重复记录

    1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select   peopleId from  ...

  8. Spring常用的接口和类(三)

    一.CustomEditorConfigurer类 CustomEditorConfigurer可以读取实现java.beans.PropertyEditor接口的类,将字符串转为指定的类型.更方便的 ...

  9. NGUI 学习笔记实战之二——商城数据绑定(Ndata)

    上次笔记实现了游戏商城的UI界面,没有实现动态数据绑定,所以是远远不够的.今天采用NData来做一个商城. 如果你之前没看过,可以参考上一篇博客   NGUI 学习笔记实战——制作商城UI界面  ht ...

  10. 从图片加载纹理-使用glut工具

    转载 http://blog.csdn.net/dreamcs/article/details/7696069