How to Set up a Microsoft SQL Web Server cluster

Posted by: Leif  :  Category: News
Types of clusters:
A cluster is basically referred to as grouping of similar things to reduce the load or work of a single one. When it comes to servers there are 2 types of clusters :

1) Load Balancing Web Server ;

Load balancing Web Server is setup so that the traffic load is distributed among a number of servers instead of one single server. It involves a number of servers which are setup in such a way that the traffic is equally distributed among all of them. Due to this kind of a setup, the network load is not concentrated on one single server and this helps in improving the reliability with the tremendous improvement in performance. This kind of setup is also available for 2 or more nodes in the cluster.

2) Failover cluster Server :

Failover cluster also involves a number of servers but this is not the same as Load Balancing servers. Failover, as the term suggests, is setup to provide high availability even after there is an hardware or software failure. Once there is a software or an hardware failure, an action is taken by the cluster immediately so that the resources of the server are moved to another server. Cluster is informed once the hardware of software failure has taken place as the cluster keeps on monitoring the resources.

Real time failover for hardware and software failures including the current status of the applications can be acheived by fault-tolerant failover cluster. But this requires a better software application and more hardware and this is due to the fact that the condition of the current applications must be known. The applications which are currently in use are lost while the failover process is going on by the hardware and the software components and these should be recovered.

Microsoft’s Cluster Service (also known as MSCS) is exactly opposite to the true fault-tolerant cluster and is built in as a high-availability cluster. This is better as the cluster will not require specialized fault-tolerant solution and can work with more applications with less hardware also. This will definitely reduce the price. The cluster will not be in a good position after the failover but will be able to recover from a hardware or software failure. Two servers (nodes) are supported by the MSCS high-availability solution.

Basic hardware and software components

A common set of hardware is involved which are actually two servers nodes in a cluster. Both the servers in the cluster are connected to the network and both of them have there own operating system. The harddisks are external but they are connected to the servers through a network. A drive controller connects the shared disks to the servers. A Storage Area Network (SAN) is commonly used for this purpose.

Only one of the nodes in the cluster is active at a time. They are not active together and hence this solution is also called as an active/passive solution. The resources of the cluster is used up by the active server (node) and the active server writes all the data on the Shared disks. If one node fails the other one comes into play. To make sure that all the nodes are working properly, a signal known as a heartbeat is sent accross the private network to which all the servers are connected. If the active server fails, the passive server gets a signal about it through the heartbeats and once it receives the signal, it starts working as an active server and starts using all the resources of the cluster.

How to Install SQL Server in a cluster ?

Operational cluster is required to install SQL server in the cluster. Follow the steps given below to install Operational cluster.

1) First, install a Windows Server edition which supports MSCS on each server.

2) Now, make sure that each server in the cluster is connected to a Public network which is required to receive requests.

3) Make a different network and all the servers shouldn’t be connected to this network as this network should only be established between two servers within the cluster. This network will only be used for the heartbeats to send signals.

4) You will have to create a user account for the service account so that the cluster operates under this account in the domain. Make sure that you add this account to each Administrator’s group of each server.

5) Now you will have to connect the Shared harddisks to the server and you will have to power off the servers for this purpose. Once you connect the Shared harddisks to the servers make sure that the resources are being used by the server. Turn on node number one of the cluster.

6) Install Microsoft Cluster service and then configure it through control panel. Follow the steps given below to do this.

a. Go to Control Panel.

b. Then, Add/Remove Programs

c. Finally, Windows Components

7) You will have to give a name to your cluster and also assign an IP address with the Shared disk resources.

Now turn on the second node in the cluster and move to the First one (Original one) once the second one is online. Once you get back to the original one, to add another node use the Cluster Administrator.

Note : You will be able to install the second node quite easily in comparison to the first one as it will be based on the configuration of the second one.

Once you have installed the cluster sucessfully and everything works fine, follow the steps given below to install SQL server into the cluster :

1. To begin the installation process, you will have to insert the SQL Server Enterprise edition CD. If the installation does not start auto-matically, launch the setup through setup.exe.

2. Select Virtual Server on the computer name screen and enter a name by which you would like the Cluster be referred.

Note : This name is a Virtual name and is just like the hostname of a server.

3. Now make a service account to run the SQL web server and make sure that you provide Administration rights on each node on the cluster.

