Ethernet

September 28, 2008 by niharcsql

A local area network (LAN) architecture developed by Xerox Corporation in cooperation with DEC and Intel 1976. Ethernet uses a bus or star topology and supports data transfer rates of 10 Mbps. The Ethernet specification served as the basis for the IEEE 802.3 standard, which specifies the physical and lower software layers. Ethernet uses the CSMA/CD access method to handle simultaneous demands. It is one of the most widely implemented LAN standards.

A newer version of Ethernet, called 100 Dase -T (or Fast Ethernet), supports data transfer rates of 100 Mbps. And the newest version, Gigabit Ethernet supports data rates of 1 gigabit(1,000 megabits) per second.

It is a type of Local Area Network, which connects computers, printers, workstations etc using cable.It specifies how data is placed on and retrieved from a common transmission medium.

It is a network protocol defining a specific implementation of the Physical and Data Link Layers in the OSI model (IEEE 802.3)

It is one of the earliest and least expensive network types.It is Is the most commonly used method of connecting LANs. It allows for network communication by using either coaxial or twisted pair cable.Coaxial cable carries radio frequency signals between computers at a rate of 10 megabits per second.

CLUSTER

September 28, 2008 by niharcsql

Cluster

In general Cluster is a group of the same or similar elements gathered or occurring closely together;

In computer Terminology a cluster can refer to several machines grouped together, all performing a similar function. We can say in other way i.e. “Multiple systems performing a single function”. For example, a cluster may consist of eight PCs, all connected via high-speed Ethernet, processing scientific data. This type of setup is often referred to as “parallel computing,” since all the computers in the cluster are acting as one machine. Clusters are typically used for high-end processing, such as performing scientific calculations or decrypting algorithms.

Cluster applications

For many types of computing problems related to high-throughput applications, it is possible to take advantage of the scalable performance of a cluster without changing the application.

The main goal of a clustered environment is application resilience (Performance, Availability, Recoverability) . By taking advantage of resilient applications in your cluster, an application can be restarted on a different cluster node without requiring you to reconfigure the clients. In addition, the data that is associated with the application will be available after switchover or failover. This means that the application end user can experience minimal, or even seamless, interruption while the application and its data switch from the primary node to the backup node. The user does not need to know that the application and data have moved on the back end. For instance CSQL Cache is a high performance, bi-directional, updateable database caching infrastructure that sits between the clustered application process and back-end data sources to provide unprecedented high throughput to your application. Transparent Fail over in CSQL main memory database tells that There should not be any service outages, incase of caching platform failure. Client connections should be routed to the target databas

In order to achieve application resiliency in your cluster, applications that meet certain availability specifications must be used. Certain characteristics must be present in the application in order for it to be switchable, and therefore always available to the end users of the application in the cluster. Once you have a resilient application, it must be managed within your cluster.

A Switchover is the capability to manually switch over from one system to a  redundant  or standby computer server, syatem, or network upon the failure or abnormal termination of the previously active server, system, or network. It happens with human intervention. It is is a planned role reversal between the production database and one of its standby databases to avoid downtime during scheduled maintenance on the production system or to test readiness for future role transitions. A switchover guarantees no data loss. During a switchover, the production database transitions to standby role, and the standby database transitions to the production role. The transition occurs without having to restart either database. A switchover is performed by an administrator through either Enterprise Manager or by issuing SQL commands.

A Failover is the capability to switch over automatically to a redundant or standby computer server, system, or network upon the failure or abnormal termination of the previously active server, system, or network. Failover happens without human intervention and generally without warning. It is performed when the production database fails and one of the standby databases is transitioned to take over the production role, allowing business operations to continue. Once the failover is complete and applications have resumed, the administrative staff can turn its attention to resolving the problems with the failed system. Failover may or may not result in data loss depending on the protection mode in effect at the time of the failover.

In Distributed Database system Both Data and their functionalities are spread accross nodes ; each machine has part of data. All nodes must have access over data. Synchronization between the systems is established, so that in case one node fails other takes over. In replicated system Data replicated at the server level (Network), or at the storage level; Multiple copies of the same database is maintained.

Two categories of failovers are there

  1. Active/Passive failover
  2. Active/Active failover

Active/Passive failover

-> One node is active

-> The other is passive until fail over

Active/Active failover

-> 2 separate databases are involved

-> One is active on node A and passive on node B

-> The second is active on node B and passive on node A

-> Separate applications and user connections to each of the different databases.

Efficient cluster application

