Wednesday, October 5, 2011

Mangento exporting SQL issue

While exporting mySQL if you every get into the problem]


ERROR 1064 (42000) at line 688: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE,
  KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
  KEY `FK_CATALO' at line 9

and the mySQL is 
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE

You need to replace all such instance by 

UNIQUE KEY `IDX_BASE` USING BTREE(`entity_type_id`,`entity_id`,`attribute_id`,`store_id`)

Tuesday, October 4, 2011

How to making Linux multihomed to connect to 2 ISP

To make my Ubuntu Server on more robust I have connected it to 2 ISP so that I can have redundant last mile. Also one of my ISP gives me unlimited bandwidth while the other is costlier but more reliable.

1.
To make your linux server multihomed, I am assuming that you have atleast 2 network interfaces. In my case both are ethernet (eth0 and eth1)

2. 
Make sure both the networks are working individually up by setting it on /etc/network/interface
sudo vi /etc/network/interface

#Loopback
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.200.100
        netmask 255.255.255.0
        metric 100
        gateway 192.168.200.6

auto eth1
iface eth1 inet static
        address 192.168.201.100
        netmask 255.255.255.0
        metric 200
        gateway 192.168.201.5

Now if you go to your terminal, you should be able to
>ip route show
192.168.201.0/24 dev eth1  proto kernel  scope link  src 192.168.201.100
192.168.200.0/24 dev eth0  proto kernel  scope link  src 192.168.200.100
default via 192.168.200.6 dev eth0  metric 100
default via 192.168.201.5 dev eth1  metric 200

With this if your eth0 goes down, your eth1 will take over and vice-versa.
But this is still a long way from making your network multihoned where your can do load balancing.

All you need to do is to add  multihop route in your /etc/rc.local
ip route append default scope global nexthop via 192.168.200.6 dev eth0 weight 5 nexthop via 192.168.201.5 dev eth1 weight 1

USB for Ubuntu Server

Ubuntu Server does not come with auto-mount for USB.
You will need to install the light weight usbmount

sudo apt-get install usbmount