Based on Ubuntu 12.04.4 LTS

1. vi /etc/hostname and /etc/hosts to set hostname for two nodes

vi /etc/hosts

# eth0 network for production

192.168.1.21    ubuntu1204
192.168.1.22    ubuntu1204-2
# for dedicated heartbeat network to avoid problems
# eth1 network
10.10.10.1    ubuntu1204p

10.10.10.2    ubuntu1204-2p

2. on two nodes

aptitude -y install pacemaker cman fence-agents

3. on two nodes

echo "CMAN_QUORUM_TIMEOUT=0" >> /etc/default/cman

4. on two nodes

vi /etc/cluster/cluster.conf

<?xml version="1.0"?>
<cluster config_version="1" name="mycluster">
 <logging debug="off"/>
 <clusternodes>
   <clusternode name="ubuntu1204p" nodeid="1">
     <fence>
       <method name="pcmk-redirect">
          <device name="pcmk" port="ubuntu1204p"/>
       </method>
     </fence>
 </clusternode>
 <clusternode name="ubuntu1204-2p" nodeid="2">
    <fence>
       <method name="pcmk-redirect">
          <device name="pcmk" port="ubuntu1204-2p"/>
        </method>
      </fence>
  </clusternode>
</clusternodes>
<fencedevices>
   <fencedevice name="pcmk" agent="fence_pcmk"/>
</fencedevices>
</cluster>

5. on two nodes

ccs_config_validate
6. on two nodes
service cman start
check nodes status with cman_tool nodes
7. on two nodes
service pacemaker start

update-rc.d pacemaker defaults

8. for a two nodes cluster, run from one node

crm configure property stonith-enabled="false"
crm configure property no-quorum-policy="ignore"
#crm configure rsc_defaults resource-stickiness="100"
9. crm_verify -LV
crm status

for more please check http://hj192837.blog.51cto.com/655995/1349593