Skip to content

Instantly share code, notes, and snippets.

View sdoro's full-sized avatar

Sandro Doro sdoro

View GitHub Profile
@sdoro
sdoro / gist:4013891
Created November 4, 2012 21:42
drbd CentOS 5.x version
dmesg | grep drbd
drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)
drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by [email protected], 2010-06-04 08:04:27
drbd: registered as block device major 147
drbd: minor_table @ 0xffff88001a213480
@sdoro
sdoro / drbd.conf
Created November 4, 2012 21:47
/etc/drbd.conf
# /etc/drbd.conf
include /etc/drbd.d/globalCommon.conf;
include "drbd.d/*.res";
# BOT
@sdoro
sdoro / gist:4017181
Created November 5, 2012 13:29
bonding in Debian Squeeze
echo "alias bond0 bonding
options bonding mode=4 miimon=100 max_bonds=1" > /etc/modprobe.d/bonding.conf
# modprobe -v bonding
insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/bonding/bonding.ko
# dmesg| tail -n 2
[1724922.513994] Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
[1724922.514005] bonding: MII link monitoring set to 100 ms
@sdoro
sdoro / interfaces
Created November 5, 2012 13:43
configuration bond0 with interfaces eth1 and eth2 in Debian Squeeze
apt-get install ifenslave
# /etc/network/interfaces
auto bond0
iface bond0 inet static
address 10.254.254.253
netmask 255.255.255.252
network 10.254.254.252
broadcast 10.254.254.255
@sdoro
sdoro / gist:4024307
Created November 6, 2012 12:15
enable corosync at boot in Debian 6
cp -p /etc/default/corosync /etc/default/corosync.org
sed -i 's/START=no/START=yes/' /etc/default/corosync
@sdoro
sdoro / corosync.conf
Created November 6, 2012 15:26
corosync configuration in Debian 6
totem {
version: 2
# How long before declaring a token lost (ms)
token: 3000
# How many token retransmits before forming a new configuration
token_retransmits_before_loss_const: 10
# How long to wait for join messages in the membership protocol (ms)
@sdoro
sdoro / gist:4025434
Created November 6, 2012 15:32
get corosync.conf gist
cp -p /etc/corosync/corosync.conf /etc/corosync/corosync.conf.org
curl https://raw.github.com/gist/4025403/89e155644eeef98161fb318b85ee30202cf6ec0a/corosync.conf >> /etc/corosync/corosync.conf
@sdoro
sdoro / gist:4025483
Created November 6, 2012 15:37
corosync multicast addresses and ports
# netstat -plantu | grep corosync
udp 0 0 10.0.1.219:5410 0.0.0.0:* 3916/corosync
udp 0 0 10.0.1.219:5411 0.0.0.0:* 3916/corosync
udp 0 0 226.94.1.11:5411 0.0.0.0:* 3916/corosync
udp 0 0 10.254.254.254:5412 0.0.0.0:* 3916/corosync
udp 0 0 10.254.254.254:5413 0.0.0.0:* 3916/corosync
udp 0 0 226.94.1.13:5413 0.0.0.0:* 3916/corosync
@sdoro
sdoro / gist:4025523
Created November 6, 2012 15:42
corosync totem members and validation using the member’s ID
# corosync-objctl | grep member
runtime.totem.pg.mrp.srp.members.1526792202.ip=r(0) ip(10.0.1.219) r(1) ip(10.254.254.254)
runtime.totem.pg.mrp.srp.members.1526792202.join_count=1
runtime.totem.pg.mrp.srp.members.1526792202.status=joined
runtime.totem.pg.mrp.srp.members.1560346634.ip=r(0) ip(10.0.1.221) r(1) ip(10.254.254.253)
runtime.totem.pg.mrp.srp.members.1560346634.join_count=1
runtime.totem.pg.mrp.srp.members.1560346634.status=joined
# corosync-cfgtool -a 1526792202 -a 1560346634
10.0.1.219 10.254.254.254
10.0.1.221 10.254.254.253
@sdoro
sdoro / gist:4054136
Created November 11, 2012 08:13
Reset user name "postgres" password
sudo su - postgres
psql
ALTER USER postgres with password 'new-password';
\q