Archive

Posts Tagged ‘centos’

Creating a Mono 3 RPM on CentOS

July 27, 2013 2 comments

Creating a Mono 3 RPM on CentOS

A quick guide to creating an rpm of mono 3 from source, starting with a CentOS 6.4 minimal using fpm to create the package.

  1. Install prerequisites for building mono 3

    yum -y update
    yum -y install glib2-devel libpng-devel libjpeg-devel giflib-devel libtiff-devel libexif-devel libX11-devel fontconfig-devel gettext make gcc-c++
    
  2. Download and extract libgdiplus and mono sources

    curl -O http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
    curl -O http://download.mono-project.com/sources/mono/mono-3.1.2.tar.bz2
    tar -jxf libgdiplus-2.10.9.tar.bz2
    tar -jxf mono-3.1.2.tar.bz2
    
  3. Configure, make, and make install

    cd libgdiplus-2.10.9
    ./configure --prefix=/opt/libgdiplus
    # overwrite incompatible libtool script in pixman
    cp libtool pixman/libtool 
    make
    su -c "make install"
    
    cd mono-3.1.2
    ./configure --prefix=/opt/mono-3.1.2
    make
    su -c "make install"
    
  4. Install ruby prerequisites for fpm, then fpm itself

    yum -y install ruby ruby-devel rubygems
    gem install fpm
    
  5. Make sure /etc/hosts contains your host name since it will be used in some fpm defaults.

    vi /etc/hosts
    
  6. Install rpm tools and generate the RPM

    yum -y install rpm-build
    fpm -s dir -t rpm -n "mono" -v 3.1.2 /opt/mono-3.1.2 /opt/libdgiplus
    

You probably will want to explore some other fpm options to customize your rpm further, like setting the maintainer, dependencies, or running pre/post install scripts.

Categories: Uncategorized Tags: , , ,

RabbitMQ Clustering on CentOS 6.2

August 6, 2012 1 comment

RabbitMQ takes a little extra effort to get it working on CentOS 6, particularly if using clustering.  After you’ve installed, you need to do the following before trying to set up the cluster.

Edit /etc/hosts to ensure all cluster nodes can resolve the hostnames of each other.  These hostnames need to match what is displayed after `rabbit@` in rabbitmqctl status.

Next, you need to take care of the ports needed for distributed Erlang processes to communicate. If you don’t do this, then no matter what you do, when you try to create the cluster it will give you ‘error_no_running_cluster_nodes’.

RabbitMQ runs on Erlang, and tor the nodes to talk, they need a few extra ports open beyond the standard 5672 that AMQP uses.  One is for epmd (Erlang Port Mapper Daemon) and that is a standard 4369.  Then you have a port range that Erlang nodes to communicate. You need to define this range so you can open these ports on your firewall.

To tell RabbitMQ to instruct Erlang to communicate on a certain range of ports, create a file at /etc/rabbitmq/rabbitmq.config with the following contents:

[
{kernel, [{inet_dist_listen_min, 9100},{inet_dist_listen_max, 9105}]}
].

This will force the nodes in the cluster to only communicate over these ports.  Restart RabbitMQ with `service rabbitmq-server restart` so the change takes effect.  Now for the iptables configuration.  Update /etc/sysconfig/iptables with the following rules:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4369 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9100:9105 -j ACCEPT

After those changes, reload iptables with `/etc/init.d/iptables restart` so the new rules take effect.  At this point, you should be good to follow the RabbitMQ clustering guide step by step.

Categories: RabbitMQ Tags: , , ,