RabbitMQ(1)Install on Redhat

RabbitMQ(1)Install on Redhat

First of all, I tried to install this software on redhat. I choose the general unix way to do that.

1. Check my yum
>yum --version
2.0.7
>python -V
2.3.4

update my yum repository
>sudo vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
#name=CentOS-$releasever – Base
name=Red Hat Linux $releasever - $basearch - Base
#baseurl=http://mirror.centos.org/centos/4/os/i386/
baseurl=http://vault.centos.org/4.9/os/i386/
gpgcheck=1

[updates]
#name=Red Hat Linux $releasever – Updates
name=Red Hat Linux $releasever - Updates
#baseurl=http://mirror.centos.org/centos/4/updates/i386/
baseurl=http://vault.centos.org/4.9/updates/i386/
gpgcheck=1

And change the /etc/yum.repos.d/CentOS-Base.repo content to
http://vault.centos.org/4.9 as well.

>sudo yum update

2. Install erlang
>sudo wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
>sudo yum update
>sudo yum install erlang

error message:
Finding updated packages
Downloading needed headers
Cannot find a package matching erlang
No actions to take

solution:
maybe, because my yum version is very old, the erlang repo is not working.
I copy the content to /etc/yum.conf
...snip..
[epel-erlang]
name=Erlang/OTP R14B
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-$releasever/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0

[epel-erlang-source]
name=Erlang/OTP R14B - Source
baseurl=http://repos.fedorapeople.org/repos/peter/erlang/epel-$releasever/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0

But still, there is error message, maybe, the yum is too old. I will try to update that.
retrygrab() failed for:
  http://repos.fedorapeople.org/repos/peter/erlang/epel-4/i386/headers/header.info
  Executing failover method
failover: out of servers to try
Error getting file http://repos.fedorapeople.org/repos/peter/erlang/epel-4/i386/headers/header.info
[Errno 4] IOError: HTTP Error 404: Not Found

solution:
update my yum to 3.4.3, python to 2.6.1.
>which yum
>sudo vi /usr/bin/yum

>yum --version
Traceback (most recent call last):
  File "/usr/bin/yum", line 28, in ?
    import yummain
  File "/usr/share/yum-cli/yummain.py", line 30, in ?
    from yum import logginglevels
ImportError: cannot import name logginglevels

solution:
I will try the version yum 3.2.19  Python 2.4.3
>wget http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tar.bz2
>tar -jxvf Python-2.4.3.tar.bz2
>cd Python-2.4.3
>./configure --prefix=/usr/python2.4.3
>sudo mkdir /usr/python2.4.3
>make
>sudo make install
>sudo mv /usr/bin/python /usr/bin/python2.6.1
>sudo ln -s /usr/python2.4.3/bin/python /usr/bin/python
>python -V
Python 2.4.3

>wget http://yum.baseurl.org/download/3.2/yum-3.2.19.tar.gz
>sudo rm /usr/bin/yum
>sudo rm /usr/bin/yum-arch
>tar zxvf yum-3.2.19.tar.gz
>cd yum-3.2.19
>sudo make
>sudo make install

>yum --version
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Solution:
>whereis python
python: /usr/bin/python /usr/bin/python2.3 /usr/lib/python2.3 /usr/include/python2.3 /usr/share/man/man1/python.1.gz

I am really unhappy about the yum version and the python version. Maybe, I will make it better next time. I will try other way to install erlang on my redhat.

3. Install erlang from source
>wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
>tar zxvf otp_src_R15B01.tar.gz
>cd otp_src_R15B01
>export LANG=C
>./configure  --prefix=/usr/erlang
>make
>sudo make install
>cd /usr/erlang/bin
>erl

And I will link the erl file to /usr/bin
>sudo ln -s /usr/erlang/bin/erl /usr/bin/erl

4. I will install rabbitMQ
I will try to install rabbitmq with http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.2/rabbitmq-server-2.8.2-1.noarch.rpm.
>sudo rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
>sudo yum install rabbitmq-server-2.8.2-1.noarch.rpm
This is not working because my yum version is low maybe.

I will try to install rabbitmq in general way.
>wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.2/rabbitmq-server-generic-unix-2.8.2.tar.gz
>tar zxvf rabbitmq-server-generic-unix-2.8.2.tar.gz
>sudo mv rabbitmq_server-2.8.2 /opt/tools/rabbitmq_server-2.8.2

Start the server
>cd /opt/tools/rabbitmq_server-2.8.2
>sudo sbin/rabbitmq-server

Check the status and stop the server
>sudo sbin/rabbitmqctl status
>sudo sbin/rabbitmqctl stop

references:
http://www.rabbitmq.com/install-windows.html
http://www.rabbitmq.com/install-generic-unix.html
http://mirrors.163.com/.help/centos.html?1304848825
http://sillycat.iteye.com/blog/1156180
http://nigelzeng.iteye.com/blog/1522554
http://zhb1208.iteye.com/blog/1330658

http://sillycat.iteye.com/blog/1155915
http://www.cxybase.com/201011/yum-python-error/
http://www.question-defense.com/2009/12/25/how-to-install-python-2-6-on-centos-5-without-breaking-yum
http://www.red-dove.com/python_logging.html#download
http://sillycat.iteye.com/blog/1154047

http://dennis-zane.iteye.com/blog/95572

猜你喜欢

转载自sillycat.iteye.com/blog/1565771