4. You will have to assign an IP address, Shared Resources and a service account to the SQL server while the installation.

Once you have done all the above steps correctly, a copy of SQL Server server will be installed on each node by the setup program within the cluster and the setting of the cluster will be installed automatically. Now you will be able to control the SQL server services by the cluster administrator.

How to prevent spamming by using cPanel?

Posted by: Leif  :  Category: Administration

cPanel servers have a good small file named as antivirus.exim. It is a central filter for the exim mail server which lets you setup all kinds of good filters which helps you to stop spam from coming in and going out of your server.

In this article I will provide you my /etc/antivirus.exim config file which will help you to protect your servers from spammers. First off the default /etc/antivirus.exim has a couple different rule sets in it. The main ones are attachment filters to help stop email viruses from your users. They stop things like .src and .com and .exe attachments.This shows you some custom rules to stop spammers from sending out of your server, you can also use it to stop spam from coming in. I don’t really go into a lot of detail for filtering incoming mail since other applications like Spam Assassin handle that better IMO.

You will need root access to your cPanel server.

First off we need to create a special log file for these filters do this:

touch /var/log/filter.log chmod 0644 /var/log/filter.log

Now open up the configuration file vi /etc/antivirus.exim

Simply add this to your existing file, and save the changes and they take effect instantly.

# START # Filters all incoming an outgoing mail

logfile /var/log/filter.log 0644 ## Common Spam if

# Header Spam $header_subject: contains “Pharmaceutical” or $header_subject: contains “Viagra” or $header_subject: contains “Cialis” or $header_subject: is “The Ultimate Online Pharmaceutical” or $header_subject: contains “***SPAM***” or $header_subject: contains “[SPAM]”

# Body Spam or $message_body: contains “Cialis” or $message_body: contains “Viagra” or $message_body: contains “Leavitra” or $message_body: contains “St0ck” or $message_body: contains “Viaagrra” or $message_body: contains “Cia1iis” or $message_body: contains “URGENT BUSINESS PROPOSAL” or $message_body matches “angka[^s]+[net|com|org|biz|info|us|name]+?” or $message_body matches “v(i|1)agra|vag(i|1)n(a|4)|pen( i|1)s|asu|seks|l(o|0)l(i|1)ta|dewacolok”

then # Log Message – SENDS RESPONSE BACK TO SENDER # SUGGESTED TO LEAVE OFF to prevent fail loops # and more work for the mail system #fail text “Message has been rejected because it hasn # triggered our central filter.” logwrite “$tod_log $message_id from $sender_address contained spam keywords”

seen finish endif

# END # Filters all incoming an outgoing mail

# START # All outgoing mail on the server only – what is sent out

#Check forwarders so it doesn’t get blocked #Forwarders still work =)

## FINANCIAL FAKE SENDERS ## Log all outgoing mail from server that matches rules logfile /var/log/filter.log 0644 if ( $received_protocol is “local” or $received_protocol is “esmtpa” ) and ( $header_from contains “@citibank.com” or $header_from contains “@bankofamerica.com” or $header_from contains “@wamu.com” or $header_from contains “@ebay.com” or $header_from contains “@chase.com” or $header_from contains “@paypal.com” or $header_from contains “@wellsfargo.com” or $header_from contains “@bankunited.com” or $header_from contains “@bankerstrust.com” or $header_from contains “@bankfirst.com” or $header_from contains “@capitalone.com” or $header_from contains “@citizensbank.com” or $header_from contains “@jpmorgan.com” or $header_from contains “@wachovia.com” or $header_from contains “@bankone.com” or $header_from contains “@suntrust.com” or $header_from contains “@amazon.com” or $header_from contains “@banksecurity.com” or $header_from contains “@visa.com” or $header_from contains “@mastercard.com” or $header_from contains “@mbna.com” ) then logwrite “$tod_log $message_id from $sender_address is fraud” seen finish endif

## OTHER FAKE SENDERS SPAM ## Enable this to prevent users using @domain from addresses ## Not recommended since users do use from addresses not on the server ## Log all outgoing mail from server that matches rules logfile /var/log/filter.log 0644 if ( $received_protocol is “local” or $received_protocol is “esmtpa” ) and ( $header_from contains “@hotmail.com” or $header_from contains “@yahoo.com” or $header_from contains “@aol.com”

) then logwrite “$tod_log $message_id from $sender_address is forged fake” seen finish endif

