Like reference symbols in the various drawings indicate like elements.
The servers 102 communicate with the clients 112 via the network connections 110. The network 110 may be a local area network (LAN), wireless LAN, or a wide area network (WAN), such as the Internet. Each client 112 may be associated with one or more users, and may comprise a device capable of communicating over the network 110, such as a computer, a mobile communication device, other communication device or other device. The servers 102 are connected to a file system 114 using for example a high speed network 116. The file system 114 can be a storage area network, such as Xsan available from Apple Computer, Inc., and the high speed network can be a Fibre Channel network. Though a client-server configuration is shown, other system configurations are possible including those for provisioning various electronic devices including mobile telephones, personal digital assistants, mobile electronic devices, game consoles, set top boxes, etc.
In
In one implementation, each server 102 executes a process 118 (e.g., a Mail Cluster Manager (MCM)) to handle the event of a Master server crashing. Alternatively, one ore more of the servers 102 (but not all), can execute process 118. The process 118 enables mail services and selects master and slave servers. The process 118 detects the master server going offline and reconfigures one of the existing slave servers to become the new master, as well as reconfiguring the remaining slave servers with the new master's configuration information without requiring user intervention, as described below.
Referring now to
If at step 206 a lock is not achieved, the process continues to step 214, where slaves in the cluster are designated. In the example above, IMAP 1 is designated the master. Because the process 118 running on IMAP 1 will hold the lock, the processes 118 running on the other servers 102 (e.g., IMAP 2 and IMAP 3) will fail to lock on the master lock file in the file system 114. The process 118 running on the servers IMAP 2 and IMAP 3 will block and the severs IMAP 2 and IMAP 3 will be configured as slaves by the process 118.
AT step 210, a crash of the master occurs or the master is otherwise unable to process service requests (e.g., IMAP 1 goes offline or a processing error arises). If the crash/processing error occurs, the lock is released at step 212 and the process 200 returns to step 204 where a file lock is attempted to designate a new master. In one implementation, the processes 118 on the slave servers IMAP 2 and IMAP 3 will awake when the lock from IMAP 1 is released as the processes 118 are no longer blocked. In one implementation, each of processes 118 running on the slaves will attempt to gain an exclusive lock on the “masters” lock file in the file system 114. Alternatively, a designated one of the slaves will attempt to gain the exclusive lock. At a predetermined time later, one or more additional slaves can attempt to gain the exclusive lock. At step 206, it is determined which process 118 gained a lock, and at step 208, a new master is designated. As noted above, the server having a process 118 that first gains the exclusive lock will become the new master (e.g., IMAP 2). Steps 204-212 may be repeated as necessary to maintain the existence of a master.
At step 216, a crash/processing error of a salve occurs. Here, no action is necessary by the processes 118 running on the master server of any other slave server.
In one implementation, the processes 118 are responsible for managing mail data queues for SMTP servers. In one implementation, each server 102 within a mail cluster will have at least one primary SMTP Spool to handle mail transfer for that server. The mail spools can be stored in the file system 114. The servers can also have secondary SMTP spools which will be responsible for mail delivery only. The failure of an SMTP server can result in an orphaned mail spool. There can be undelivered mail contained within the orphaned spool and it is generally not acceptable to leave mail undelivered. In the event of a server crash or other processing error, any other SMTP server within the cluster can gain ownership of the crashed-server's mail spool to complete the delivery of any mail within the spool. In one implementation, Postfix is used as the Mail Transfer Agent to communicate email messages to and from SMTP servers. In another implementation, local mail delivery is handled via the Local Mail Transfer Protocol (LMTP).
Referring now to
At step 308, a check is performed of the spool lock files for exclusive locks. For example, the process 118 running one or more (or in one implementation each) server 102 can periodically check each spool lock file within the file system 114 for exclusive locks. If an exclusive lock is found on the spool lock files, then the process loops. If a process 118 finds a spool lock file without an exclusive lock, that will indicate that the previous SMTP owner-server is no longer online or otherwise not capable of delivering mail for that spool.
If a spool lock file lacks an exclusive lock, then at step 310, a mail directory is disabled (e.g., the maildrop directory within the mail spool associated with the spool lock file found to lack an exclusive lock will be disabled to prevent any new mail from being posted to the spool). At step 312, the mail spool discovered at step 308 is designated a secondary mail spool (e.g., by the discovering process 118). At step 314, undelivered mail within the secondary mail spool is delivered. At step 316, the secondary mail spool can optionally be deleted after all mail has been delivered and the associated spool lock file can be removed.
In another implementation, the process 118 detects mail services which may have been launched manually or outside administrative control, terminates these services and restarts them, if necessary. For example, mail services can launched manually using the command line, and because of this they may not have been started with the correct configuration options. Referring to
Through the use of the shared file system 114, processes 118 and exclusive file locks, the servers 102 within a cluster can be automatically monitored and reconfigured without manual intervention. The processes 118 perform periodic tasks to monitor the health of the enabled services and check for failed services. Actions may be tailored based upon which mail services are enabled for a specific server.
The memory 520 stores information within the system 500. In one embodiment, the memory 520 is a computer-readable medium. In one embodiment, the memory 520 is a volatile memory unit. In another embodiment, the memory 520 is a non-volatile memory unit.
The storage device 530 is capable of providing mass storage for the system 500. In one embodiment, the storage device 530 is a computer-readable medium. In various different embodiments, the storage device 530 may be a floppy disk device, a hard disk device, an optical disk device, or a tape device.
The input/output device 540 provides input/output operations for the system 500. In one embodiment, the input/output device 540 includes a keyboard and/or pointing device. In one embodiment, the input/output device 540 includes a display unit for displaying graphical user interfaces.
The invention can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. Apparatus of the invention can be implemented in a computer program product tangibly embodied in an information carrier, e.g., in a machine-readable storage device or in a propagated signal, for execution by a programmable processor; and method steps of the invention can be performed by a programmable processor executing a program of instructions to perform functions of the invention by operating on input data and generating output. The invention can be implemented advantageously in one or more computer programs that are executable on a programmable system including at least one programmable processor coupled to receive data and instructions from, and to transmit data and instructions to, a data storage system, at least one input device, and at least one output device. A computer program is a set of instructions that can be used, directly or indirectly, in a computer to perform a certain activity or bring about a certain result. A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
Suitable processors for the execution of a program of instructions include, by way of example, both general and special purpose microprocessors, and the sole processor or one of multiple processors of any kind of computer. Generally, a processor will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a processor for executing instructions and one or more memories for storing instructions and data. Generally, a computer will also include, or be operatively coupled to communicate with, one or more mass storage devices for storing data files; such devices include magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and optical disks. Storage devices suitable for tangibly embodying computer program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, such as EPROM, EEPROM, and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, ASICs (application-specific integrated circuits).
To provide for interaction with a user, the invention can be implemented on a computer having a display device such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor for displaying information to the user and a keyboard and a pointing device such as a mouse or a trackball by which the user can provide input to the computer.
The invention can be implemented in a computer system that includes a back-end component, such as a data server, or that includes a middleware component, such as an application server or an Internet server, or that includes a front-end component, such as a client computer having a graphical user interface or an Internet browser, or any combination of them. The components of the system can be connected by any form or medium of digital data communication such as a communication network. Examples of communication networks include, e.g., a LAN, a WAN, and the computers and networks forming the Internet.
The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a network, such as the described one. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. Other computer or device system configuration are possible.
A number of embodiments of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. For example, Post Office Protocol (POP) servers can be monitored similarly as IMAP servers. Accordingly, other embodiments are within the scope of the following claims.