An efficient application is one that can be resilient to a system outage in a clustered environment. Several levels of application availability are possible:

  1. If an application error occurs, the application restarts itself on the same node and corrects any potential cause for error (such as corrupt control data). You would view the application as though it had started for the first time.

  2. The application performs some amount of checkpoint-restart processing. You would view the application as if it were close to the point of failure.

  3. If a system outage occurs, the application is restarted on a backup server. You would view the application as though it had started for the first time.

  4. If a system outage occurs, the application is restarted on a backup server and performs some amount of checkpoint-restart processing across the servers. You would view the application as if it were close to the point of failure.

  5. If a system outage occurs, a coordinated failover of both the application and its associated data to another node or nodes in the cluster would take place. You would view the application as though it had started for the first time.

  6. If a system outage occurs, a coordinated failover of both the application and its associated data to another node or nodes in the cluster would take place. The application performs some amount of checkpoint-restart processing across the servers. You would view the application as if it were close to the point of failure.

scope of variables

September 26, 2008 by niharcsql
Open a terminal and Run the command 
$ MYVAR=hello
Create a file named EX1.sh and add the following contents in the file
#!/bin/sh
echo "MYVAR is: $MYVAR"
MYVAR="hi there"
echo "MYVAR is: $MYVAR"
Run the script
$./EX1.sh
OUTPUT:
MYVAR is:
MYVAR is: hi there

What is happening here?
When you call EX1.sh from your interacvive shell, a new shell is worked to run the script.this is partly becoz of the
 #/bin/sh line at the begining of the script, We need to export the variable for itto be inherited by another program.
Run the following command
$ export MYVAR
$ ./EX1.sh
OUTPUT
MYVAR is: hello
MYVAR is: hi there

Now in the 1st line of the output, the value of MYVAR is “hello” But there is no way that this will be passed back to your interactive shell. Try reading the value of MYVAR

$ echo $MYVAR
hello
$

Once the shell script exits, its environment is destroyed. But MYVAR keeps its value of hello within your interactive shell. In order to receive environment changes back from the script, we must source the script - this effectively runs the script within our own interactive shell, instead of spawning another shell to run it. We can source a script via the "." command:

Open another Terminal and run the following command
$ MYVAR=hello
$ echo $MYVAR
OUTPUT:
hello
$ . ./EX1.sh
MYVAR is: hello
MYVAR is: hi there
$ echo $MYVAR
hi there
In the above command MYVAR variable just inherits the value of MYVAR from Global scope temporarily.
This will not affect other files(What was happened using export command. create another file named EX2.sh
and add the following instructions
#!/bin/sh
echo "MYVAR is: $MYVAR"
MYVAR="hi there"
echo "MYVAR is: $MYVAR"
Run the script.See What happens

$./EX2.sh
OUTPUT:
MYVAR is:
MYVAR is: hi there
we are using the same variable in EX2.sh, But it is not displaying the value of the Global variable MYVAR.
It displaying the empty value.

SCOPE of Variables

September 26, 2008 by niharcsql

SETTING ENVIRONMENT VARIABLES by the help of export command

Normally all our variables are local. Local variable can be used in same shell, if you load another copy of shell (by typing the /bin/bash at the $ prompt) then new shell ignored all old shell’s variable. For e.g. Consider following example

$ myvar=NIHAR
$ echo $myvar
NIHAR
$ /bin/bash
$ echo $myvar

NOTE:-Empty line printed
This is due to the variable ‘myvar’ has only scope to the previous SHELL. That has the value “NIHAR” which has no scope to the /bin/bash SHELL. As there is no value assigned to the variable ‘myvar’ it shows the value of ‘myvar’ as empty. This can be solved by the export command
$ myvar=Papu
$ echo $myvar

Papu
$ exit
$ echo $myvar

NIHAR

Global shell defined as:
You can copy old shell’s variable to new shell (i.e. first shells variable to seconds shell), such variable is know as Global Shell variable.

To set global varible you have to use export command.
Syntax:
$ export variable1, variable2,…..variableN

Examples:
$ myvar=NIHAR
$ echo $myvar
NIHAR
$ export myvar
$ /bin/bash
$ echo $myvar
NIHAR
$ exit
$ echo $myvar

Nihar

Here one problem is arising. The export command set the value of ‘myvar’ for all SHELLs. That means the value of variable ‘myvar’ will have the same value in each SHELL . Suppose we do not want to see the same value of the variable ‘myvar’ in another SHELL what can be done?