## KNOWN FAKE PHISHING ### Log all outgoing mail from server that matches rules logfile /var/log/filter.log 0644 if ( $received_protocol is “local” or $received_protocol is “esmtpa” ) and ( #Paypal $message_body: contains “Dear valued PayPal member” or $message_body: contains “Dear valued PayPal customer” or $message_body: contains “Dear Paypal” or $message_body: contains “The PayPal Team” or $message_body: contains “Dear Paypal Customer” or $message_body: contains “Paypal Account Review Department” or

#Ebay $message_body: contains “Dear eBay member” or $message_body: contains “Dear eBay User” or $message_body: contains “The eBay team” or $message_body: contains “Dear eBay Community Member” or

#Banks $message_body: contains “Dear Charter One Customer” or $message_body: contains “Dear wamu.com customer” or $message_body: contains “Dear valued Citizens Bank member” or $message_body: contains “Dear Visa” or $message_body: contains “Dear Citibank” or $message_body: contains “Citibank Email” or $message_body: contains “Dear customer of Chase Bank” or $message_body: contains “Dear Bank of America customer” or

#ISPs $message_body: contains “Dear AOL Member” or $message_body: contains “Dear AOL Customer”

) then logwrite “$tod_log $message_id from $sender_address is phishing” seen finish endif

# END # All outgoing mail on the server only – what is sent out

The log file will have the logging format like this: /var/log/filter.log

2006-05-10 12:05:13 1Fds7S-0002Sa-MV from smooth595@gmail.com contained spam keywords 2006-05-10 14:18:47 1FduCn-0006GV-1r from dayton.nowellu7xn@gmail.com contained spam keywords 2006-04-27 15:44:35 1FZDLn-0005Mo-5z from nobody@ocean.wavepointmedia.com is fraud 2006-04-27 16:37:40 1FZEB9-0002KQ-VP from nobody@ocean.wavepointmedia.com is phishing

Date and time, the Exim message ID, the sender and the section of the filter, like phishing, fraud or spam. You can check the mail message by grepping the exim_mainlog for it like this

grep 1FZEB9-0002KQ-VP /var/log/exim_mainlog

CTO Edge on cloud computing

Posted by: Robert  :  Category: Business, Marketing

CTOEdge has published an interesting article on migrating to cloud computing… it’s written from a business perspective, but it is definitely relative to our industry as well. These are the things you want to be up on when talking to your customers about standard server based hosting vs. cloud hosting. I recommend that all hosts read it…

“The Long and Short of Assessing Cloud Computing Providers”
http://www.ctoedge.com/content/long-and-short-assessing-cloud-computing-providers

Reducing or extending a Logical Volume (lvm)

Posted by: Robert  :  Category: Administration

Logical Volumes are one of the cool technologies that finally made it to Linux.  LVMs present your filesystems with a virtual (or logical) drive to use that may reside on one or more physical volumes.  Once you start working with LVMs you’ll never want to go back. How about the ability to extend or reduce their size? Or my personal favorite, the ability to snapshot a filesystem, which is like taking a picture (a snapshot) of how it looked at a point in time.  This is done through some “trickery” with a snapshot volume that holds the real writes to the snapshotted volume on a separate LVM.  You can then backup the snapshotted LVM without worrying about if changes are being made to the filesystem. When you un-snapshot the LVM, all the writes are committed to the real LVM. As far as the applications thinks, the filesystem is business as usual. And unlike splitting mirrors, you 1) keep your redundancy intact 2) its MUCH faster and 3) you only need space to hold the writes.

But there are times you need to modify a filesystem.  For example, you may need to reduce or extend a Logical Volume on a system…  Say we have a /vz filesystem and we want to reduce it to 500GB to open some unused space for something else.

  1. Backup your data – this is ALWAYS step 1.
  2. umount /vz
  3. e2fsck -f /dev/Volgroup##/LogVol##    … where the #’s are the logical volume group and volume numbers for /vz
  4. resize2fs /dev/VolGroup##/LogVol##   500GB  … same ##’s as above
  5. lvreduce -L 500GB /dev/VolGroup/LogVol##  … do I need to say it?
  6. e2fsck -f /dev/VolGroup/LogVol##    …. just for good measure
  7. mount /vz   … or mount -a