applications
Download
Report
Transcript applications
Operating Systems:
Internals and Design Principles, 6/E
William Stallings
Distributed system, 2nd
Andrew S Tanenbaum
Distributed Computing
Systems
Dr. Sunny Jeong & Mr. M.H. Park
Dave Bremer
Otago Polytechnic, N.Z.
©2008, Prentice Hall
Roadmap
• Distributed Computing Introduction
•
•
•
•
Client/Server Computing
Distributed message passing
Remote Procedure Calls
Clusters
Traditional
Data Processing
• Traditionally data processing was
centralised
• Typically involving centralised
– Computers
– Processing
– Data
Process Migration
• Transfer of sufficient amount of the state of
a process from one computer to another
• The process executes on the target
machine
Motivation
• Load sharing
– Move processes from heavily loaded to lightly
load systems
• Communications performance
– Processes that interact intensively can be
moved to the same node to reduce
communications cost
– May be better to move process to the data
than vice versa
Motivation
• Availability
– Long-running process may need to move
because of faults or down time
• Utilizing special capabilities
– Process can take advantage of unique
hardware or software capabilities
Initiation of Migration
• Operating system
– When goal is load balancing
• Process
– When goal is to reach a particular resource
What is Migrated?
• Must destroy the process on the source
system and create it on the target system
• Process image and process control block
and any links must be moved
Example of Process Migration
Example of Process Migration
Distributed
Data Processing
• Distributed Data Processing (DDP)
departs from the centralised model in one
or multiple ways.
• Usually smaller computers, are dispersed
throughout an organization.
• May involve central node with satellites, or
be a dispersed peer to peer approach
– Interconnection is usually required
Advantages of DDP
•
•
•
•
•
•
Responsiveness
Availability
Resource Sharing
Incremental growth
Increased user involvement and control
End-user productivity
Roadmap
• Distributed Computing Introduction
• Client/Server Computing
• Distributed message passing
• Remote Procedure Calls
• Clusters
Client/Server
Computing
• Client machines are generally single-user
workstations providing a user-friendly
interface to the end user
• Each server provides a set of shared
services to the clients
– enables many clients to share access to the
same database
– enables the use of a high-performance
computer system to manage the database
Client/Server
Terminology
Generic Client/Server
Environment
Client/Server Applications
• The key feature of a client/server
architecture is the allocation of applicationlevel tasks between clients and servers.
• Hardware and the operating systems of
client and server may differ
– These lower-level differences are irrelevant as
long as a client and server share the same
communications protocols and support the
same applications
Generic Client/Server
Architecture
Middleware Overview
• 1970s
– By Socket Programming
Network Computing
• 1980s-90s
– By RPC (Remote Procedure Call)
RPC on DCE
RPC on DCOM
Distributed Computing
• 1990s – 2000s
– By ROI (Remote Object Invocation)
ORB on CORBA Platform
RMI on Java Platform
Remote on .NET Platform
New web mechanism
Distributed Computing Systems
Data
Data
Front Server
Client
Data
Server
Backed Server
Data
Client
Server
Distributed Computing Systems
Data
Proxy
Data
Server
Client
Data
Client-Server Systems
Logical Layer
1 Tier
Data Layer(D)
Processing
Layer(P)
User Layer(U)
D, P, U
In
the
Machine
2 Tier
3 Tier
D in
Machine
Two
D in
Machine
Three
P, U
In
Machine
One
• Logical and physical architecture
P in
Machine
Two
U in
Machine
One
Client-Server Systems
a) Remote
Presentation
b) Distributed
Presentation
c) Distributed
Program
Data
Data
Data
Application
Program
Application
Program
Application
Program
d) Remote
Data
Data
e) Distributed
Data
Data
User Interface
Data
User Interface
•
User Interface
Application
Program
Application
Program
Application
Program
User Interface
User Interface
User Interface
2 Tier Architecture
Client-Server Systems
Data
Data
Data
Application
Program
Application
Program
Application
Program
Application
Program
Application
Program
Application
Program
User Interface
User Interface
• 3 Tier Architecture
Data
User Interface
Data
Application
Program
Data
Application
Program
User Interface
•
Client-Server
Systems
Client/Server Service
– Client and Server doing their jobs
– Between Client and Server, they communicate with
messages (without global variable )
• Characteristics
– Message exchanging is an interaction between Client and
Server
– Processes of Client and Server exist on other computers.
Client Process
Server Process
Client middleware
Server
Middleware
Local
Service
Network
Service
Local
Service
Network
Service
Middleware
• Definition
software layer that lies between the operating system and the applications on each
site of the system.
– Stimulated by the growth of network-based applications, middleware
technologies are taking an increasing importance. They cover a wide range of
software systems, including distributed objects and components, messageoriented communication, and mobile application support.
• Examples
– ftp, E-mail
– Web browsers
– Database drivers and gateways
– OSF’s DCE (Distributed Computing Environment)
– OMG’s CORBA (Common Object Request Broker Architecture)
Middleware
• Set of tools that provide a uniform means
and style of access to system resources
across all platforms
• Enable programmers to build applications
that look and feel the same
• Enable programmers to use the same
method to access data
Middleware
USER
Application
Application
user
middleware
middleware
middleware
middleware
Network
Aspect of users
Roles Components of Middleware
– to make application development easier, by providing common
programming abstractions, by masking the heterogeneity and the
distribution of the underlying hardware and operating systems, and by
hiding low-level programming details.
Middleware – software layer
Components of Middleware
Applications
CORBA, RMI, RPC and events…
Request reply protocol
External data representation
Operating Systems
Software Layers
language and run-time
support for program
Interactions
conventional
and
distributed
applications
applications
extended services
available to those of
the distributed system
Open (distributed) services
Middleware( CORBA, Java RMI, Web service, DCOM, RD-ODP)
responsible for basic local
Operating system
resource management
(memory allocation/protection,
process creation and
scheduling, local inter-process
communication and peripheral
devices handling)
Computer and network (TCP.UDP/IP). hardware
Platform(green part)
30
– Definition
Socket
• allows communications between
hosts or between processes on
one computer, using the concept
of an Internet socket. It can work
with many different I/O devices
and drivers, although support for
these depends on the operatingsystem implementation.
– Characteristics
• Berkeley, California ,UNIX
• open/read/write/close Mechanisms
– Operation
• Making a pair and one process send
message to the other
• The message might be stay in Queue
and wait for the System call
사용자와 네트워크 사이의 인터페이스
Socktet - TCP
•
TCP server procedure
TCP Server
TCP Client
socket()
① socket() generates a socket.
② Bind() local IP and port
determined. Listen() Change TCP
state to LISTENING.
③ Accept() another socket generate
for the client (remote ip and port
determined)
④ Send(), recv() after sending &
receiving data, closesocket() Close
the socket.
⑤ repeat ④~⑤step.
bind()
listen()
accept()
recv()
send()
closesocket()
32
Socktet - UDP
•
UDP Client method procedure
① socket() generates a
socket..
② sendto(), recvfrom()
communicate with server,
data transfer methods
③ closesocket() Closes the
socket
UDP 서버
socket()
bind()
recvfrom()
sendto()
closesocket()
UDP 클라이언트
– Definition
JAVA RMI
allows a Java program to invoke a
method that is being executed on a remote machine
• RMI (Remote Method Invocation)
– Character
• Transparency Method call
• Support Callback from Server to Client
– Action
• Stub and Skeleton
– Class allow exchanging data between Client and Server
• Remote Reference layer
– Support various hosts in heterogeneous environment
Client
• Transport layer
– Path the marshaled stream
Stub
Server
Skeleton
Remote Reference Layer
Transport Layer
JAVA RMI
• RMI Tools
Tool
Description
rmic
Generate stubs and skeletons for remote objects
rmiregistry
Remote object registry service
rmid
RMI activation system daemon
serialver
Return class serialVersionUID
RMI Program Procedure
①
②
③
④
⑤
⑥
Set a remote interface
Remote interface class
Complete server program
Set a client program to use the remote object
Compile ②,③,④
Create stub and skeleton by rmic
% rmic Classname
⑦ Activate rmiregistry
⑧ Run the programs
36
RMI example
Interface for Server side
import java.rmi.*;
import java.util.Date;
public interface timeServer extends Remote {
public long getTime() throws RemoteException;
}
RMI example
import java.net.*; import java.rmi.*; import java.rmi.registry.*;
import java.rmi.server.UnicastRemoteObject;
public class timeServerImpl extends UnicastRemoteObject implements timeServer {
public timeServerImpl ( ) throws RemoteException {
super( );
}
public long getTime() throws RemoteException {
return System.currentTimeMillis(); //using java.util.Date class ok
}
//but need to convert it to long
public static void main(String[] args) {
try {
LocateRegistry.createRegistry(1099);
timeServerImpl f = new timeServerImpl( );
Naming.rebind("myTimeServer", f);
System.out.println("myTimeServer ready.");
} catch (RemoteException rex) {
System.out.println("Exception in timeServerImpl.main: " + rex);
} catch (MalformedURLException ex) {
System.out.println("MalformedURLException " + ex);
}
}
}
Role of Middleware in
Client/Server Architecture
Logical View
of Middleware
Object-Oriented
Mechanisms
• Clients and servers ship messages back
and forth between objects
• A client sends a request to an object
broker
• The broker calls the appropriate object
and passes along any relevant data
• Examples include Microsoft’s COM and
CORBA
Object Request Broker
Roadmap
•
•
•
•
Distributed Computing Introduction
Client/Server Computing
Distributed message passing
Remote Procedure Calls
• Clusters
Clusters
• Alternative to symmetric multiprocessing
(SMP)
• Group of interconnected, whole computers
working together as a unified computing
resource
– Illusion is one machine
– System can run on its own
Benefits of Clusters
• Absolute Scalability
– Larger than any single device is possible
• Incremental scalability
– System can grow by adding new nodes
• High availability
– Failure of one node is not critical to system
• Superior price/performance
– Using commodity equipment
Cluster Classification
• Numerous approaches to classification.
– Simplest is based on shared disk access
Clustering Methods:
Benefits and Limitations
Clustering Methods:
Benefits and Limitations
Operating System
Design Issues
• Clusters require some enhancements to a
single-system OS.
– Failure Management
– Load Balancing
– Parallelizing Computation
Failure Management
• Highly available cluster offers a high
probability that all resources will be in
service
– No guarantee about the state of partially
executed transactions if failure occurs
• Fault-tolerant cluster ensures that all
resources are always available
• Failover vs. FailBack
Load Balancing
• When new computer added to the cluster,
the load-balancing facility should
automatically include this computer in
scheduling applications
• Middleware must recognize that services
can appear on many different members of
the cluster
Parallelizing Computation
• Parallelizing compiler
– determines, at compile time, which parts of an
application can be executed in parallel.
• Parallelized application
– application written to run on a cluster and
uses message passing to move data,
• Parametric computing
– Algorithm must run many times with different
parameters
Cluster Computer
Architecture
Middleware Services
and Functions
• Single entry point
– User logs onto cluster, not individual server
•
•
•
•
Single file hierarchy
Single control point
Single virtual networking
Single memory space
– Distributed shared memory enables programs
to share variables.
Middleware Services
and Functions (cont.)
•
•
•
•
•
Single job-management system
Single user interface
Single I/O space
Single process space
Checkpointing
– Allowing rollback and recovery
• Process migration
– Enables load balancing
Clusters Compared
to SMP
• SMP is easier to manage and configure,
take up less space and draw less power
• SMP products are well established and
stable
• Clusters are better for incremental and
absolute scalability
• Clusters are superior in terms of
availability