JP4627789B2 - Information processing apparatus, information processing method, and program - Google Patents
Information processing apparatus, information processing method, and program Download PDFInfo
- Publication number
- JP4627789B2 JP4627789B2 JP2008168553A JP2008168553A JP4627789B2 JP 4627789 B2 JP4627789 B2 JP 4627789B2 JP 2008168553 A JP2008168553 A JP 2008168553A JP 2008168553 A JP2008168553 A JP 2008168553A JP 4627789 B2 JP4627789 B2 JP 4627789B2
- Authority
- JP
- Japan
- Prior art keywords
- virtual machine
- request
- worker
- application
- master
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
Description
本発明は、複数の仮想マシンが動作する環境において、単一の仮想マシンが動作する環境と同様にしてアプリケーション開発を行うことができる情報処理装置、情報処理方法およびそれを実現するための装置可読なプログラムに関する。 The present invention relates to an information processing apparatus, an information processing method, and an apparatus readable for realizing the same, capable of developing an application in an environment where a plurality of virtual machines operate in the same manner as an environment where a single virtual machine operates. Related to various programs.
顧客ごとに最適なオフィス環境を提供するために、アプリケーションの追加により顧客ごとにカスタマイズ可能なシステムが検討されている。追加されるアプリケーションには、第3ベンダが開発するものも含まれるが、この追加により、システムの基本機能が損なわれるものであってはならない。ここで、第3ベンダとは、ハードウェアやOS等、既存の環境に組み込むことで、新しい機能を提供するハードウェアまたはソフトウェア等を提供するベンダをいう。 In order to provide an optimal office environment for each customer, a system that can be customized for each customer by adding an application is being studied. The added applications include those developed by third vendors, but the addition should not impair the basic functions of the system. Here, the third vendor refers to a vendor that provides hardware or software that provides a new function by being incorporated into an existing environment, such as hardware or an OS.
アプリケーションを開発し、追加するにあたって、そのアプリケーションに対するリクエストを受けた場合、そのアプリケーションを実行するリソースへ適切にそのリクエストを振り分けなければならない。 When developing and adding an application, if a request for the application is received, the request must be appropriately distributed to the resource that executes the application.
アクセス状況や処理負荷に応じて、サーバに組み込まれたCPUやメモリを制御して最適な処理性能を提供するキャパシティオンデマンドという技術がある。このキャパシティオンデマンドを容易にするために、Webサーバを遠隔かつ動的に構成する方法およびシステムが提案されている(例えば、特許文献1参照)。 There is a technology called capacity on demand that provides optimum processing performance by controlling the CPU and memory incorporated in the server according to the access status and processing load. In order to facilitate this capacity on demand, a method and a system for remotely and dynamically configuring a Web server have been proposed (see, for example, Patent Document 1).
この方法およびシステムでは、クライアントからのリクエストを処理するサーバ群1と、リソースを提供するサーバ群3と、サーバ群1のパフォーマンスとサーバ群3のパフォーマンスとが閾値に達しているかどうかを判定するサーバ2とからなり、サーバ群1またはサーバ群3のパフォーマンス状況に応じてサーバ群に対してサーバを追加または削除する。これにより、頑強かつ柔軟なWebサーバを実現している。この方法およびシステムでは、1つのサーバが他のサーバへ処理を適切に振り分けており、リソースの動的追加が可能である。 In this method and system, a server group 1 that processes requests from clients, a server group 3 that provides resources, and a server that determines whether the performance of the server group 1 and the performance of the server group 3 have reached a threshold. The server is added to or deleted from the server group according to the performance status of the server group 1 or the server group 3. Thereby, a robust and flexible Web server is realized. In this method and system, one server appropriately distributes processing to other servers, and dynamic addition of resources is possible.
また、パーソナルコンピュータ(PC)にドライバを必要とすることなく、PCの機種やOSに依存することなく、Webサービスを提供することが可能な画像形成装置が提案されている(例えば、特許文献2参照)。この画像形成装置は、複数のハードウェア資源ごとにWebサービスを提供するための手段を備え、リクエスト内のメッセージ交換プロトコルに従って記述されたメッセージに含まれるWebサービスを特定する情報に対応するWebサービス関数をコールすることにより、Webサービスを特定し、Webサービスに分配してレスポンスを提供している。この装置では、リクエストを解析し、適切な処理部へリクエストを振り分けている。 In addition, an image forming apparatus that can provide a Web service without requiring a driver for a personal computer (PC) and without depending on the model or OS of the PC has been proposed (for example, Patent Document 2). reference). This image forming apparatus includes means for providing a Web service for each of a plurality of hardware resources, and a Web service function corresponding to information for specifying a Web service included in a message described according to a message exchange protocol in a request To identify the Web service, distribute it to the Web service, and provide a response. This apparatus analyzes the request and distributes the request to an appropriate processing unit.
UNIX(登録商標)等のプロセスベースのオペレーティングシステム(OS)で、上記のアプリケーションの追加により顧客ごとにカスタマイズ可能なシステムを構築する場合、システムの堅牢性を向上させるために、適度な粒度でプロセスを分割するのが一般的である。ここで、堅牢性とは、プログラムにおいて、エラーや例外等に強く、簡単には暴走しないことをいう。 In a process-based operating system (OS) such as UNIX (registered trademark), when building a system that can be customized for each customer by adding the above-mentioned application, in order to improve the robustness of the system, the process is performed with an appropriate granularity. Is generally divided. Here, robustness means that the program is resistant to errors and exceptions and does not easily run away.
アプリケーションの開発言語としてJava(登録商標)言語を用いる場合、単一のプロセス、すなわち単一の仮想マシン上で複数のアプリケーションを動作させることになる。この場合、細かい粒度でプロセスを分割するのは現実的ではない。しかしながら、仮想マシンを2つにし、少なくとも基本機能を実現するアプリケーションを一方の仮想マシン上で動作させ、第3ベンダが開発したアプリケーションをもう一方の仮想マシン上で動作させるように構成することで、システムの堅牢性を向上させることが可能となる。 When the Java (registered trademark) language is used as an application development language, a plurality of applications are operated on a single process, that is, a single virtual machine. In this case, dividing the process with fine granularity is not practical. However, by configuring two virtual machines to run at least one application that realizes basic functions on one virtual machine and run an application developed by a third vendor on the other virtual machine, The robustness of the system can be improved.
上記特許文献1の技術は、サーバ資源の最適化であり、各サーバがハードウェア的に独立していることを前提とし、複数の仮想マシンが動作する装置に適用することはできない。 The technique of the above-mentioned patent document 1 is server resource optimization and cannot be applied to an apparatus in which a plurality of virtual machines operate on the premise that each server is hardware independent.
上記特許文献2の技術は、利用者の環境に依存することなく、Webサービスを提供するものであり、複数の仮想マシンが動作する環境において、各仮想マシン上で動作するアプリケーションにリクエストを適切に振り分けるものではない。 The technique of the above-mentioned patent document 2 provides a Web service without depending on the user's environment, and appropriately requests requests to applications operating on each virtual machine in an environment where a plurality of virtual machines operate. It is not something to distribute.
複数の仮想マシンが動作する環境でアプリケーション開発を行う場合に、1つのHTTPサーバですべての仮想マシンのWebアプリケーションを管理しようとすると、HTTPサーバとWebアプリケーションとの間にプロセス間通信が必要となる。各Webアプリケーションにプロセス間通信の処理を加えることは、アプリケーション開発に大きな負担がかかり、その開発が困難なものとなる。これに対し、単一の仮想マシンが動作する環境では、単一のプロセス上で1つのHTTPサーバおよび複数のアプリケーションが動作するため、プロセス間通信は不要であり、このような問題は生じない。 When application development is performed in an environment in which a plurality of virtual machines operate, if one HTTP server attempts to manage all virtual machine Web applications, inter-process communication is required between the HTTP server and the Web application. . Adding inter-process communication processing to each Web application places a heavy burden on application development and makes the development difficult. On the other hand, in an environment where a single virtual machine operates, since one HTTP server and a plurality of applications operate on a single process, inter-process communication is unnecessary, and such a problem does not occur.
そこで、Webアプリケーションにプロセス間通信の処理を加えることなく簡単にアプリケーション開発を行うことができ、複数の仮想マシンが動作する環境にその開発したアプリケーションを追加しても、クライアントから受信したリクエストを適切に各仮想マシン上で動作するアプリケーションに振り分けることができる装置の提供が望まれている。 Therefore, application development can be easily performed without adding inter-process communication processing to the Web application. Even if the developed application is added to an environment in which multiple virtual machines operate, the request received from the client is appropriately handled. In addition, it is desired to provide an apparatus that can be distributed to applications running on each virtual machine.
本発明は、上記課題に鑑み、3つ以上の仮想マシンが動作する情報処理装置であって、各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、この第1管理情報に基づいて、クライアントから受信したリクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションを、前記リクエストを処理するアプリケーションとして判別するアプリケーション管理部を含み、前記複数の仮想マシンのうち、前記クライアントからリクエストを受信する一のマスター仮想マシンは、当該マスター仮想マシン以外の各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、前記第2管理情報に基づいて、前記リクエストに含まれたファイル拡張子に対応する識別情報のワーカー仮想マシン宛に前記リクエストを転送するリクエスト転送部を更に備え、前記マスター仮想マシンのリクエスト転送部は、前記リクエストに含まれたファイル識別子に対応する識別情報が前記第2管理情報に複数登録されている場合に、これら複数の識別情報のなかから所定の優先順位に基づいて選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、前記ワーカー仮想マシンの前記アプリケーション管理部は、前記第1管理情報に基づいて、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定し、存在していると判定した場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、存在しないと判定した場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンへ送信し、前記マスター仮想マシンのリクエスト転送部は、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信することを特徴とする。 In view of the above problems, the present invention is an information processing apparatus in which three or more virtual machines operate, and each of the virtual machines performs processing in the application for each of the applications operating on its own virtual machine. The first management information in which the target file name and file extension are registered is retained, and an application corresponding to the file name and file extension included in the request received from the client is stored on the basis of the first management information. An application management unit that determines an application that processes a request, and one master virtual machine that receives a request from the client among the plurality of virtual machines identifies each worker virtual machine other than the master virtual machine Identification information on the worker virtual machine A request in which each of the operating applications holds the second management information associated with at least the file extension to be processed, and the application operating on the worker virtual machine includes the file extension to be processed A request transfer unit that transfers the request to a worker virtual machine having identification information corresponding to the file extension included in the request, based on the second management information, When a plurality of pieces of identification information corresponding to file identifiers included in the request are registered in the second management information, the request transfer unit of the master virtual machine has a predetermined priority order from the plurality of pieces of identification information. The request addressed to the worker virtual machine of one identification information selected based on The application management unit of the worker virtual machine transfers the application corresponding to the file name and file extension included in the request transferred from the master virtual machine based on the first management information. If it is determined whether or not it exists in the virtual machine, and if it is determined to exist, the result of processing the request using this application is sent to the client via the master virtual machine, If it is determined that the application does not exist, the application checks whether there is a corresponding application in another worker virtual machine other than its own worker virtual machine, and sends the result of the investigation to the master virtual machine. The request transfer unit of the virtual machine transfers the request that has transferred the request. Identification of the next priority selected from the plurality of identification information when the investigation result indicating that an application corresponding to another worker virtual machine other than the worker virtual machine exists is received from the car virtual machine When the request is forwarded to the information worker virtual machine and the investigation result indicating that there is no application corresponding to any worker virtual machine is received, the request is sent to the worker virtual machine of the next priority. A response indicating that there is no corresponding application is not transmitted to the client .
また、本発明は、3つ以上の仮想マシンが動作する情報処理装置で実行される情報処理方法であって、各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、前記複数の仮想マシンの一つであるマスター仮想マシンは、さらに、他の仮想マシンである各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、前記マスター仮想マシンにおいて、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、このリクエストに含まれたファイル拡張子に対応する識別情報が前記第2管理情報に複数登録されているか否かを判定する第1判定ステップと、前記第1判定ステップにおいて、一の識別情報のみ登録されていると判定された場合に、この識別情報のワーカー仮想マシン宛に前記リクエストを転送し、複数の識別情報が登録されていると判定された場合に、所定の優先順位に基づいてこれら複数の識別情報のなかから選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送する転送ステップと、前記ワーカー仮想マシンにおいて、前記第1管理情報に基づき、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定する第2判定ステップと、前記第2判定ステップにおいて、対応するアプリケーションが存在していると判定された場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、対応するアプリケーションが存在しないと判定された場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンに送信する第1送信ステップと、前記マスター仮想マシンにおいて、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信する第2送信ステップと、を含む。 The present invention is also an information processing method executed by an information processing apparatus on which three or more virtual machines operate, wherein each of the virtual machines has an application for each of the applications operating on its own virtual machine. The first management information in which the file name and the file extension to be processed in is registered, and the master virtual machine that is one of the plurality of virtual machines is further connected to each worker virtual machine that is another virtual machine. Holding second management information in which at least the identification information for identifying the machine and the file extension to be processed by each of the applications running on the worker virtual machine are associated, A request including a file extension to be processed by an application running on the worker virtual machine. A first determination step for determining whether or not a plurality of identification information corresponding to the file extension included in the request is registered in the second management information when the client receives a request from the client; When it is determined in the determination step that only one piece of identification information is registered, the request is transferred to the worker virtual machine of this identification information, and when it is determined that a plurality of pieces of identification information are registered. A transfer step of forwarding the request to the worker virtual machine of one identification information selected from among the plurality of identification information based on a predetermined priority, and in the worker virtual machine, based on the first management information , An application corresponding to the file name and file extension included in the request transferred from the master virtual machine. In the second determination step for determining whether or not the application exists in its own worker virtual machine, and in the second determination step, this application is used when it is determined that the corresponding application exists. The result of processing the request is sent to the client via the master virtual machine, and if it is determined that the corresponding application does not exist, it is handled in another worker virtual machine other than its own worker virtual machine. A first transmission step of transmitting whether or not there is an application to be transmitted, and transmitting the result of the investigation to the master virtual machine; and in the master virtual machine, from the worker virtual machine that has transferred the request, App for other worker virtual machines other than machines The request is forwarded to the worker virtual machine of the next priority identification information selected from the plurality of identification information, and to any worker virtual machine When the investigation result indicating that there is no corresponding application is received, the request is not transferred to the worker virtual machine having the next priority, and a response indicating that the corresponding application does not exist is transmitted to the client. A second transmission step.
また、本発明は、3つ以上の仮想マシンが動作する情報処理装置により読み取り可能な、クライアントからのリクエストを処理するためのプログラムであって、各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、前記複数の仮想マシンの一つであるマスター仮想マシンは、さらに、他の仮想マシンである各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、前記マスター仮想マシンにおいて、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、このリクエストに含まれたファイル拡張子に対応する識別情報が前記第2管理情報に複数登録されているか否かを判定する第1判定ステップと、前記第1判定ステップにおいて、一の識別情報のみ登録されていると判定された場合に、この識別情報のワーカー仮想マシン宛に前記リクエストを転送し、複数の識別情報が登録されていると判定された場合に、所定の優先順位に基づいてこれら複数の識別情報のなかから選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送する転送ステップと、前記ワーカー仮想マシンにおいて、前記第1管理情報に基づき、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定する第2判定ステップと、前記第2判定ステップにおいて、対応するアプリケーションが存在していると判定された場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、対応するアプリケーションが存在しないと判定された場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンに送信する第1送信ステップと、前記マスター仮想マシンにおいて、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信する第2送信ステップと、を前記情報処理装置に実行させる。 Further, the present invention is a program for processing a request from a client that can be read by an information processing apparatus in which three or more virtual machines operate, and each of the virtual machines operates on its own virtual machine For each of the applications, the first management information in which the file name and the file extension to be processed by the application are registered, and the master virtual machine that is one of the plurality of virtual machines further includes other Second management information in which identification information for identifying each worker virtual machine that is a virtual machine of the virtual machine is associated with at least a file extension to be processed by each of the applications running on the worker virtual machine In the master virtual machine, an application running on the worker virtual machine Whether a plurality of identification information corresponding to the file extension included in the request is registered in the second management information when a request including a file extension to be processed is received from the client. When it is determined in the first determination step that determines whether or not only one piece of identification information is registered in the first determination step, the request is forwarded to the worker virtual machine of this identification information, A transfer step of transferring the request to the worker virtual machine of one identification information selected from among the plurality of identification information based on a predetermined priority when it is determined that the identification information is registered. The worker virtual machine is included in the request transferred from the master virtual machine based on the first management information. In the second determination step for determining whether or not an application corresponding to the file name and the file extension exists in the worker virtual machine, and in the second determination step, it is determined that the corresponding application exists. If the result of processing the request using this application is sent to the client via the master virtual machine and it is determined that the corresponding application does not exist, A first transmission step of investigating whether or not a corresponding application exists in another worker virtual machine and transmitting the investigation result to the master virtual machine, and forwarding the request in the master virtual machine From the worker virtual machine, the worker temporary When the investigation result indicating that an application corresponding to another worker virtual machine other than the machine exists is received, the worker information of the next priority identification information selected from the plurality of identification information is addressed to the worker virtual machine. When the request is transferred and the investigation result indicating that there is no application corresponding to any worker virtual machine is received, the request is not transferred to the worker virtual machine of the next priority, and the corresponding application is Causing the information processing apparatus to execute a second transmission step of transmitting a response to the effect that it does not exist to the client.
本発明によれば、クライアントから受信したリクエストに含まれるアドレス情報と、管理情報および識別情報とから、このリクエストを処理すべき仮想マシンを判別し、当該仮想マシンへ前記リクエストを転送する。これにより、複数の仮想マシンが動作する環境にその開発したアプリケーションを追加しても、クライアントから受信したリクエストを適切に各仮想マシン上で動作するアプリケーションに振り分けることができる。 According to the present invention, a virtual machine that should process this request is determined from address information, management information, and identification information included in the request received from the client, and the request is transferred to the virtual machine. As a result, even if the developed application is added to an environment where a plurality of virtual machines operate, a request received from a client can be appropriately distributed to applications operating on each virtual machine.
図1は、本発明の情報処理装置の一つの実施形態であるサーバ装置を含むネットワーク機器構成を例示した図である。図1では、サーバ装置10と、クライアント装置11とがネットワーク12に接続され、互いに通信可能とされている。
FIG. 1 is a diagram exemplifying a network device configuration including a server device which is an embodiment of an information processing apparatus of the present invention. In FIG. 1, a
クライアント装置11は、ソフトウェアとしてWebブラウザを実装し、サーバ装置10は、ソフトウェアとしてWebサーバを実装している。Webサーバは、Webブラウザから出されるリクエストを、インターネット等のネットワーク12を介して受信し、Webアプリケーションにより処理し、その処理結果をWebブラウザへ送信する。
The
Webブラウザが、ユーザにより指定されたURLに対応する情報を取り寄せる場合、Webブラウザは、Webサーバに対し、リクエストとしてそのURLを送る。Webサーバは、そのURLを受け取り、URLに含まれるパス名、すなわちファイル名あるいはディレクトリ名から、Webページを表示させるためのファイルを読み出し、そのファイルを処理結果として返す。 When the Web browser obtains information corresponding to the URL specified by the user, the Web browser sends the URL as a request to the Web server. The Web server receives the URL, reads a file for displaying the Web page from a path name included in the URL, that is, a file name or a directory name, and returns the file as a processing result.
WebブラウザとWebサーバとの間の通信は、HTTP等の通信プロトコルを使用して行われる。このHTTPを用いて通信を行うWebブラウザは、HTTPクライアントと呼ばれ、Webサーバは、HTTPサーバと呼ばれる。以下では、WebブラウザをHTTPクライアント、WebサーバをHTTPサーバと表記する。HTTPサーバは、HTTPクライアントからのリクエストを受信するために、互いを接続する接続口となる外部ポートを開く。この外部ポートは、一般にポート番号80で、1つのみである。このため、HTTPサーバとHTTPクライアントとの間の通信は、この1つの外部ポートのみを介して行われる。
Communication between the Web browser and the Web server is performed using a communication protocol such as HTTP. A web browser that performs communication using this HTTP is called an HTTP client, and a web server is called an HTTP server. Hereinafter, the Web browser is referred to as an HTTP client, and the Web server is referred to as an HTTP server. In order to receive a request from an HTTP client, the HTTP server opens an external port serving as a connection port for connecting each other. This external port is generally
このサーバ装置10およびクライアント装置11は、HTTPサーバおよびHTTPクライアントを動作させるためのCPU、CPUが実行するためのプログラムを格納するメモリ、通信を行うためのネットワークボードやネットワークカードといった通信インタフェースを備えるPCや複合機等とすることができる。なお、図1では、クライアント装置11として1つのPCのみが示されているが、2つ以上のクライアント装置11がネットワーク12に接続され、各クライアント装置11からリクエストを送信することもできる。
The
次に、図1に示すサーバ装置10に実装されるモジュールの構成を、図2を参照して詳細に説明する。このサーバ装置10は、複数の仮想マシンを備えることができるが、図2では、3つの仮想マシンのみが示されている。ここで、仮想マシンとは、コンピュータのCPUやメモリ等のリソースを、物理的構成によらず柔軟に分割したり統合して仮想化した上で、その仮想化したコンピュータを実行するソフトウェアである。また、仮想マシンは、Java(登録商標)をプログラミング言語とするJava(登録商標)仮想マシンとすることができる。なお、このJava(登録商標)仮想マシンは、各OSに実行ファイルとして存在し、実行後、クラスファイルを読み込み、クラス内のメソッドを呼び出し実行する。
Next, the configuration of modules mounted on the
サーバ装置10は、3つの仮想マシンを同時に起動させることができ、このため、同時に異なる3つのOSを実行し、それらOS上でそれぞれ、アプリケーションを動作させることができる。図2では、3つの仮想マシン20、30、40がそれぞれ1つのHTTPサーバ21、31、41を含み、仮想マシン20が3つのWebアプリケーション22a〜22c、仮想マシン30が2つのWebアプリケーション32a、32b、仮想マシン40が2つのWebアプリケーション42a、42bを備えている。各仮想マシン上では、各HTTPサーバおよび各Webアプリケーションを動作させることができる。なお、HTTPサーバ21、31、41は、同一のモジュールである。一方、Webアプリケーション22a〜22c、32a、32b、42a、42bは、互いに異なるモジュールである。
The
3つの仮想マシン20、30、40は、1つのマスター仮想マシン20と、それ以外のワーカー仮想マシン30、40とに分類される。マスター仮想マシン20は、サーバ装置10の外部から外部ポートを使用してリクエストを受信し、そのリクエストに含まれるURL等のアドレス情報がワーカー仮想マシン30のWebアプリケーションあるいはワーカー仮想マシン40のWebアプリケーションを指し示すものである場合、そのリクエストの処理をそれらの仮想マシンに振り分ける。ワーカー仮想マシン30、40は、マスター仮想マシン20から、サーバ装置10の内部でのみ用いられる内部ポートを使用してリクエストを受け取り、そのリクエストに含まれるURLで指し示されるWebアプリケーションにより処理を実行し、処理結果をマスター仮想マシン20へ返す。その後、マスター仮想マシン20は、リクエストの送信元であるクライアント装置11へ外部ポートを使用してその処理結果を送信する。
The three
Java(登録商標)では、サーブレットやJSP(登録商標)という形でWebアプリケーションを作り、このWebアプリケーションを、上記でいうHTTPサーバに対応するアプリケーションサーバを用いて実行する。ここで、サーブレットとは、サーバで実行するためのJava(登録商標)プログラムで、JSP(登録商標)とは、HTMLにJava(登録商標)プログラムを埋め込んだファイルである。アプリケーションサーバとしては、一例としてTomcat(登録商標)を用いることができ、さらに、Webアプリケーション用フレームワークとしてStruts(登録商標)を用いることができる。このフレームワークは、プログラムの枠組みを提供するライブラリであり、アプリケーションに必要なデータの入出力やエラー処理、画面遷移等の基本的なしくみを提供する。Java(登録商標)アプリケーションを開発する基本ツールとしてJ2SEを用い、Webアプリケーションを作ることができる。作られたWebアプリケーションは、データベースに格納される。 In Java (registered trademark), a Web application is created in the form of a servlet or JSP (registered trademark), and the Web application is executed using an application server corresponding to the HTTP server described above. Here, the servlet is a Java (registered trademark) program to be executed on the server, and the JSP (registered trademark) is a file in which the Java (registered trademark) program is embedded in HTML. As an application server, Tomcat (registered trademark) can be used as an example, and Struts (registered trademark) can be used as a web application framework. This framework is a library that provides a program framework and provides basic mechanisms such as data input / output, error handling, and screen transition required for applications. Web applications can be created using J2SE as a basic tool for developing Java (registered trademark) applications. The created web application is stored in a database.
作成されたWebアプリケーションを使用しての具体的な処理を説明すると、Java(登録商標)仮想マシンであるJ2SE上でアプリケーションサーバであるTomcat(登録商標)を稼動させ、Webアプリケーションを読み出し、そのWebアプリケーションを構成するサーブレットおよびJSP(登録商標)を実行してリクエストを処理し、処理結果をHTTPクライアントへ返すことができる。したがって、このJ2SEを仮想マシンとして、Tomcat(登録商標)をHTTPサーバとして利用することができる。 A specific process using the created Web application will be described. Tomcat (registered trademark), which is an application server, is run on J2SE, which is a Java (registered trademark) virtual machine, the Web application is read, and the Web It is possible to execute a servlet and JSP (registered trademark) constituting an application, process a request, and return a processing result to an HTTP client. Therefore, this J2SE can be used as a virtual machine, and Tomcat (registered trademark) can be used as an HTTP server.
このように、各仮想マシン上にHTTPサーバが存在するため、仮想マシンごとに独立して、Webアプリケーションの開発を行うことができる。また、複数の仮想マシンが動作する環境であっても、単一の仮想マシンが動作する環境と同様に、プロセス間通信の処理を加えることなく、簡単にWebアプリケーションの開発を行うことができ、これにより、Webアプリケーションの開発時の負荷が軽減し、Webアプリケーション開発効率を向上させることができる。 As described above, since an HTTP server exists on each virtual machine, it is possible to develop a Web application independently for each virtual machine. In addition, even in an environment where a plurality of virtual machines operate, similarly to an environment where a single virtual machine operates, a web application can be easily developed without adding inter-process communication processing. Thereby, the load at the time of development of a Web application can be reduced, and Web application development efficiency can be improved.
図3を参照して、マスター仮想マシン20上で動作するHTTPサーバの構成について詳細に説明する。HTTPサーバは、クライアント装置11のHTTPクライアント100から出されたリクエストを、ネットワーク12を介して受信し、そのリクエストを解釈するリクエスト受信部23と、Webアプリケーションによる処理結果をレスポンスとして組み立て、ネットワーク12を介してクライアント装置11のHTTPクライアントへ送信するレスポンス送信部24と、複数のWebアプリケーションをそれぞれURLと対応付けて保持するアプリケーション管理部25と、他のHTTPサーバに処理を振り分けるためにリクエストを転送するリクエスト転送部26とを備える。
With reference to FIG. 3, the configuration of an HTTP server operating on the master
さらに、図3では、リクエストを一時的にメモリに保存し、要求に応じて取り出すリクエスト保存部27と、複数のワーカーHTTPサーバへリクエストを転送する優先順位に関する優先度情報を保存する仮想マシン制御部28とを備えている。
Further, in FIG. 3, a
ここで、マスター仮想マシン20上で動作するHTTPサーバ21は、マスターHTTPサーバであり、ワーカー仮想マシン30、40上で動作するHTTPサーバ31、41は、ワーカーHTTPサーバである。これらのHTTPサーバ21、31、41は、同一のモジュールであるが、それら自身が存在する仮想マシンがマスターであるか、ワーカーであるかにより、マスターHTTPサーバあるいはワーカーHTTPサーバのいずれかとして振る舞う。例えば、マスター仮想マシン20は、基本機能を実現するためのWebアプリケーションを実装する仮想マシンとし、ワーカー仮想マシン30、40は、サーバ装置10の管理者が機能を追加するために作成したWebアプリケーションを実装する仮想マシンや、第3ベンダが作成したWebアプリケーションを実装する仮想マシンとすることができる。
Here, the
マスターHTTPサーバ21は、サーバ装置10外部の装置であるクライアント装置11とネットワーク12を介して通信を行うために外部ポートを開く。これにより、サーバ装置10の外部、例えばクライアント装置11から、この外部向けのポートに対してアクセスすることが可能となる。
The
一方、ワーカーHTTPサーバ31、41は、サーバ装置10の内部で通信を行うために内部ポートを開く。この内部ポートは、マスターHTTPサーバ21とワーカーHTTPサーバ31、41との間の通信を可能にするためのもので、内部送信・受信機能であるループバックを使用してアクセスすることができる。内部ポートは、サーバ装置10内部のHTTPサーバ間通信でのみ使用されるため、サーバ装置10外部からワーカーHTTPサーバ31、41へアクセスすることはできない。なお、ポート番号の重複は許されないので、外部ポートと内部ポートとは異なるポート番号が割り当てられる。外部ポートは、一般にポート番号80であるため、内部ポートは、それ以外の、例えばポート番号8080、8081を割り当てることができる。
On the other hand, the
マスターHTTPサーバ21およびワーカーHTTPサーバ31、41は、自身がマスターであるか、ワーカーであるかを知っている。しかしながら、マスター仮想マシン20およびワーカー仮想マシン30、40上で動作するWebアプリケーション22a〜22c、32a、32b、42a、42bはいずれも、自身がマスターであるか、ワーカーであるかを知らない。これらは、自身がマスターか、ワーカーかを知っているHTTPサーバ21、31、41により管理される。このため、Webアプリケーションをマスターであるか、ワーカーであるかを区別することなく開発することができる。
The
図4を参照して、マスター仮想マシン20上のWebアプリケーションを、マスターHTTPサーバ21に登録する場合の処理について説明する。Webアプリケーションを登録する場合、マスター仮想マシン20に存在するWebアプリケーションは、マスター仮想マシン20に存在するHTTPサーバ21に対してURLの登録を行う。具体的には、Webアプリケーション22aが、HTTPサーバ21に対して、「url1」のURL登録を要求すると(ステップS11)、HTTPサーバ21に含まれるアプリケーション管理部25が、このURLをWebアプリケーション22aと対応付けて記憶する(ステップS12)。すなわち、そのURLを、Webアプリケーション22aを識別するアプリケーション名等と対応付けて対応テーブル等に記憶する。また、アプリケーション管理部25は、URLの記憶後、記憶が完了したことのレスポンスをWebアプリケーション22aへ返す(ステップS13)。
With reference to FIG. 4, processing when a Web application on the master
一方、URLの登録後、クライアント装置11のHTTPクライアント100から、「GET /url1 HTTP/1.1」のリクエストが送信されると(ステップS14)、HTTPサーバ21のリクエスト受信部23がこれを受け取り、リクエストを解釈する(ステップS15)。ここでは、「url1にあるファイルを転送規格HTTP/1.1で取得する」と解釈する。そして、リクエスト受信部23は、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部25に引き渡す(ステップS16)。
On the other hand, after the URL is registered, when a “GET / url1 HTTP / 1.1” request is transmitted from the
アプリケーション管理部25は、対応テーブルを参照し、リクエスト受信部23から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS17)。ここで、対応するWebアプリケーションが見つかった場合、アプリケーション管理部25は、その対応するWebアプリケーション(Webアプリケーション22a)に処理を依頼する(ステップS18)。Webアプリケーション22aでは、依頼された処理を実行し(ステップS19)、この処理結果をレスポンスとしてアプリケーション管理部25へ送信する(ステップS20)。
The
次いで、アプリケーション管理部25が、Webアプリケーションから受け付けたレスポンスをレスポンス送信部24へ送信し(ステップS21)、レスポンス送信部24は、そのレスポンスをHTTPクライアント100へ送信する(ステップS22)。図4では、見つかったことを示す「HTTP/1.1 200 OK」というメッセージが送信されている。「HTTP/1.1」は転送規格で、「200」は成功を意味するステータスコードである。これらのメッセージとともに、そのアドレスにあるWebページを表示させるためのファイルがHTTPクライアント100へ送られ、クライアント装置11の画面上にWebページが表示される。なお、図4では、Webアプリケーション22aの登録について説明したが、Webアプリケーション22b、22cについても同様の処理が行われるものとする。
Next, the
ステップS17において、URLに対応するWebアプリケーションが見つからない場合には、リソースが見つからない旨のエラーメッセージをレスポンスとして送信するものとする。以下、図5を参照して、URLに対応するWebアプリケーションが見つからない場合の処理について説明する。なお、図5においてステップS31〜S36の処理については、上述したステップS11〜S16の処理と同様であるため、説明を省略する。 In step S17, when the Web application corresponding to the URL is not found, an error message indicating that the resource is not found is transmitted as a response. Hereinafter, with reference to FIG. 5, processing when a Web application corresponding to the URL is not found will be described. In addition, about the process of step S31-S36 in FIG. 5, since it is the same as that of the process of step S11-S16 mentioned above, description is abbreviate | omitted.
ステップS37において、アプリケーション管理部25は、対応テーブルを参照し、リクエスト受信部23から渡されたURL「foo」に対応するWebアプリケーションを探索する。ここで、対応するWebアプリケーションが見つからないと判定した場合、アプリケーション管理部25は、図5に示したように、リソースが見つからない旨のエラーメッセージ「404 Not Found」を作成し、そのエラーメッセージをレスポンスとしてレスポンス送信部24へ送信する(ステップS38)。レスポンス送信部24は、このエラーメッセージをHTTPクライアント100へ送信する(ステップS39)。HTTPプロトコルにおいて、「404」は見つからなかったことを示すステータスコードである。これにより、クライアント装置11を操作するユーザに、リソースが見つからないことを認識させることができる。
In step S <b> 37, the
次に、図6を参照して、ワーカー仮想マシン30上のWebアプリケーションをワーカーHTTPサーバ31に登録する場合について説明する。ワーカー仮想マシン30に存在するWebアプリケーション32aは、同じワーカー仮想マシン30に存在するHTTPサーバ31に対してURLの登録を行う。具体的には、Webアプリケーション32aが、HTTPサーバ31に対して「url2」のURL登録を行うと(ステップS41)、アプリケーション管理部35は、このURLをWebアプリケーション32aと対応付け、対応テーブル等に記憶する(ステップS42)。
Next, a case where a Web application on the worker
URLの登録後、HTTPサーバ31は、HTTPサーバ31自身が存在する仮想マシンの種別、すなわちマスターかワーカーかを判別する。この場合、ワーカーと判別し、マスターHTTPサーバ21へリクエストを転送してもらうための依頼を行う(ステップS43)。なお、ワーカーHTTPサーバ31からは、登録を行ったURLと、外部ポートのポート名あるいは番号と、内部ポートのポート名あるいはポート番号とを含む情報が、振り分け依頼登録としてマスターHTTPサーバ21に送信されるものとする。これは、異なるマシンで処理を実行する手続きを規定するリモートプロシージャコール(RPC)を使用することにより実現することができる。このように、RPCを使用することでマスターHTTPサーバ21へWebアプリケーションのURLを動的に登録することができるため、ワーカーHTTPサーバ31、41にWebアプリケーションを追加しても、マスターHTTPサーバ21へ修正を加える必要がなくなる。これにより、Webアプリケーション開発時の負荷が軽減し、Webアプリケーション開発効率を向上させることができる。
After registering the URL, the
マスターHTTPサーバ21が備えるリクエスト転送部26では、ワーカーHTTPサーバ31からURLと、外部ポートのポート名あるいは番号と、内部ポートのポート名あるいはポート番号とを受け取ると、これらの情報をアプリケーション管理部25に渡す(ステップS44)。アプリケーション管理部25は、リクエスト転送部26から受け取った各情報を対応付け、対応テーブル等に記憶すると(ステップS45)、リクエスト転送部26を介して記憶が完了したことを通知するレスポンスをワーカー仮想マシン30のアプリケーション管理部35に送信する(ステップS46、S47)。
When the
一方、アプリケーション管理部35では、リクエスト転送部26から記憶が完了したことを通知するレスポンスを受け付けると、このレスポンスをWebアプリケーション32aに返すことで(ステップS48)、登録処理が完了する。なお、図6では、Webアプリケーション32aの登録について説明したが、Webアプリケーション32bについても同様の処理が行われるものとする。また、図6では、ワーカー仮想マシン30について説明したが、ワーカー仮想マシン40の場合でも同様の処理が行われるものとする。
On the other hand, when receiving a response notifying that the storage has been completed from the
一方、URLの登録後に、クライアント装置11のHTTPクライアント100から、「GET /url2 HTTP/1.1」がリクエストとして送信されると(ステップS49)、HTTPサーバ21のリクエスト受信部23がこれを受け取り、そのリクエストを解釈する(ステップS50)。この場合、「url2にあるファイルを転送規格HTTP/1.1で取得する」と解釈する。リクエスト受信部23は、受け付けたリクエストをアプリケーション管理部25へ渡すと(ステップS51)、アプリケーション管理部25は、対応テーブルを参照し、このリクエストに含まれたURLに対応するWebアプリケーション32aを探索する(ステップS52)。
On the other hand, when “GET / url2 HTTP / 1.1” is transmitted as a request from the
ここで、リクエストに含まれたURL“url2”がWebアプリケーション32aに対応するものとすると、Webアプリケーション32aはワーカー仮想マシン30上で動作するアプリケーションであるため、マスター仮想マシン20上では見つからない。そのため、アプリケーション管理部25は、リクエスト転送部26に対し、ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31へ転送するように、リクエストの転送依頼をする(ステップS53)。リクエスト転送部26では、リクエストの転送依頼を受け付けると、転送先となるワーカー仮想マシン30の内部ポートのポート番号に対してリクエストを転送する(ステップS54)。
If the URL “url2” included in the request corresponds to the
このように、マスターHTTPサーバ21は、ワーカーHTTPサーバ31、41へHTTPを用いてリクエストを転送する。この場合、ワーカーHTTPサーバ31、41は、一般的なWebブラウザからのリクエストを受けた場合と同じとなるため、ワーカーHTTPサーバ31、41のリクエスト処理に手を加える必要はない。また、マスターHTTPサーバ21は、情報処理装置の外部と通信を行うために外部ポートを使用し、ワーカーHTTPサーバ31、41は、マスターHTTPサーバ21と通信を行うために内部ポートと自身を識別するループバックアドレスとを使用して、リクエストを受信し、リクエストに対する処理結果を送信する。これにより、サーバ装置10の外部からワーカーHTTPサーバ31、41への直接的なアクセスを防止することができるため、セキュリティ面を考慮しなければならないのはマスターHTTPサーバ21のみでよく、装置全体として保守・管理の負担を軽減させることができる。
As described above, the
リクエスト転送部26から送信されたリクエストは、ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31のリクエスト受信部33で解釈が行われた後(ステップS55)、アプリケーション管理部35へ渡される(ステップS56)。アプリケーション管理部35は、対応テーブルを参照し、リクエスト受信部33から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS57)。この場合、ワーカー仮想マシン30上で動作するWebアプリケーション32a、32bの中にそのURLに対応するWebアプリケーション32aが含まれているため、アプリケーション管理部35は、Webアプリケーション32aに処理を依頼する(ステップS58)。Webアプリケーション32aは依頼された処理を実行し(ステップS59)、この処理結果をレスポンスとしてアプリケーション管理部35へ送信する(ステップS60)。アプリケーション管理部35は、Webアプリケーション32aから受け付けたレスポンスをレスポンス送信部34へ送信すると(ステップS61)、レスポンス送信部34は、そのレスポンスをマスター仮想マシン20のリクエスト転送部26に送信する(ステップS62)。
The request transmitted from the
一方、リクエスト転送部26では、レスポンス送信部34からレスポンスを受け付けると、このレスポンスをアプリケーション管理部25に送信する(ステップS63)。続いて、アプリケーション管理部25は、リクエスト転送部26から受け付けたレスポンスをレスポンス送信部24に送信すると(ステップS64)、レスポンス送信部24は、そのレスポンスをHTTPクライアント100へ送信する(ステップS65)。
On the other hand, when receiving a response from the
このように、マスターHTTPサーバ21では、ワーカーHTTPサーバ各々が有するWebアプリケーションのURLと、当該ワーカーHTTPサーバの外部・内部ポートに関する情報とを対応付けた対応テーブルを用いて、HTTPクライアント100から受信したリクエストに含まれるURL(アドレス情報)に対応する仮想マシンを判別し、当該仮想マシンへ前記リクエストを転送する。
As described above, the
次に、各ワーカー仮想マシンのWebアプリケーションが、同一のURLに対応付けられた場合の動作について説明する。まず、各ワーカー仮想マシンのWebアプリケーションに、同一のURLが設定されることになる背景について説明する。 Next, an operation when the Web application of each worker virtual machine is associated with the same URL will be described. First, the background that the same URL is set in the Web application of each worker virtual machine will be described.
Java(登録商標)を用いてWebアプリケーションを作成する場合、上述したようにStruts(登録商標)等のフレームワークを利用することが一般的に行われている。フレームワークには商用又はオープンソースのものなど多種存在するが、その仕様によっては、URLに含まれたディレクトリ指定部分に関わらず、当該URLで指定されるファイルの拡張子部分に基づいて、Webアプリケーションが処理を行うものがある。このような仕様のフレームワークを用いた場合、Webアプリケーションの夫々が同一の拡張子について処理を行うよう規定されていると、各Webアプリケーションは実質同一のURL、即ちファイル拡張子に対応付けられることになる。以下では、複数のWebアプリケーションが同一のURLに対応付けられた場合の処理について説明する。 When creating a Web application using Java (registered trademark), a framework such as Struts (registered trademark) is generally used as described above. There are various types of frameworks such as commercial or open source, but depending on the specifications, the web application is based on the extension part of the file specified by the URL regardless of the directory specifying part included in the URL. There is something that does the processing. When a framework with such a specification is used, if each Web application is specified to perform processing for the same extension, each Web application is associated with the same URL, that is, a file extension. become. Hereinafter, processing when a plurality of Web applications are associated with the same URL will be described.
図7を参照して、Webアプリケーション32a、42aをワーカーHTTPサーバ31、41に登録する場合の処理について説明する。なお、図7では、Webアプリケーション32a、42aについて説明するが、Webアプリケーション32b、42bについても同様の処理が行われるものとする。また、図7において、ワーカー仮想マシン30及びワーカー仮想マシン40が有するWebアプリケーションの夫々は、同一のURL、つまり同一のファイル拡張子に対応付けられているものとする。
With reference to FIG. 7, the process in the case of registering the
まず、Webアプリケーション32aがHTTPサーバ31に対し、URLの登録を行うと(ステップS71)、上述したように、アプリケーション管理部35が、このURLとアプリケーション32aを対応付け、対応テーブル等に記憶する(ステップS72)。なお、図7では、登録を行うURLを「/*.cgi」(アスタリスクは、任意の文字列)とした例を示しているが、これに限定されないものとする。
First, when the
URLの登録後、HTTPサーバ31は、HTTPサーバ31自身が存在する仮想マシンの種別、すなわちマスターかワーカーかを判別する。この場合、ワーカーと判別し、マスターHTTPサーバ21へリクエストを転送してもらうための依頼を行う(ステップS73)。
After registering the URL, the
また、Webアプリケーション42aがHTTPサーバ41に対し、Webアプリケーション32aと同じURL(/*.cgi)の登録を行うと(ステップS74)、アプリケーション管理部45は、Webアプリケーション32aと同様に、このURLとWebアプリケーション42aとを対応付け、対応テーブル等に記憶する(ステップS75)。URLの登録後、HTTPサーバ41は、HTTPサーバ41自身が存在する仮想マシンの種別、すなわちマスターかワーカーかを判別する。この場合、ワーカーと判別し、マスターHTTPサーバ21へリクエストを転送してもらうための依頼を行う(ステップS76)。
When the
一方、マスターHTTPサーバ21が備えるリクエスト転送部26では、ワーカーHTTPサーバ31、41からURLと、外部ポートのポート名あるいは番号と、内部ポートのポート名あるいはポート番号とを受け取ると、これらの情報をアプリケーション管理部25に渡す(ステップS77、S78)。アプリケーション管理部25は、リクエスト転送部26から受け取ったワーカーHTTPサーバ31、41についての各情報を夫々対応付け、対応テーブル等に記憶すると(ステップS79、S80)、記憶が完了したことを通知するレスポンスをリクエスト転送部26に送信する(ステップS81、S82)。リクエスト転送部26は、アプリケーション管理部25からレスポンスを受け付けると、ワーカー仮想マシン30、40のアプリケーション管理部35、45の夫々に対し、当該レスポンスを夫々送信する(ステップS83、S84)。一方、アプリケーション管理部35、45の夫々では、リクエスト転送部26から記憶が完了したことを通知するレスポンスを受け付けると、このレスポンスをWebアプリケーション32a、42aに夫々返すことで(ステップS85、S86)、登録処理が完了する。
On the other hand, when the
なお、マスターHTTPサーバ21では、リクエストを振り分けるために、ワーカーHTTPサーバ31、41からURLを受け取り、記憶するが、この場合、同じURLである。しかしながら、ワーカーHTTPサーバ31が開いた内部ポートのポート番号は8080で、ワーカーHTTPサーバ41が開いた内部ポートのポート番号は8081と異なり、この内部ポートのポート番号により判別することができるため、複数のアプリケーションについて同一のURLを登録することができる。これにより、各ワーカーHTTPサーバ31、41のWebアプリケーション開発者は、アプリケーション開発の際、他のワーカーHTTPサーバを有するWebアプリケーションとURLが重複しているかを意識する必要がなくなる。したがって、ワーカーHTTPサーバ間でWebアプリケーションのURLを調整する必要がないため、アプリケーション開発時の負荷を軽減し、アプリケーション開発効率を向上させることができる。
Note that the
一方、URL登録後に、クライアント装置11のHTTPクライアント100から、「GET /url/app2.cgi HTTP/1.1」のリクエストが送信されると(ステップS87)、HTTPサーバ21のリクエスト受信部23がこれを受け取り、このリクエストを解釈する(ステップS88)。この場合、「ディレクトリ名urlのディレクトリにあるファイル名app2.cgiというファイルを転送規格HTTP/1.1で取得する」と解釈する。
On the other hand, when a request “GET /url/app2.cgi HTTP / 1.1” is transmitted from the
リクエスト受信部23は、HTTPクライアント100から受け付けたリクエストをアプリケーション管理部25へ渡す(ステップS89)。アプリケーション管理部25は、リクエスト受信部23からリクエストを受け取ると、対応テーブルを参照し、このリクエストに含まれたURLに対応するWebアプリケーションを探索する(ステップS90)。この場合、URLに対応するWebアプリケーションはワーカー仮想マシン30またはワーカー仮想マシン40上で動作するアプリケーションであるため、マスター仮想マシン20上では見つからない。そのため、アプリケーション管理部25は、リクエスト転送部26に対し、ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31またはワーカーHTTPサーバ41へリクエストを転送するよう依頼する(ステップS91)。
The
ここで、2つのWebアプリケーション32a、42aが登録したURLが同じであることから、リクエスト転送部26は、2つのワーカー仮想マシン30、40のどちらかへリクエストを転送する(ステップS92)。この場合、後に残りの仮想マシンへリクエストを再送する可能性があるため、リクエスト転送部26は、受け付けたリクエストをリクエスト保存部27に送信することで(ステップS93)、当該リクエスト保存部27にリクエストを一時的に保存する。
Here, since the URL registered by the two
ステップS92において、リクエスト転送部26は、例えば、Webアプリケーションがアプリケーション管理部25に予め登録しておいた各ワーカー仮想マシン(Webアプリケーション)への転送順序や、予め登録しておいた各ワーカー仮想マシン(Webアプリケーション)の優先順位を示す優先度情報等に従ってリクエストを転送する。ワーカー仮想マシン30上で動作するWebアプリケーション32aが先に登録あるいは優先順位が高い場合、リクエスト転送部26は、ワーカー仮想マシン30が開いた内部ポートのポート番号に対してリクエストを転送する。
In step S92, the
ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31のリクエスト受信部33では、マスター仮想マシン20から転送されたリクエストを受信すると、このリクエストをリクエスト受信部23と同様に解釈する(ステップS94)。そして、リクエスト受信部33は、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部35に引き渡す(ステップS95)。
When receiving a request transferred from the master
アプリケーション管理部35は、対応テーブルを参照し、リクエスト受信部33から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS96)。ここで、リクエストされたファイル“app2.cgi”が、Webアプリケーション32aに対応するものとすると、アプリケーション管理部35は、ワーカー仮想マシン30上で動作するWebアプリケーション32a、32bの中に、そのURLに対応するWebアプリケーション32aが含まれていると判定し、Webアプリケーション32aに処理を依頼する(ステップS97)。Webアプリケーション32aでは、依頼された処理を実行し(ステップS98)、この処理結果をレスポンスとして、成功を示すステータスコード「200」とともにアプリケーション管理部35へ送信する(ステップS99)。アプリケーション管理部35では、Webアプリケーション32aからレスポンスを受け付けると、レスポンス送信部34へ送信し(ステップS100)、レスポンス送信部34では、アプリケーション管理部35から送信されたレスポンスを、マスター仮想マシン20のリクエスト転送部26へ送信する(ステップS101)。
The
一方、リクエスト転送部26では、ステップS92で転送したリクエストに対するレスポンスを受け付けると、このレスポンスに含まれるステータスコードが予め設定された特別な値、例えば「900」であるか否かを判定する(ステップS102)。ステータスコードが特別な値でない場合、リクエスト転送部26は、アプリケーション管理部25を介してレスポンスをレスポンス送信部24に送信する(ステップS103、S104)。次いで、レスポンス送信部24は、アプリケーション管理部25から受け付けたレスポンスを、HTTPクライアント100へ送信する(ステップS105)。
On the other hand, when receiving a response to the request transferred in step S92, the
上記の特別な値は、HTTPプロトコルでのステータスコードとして設定されていない値であればいかなる値であってもよく、例えば、上記のように「900」とすることができる。なお、この「900」というステータスコードは、リクエストが転送されたワーカー仮想マシンにおいて、対応するWebアプリケーションが見つからない場合に送信されるよう予め設定されているものとする。 The special value may be any value as long as it is not set as a status code in the HTTP protocol. For example, it may be “900” as described above. It is assumed that the status code “900” is set in advance to be transmitted when a corresponding Web application is not found in the worker virtual machine to which the request has been transferred.
上記の優先順位は、優先度情報としてユーザにより予め設定され、マスター仮想マシン20上で動作するマスターHTTPサーバ21に含まれる仮想マシン制御部28が保持する。例えば、ワーカー仮想マシン30に対し、優先度1、ワーカー仮想マシン40に対し、優先度2として設定することができる。この優先度情報は、サーバ装置10の起動時に設定され、また、実行時に動的に変更することができる。
The above priority is preset by the user as priority information, and is held by the virtual
この優先度情報を使用した処理について説明すると、マスターHTTPサーバ21のリクエスト転送部26は、仮想マシン制御部28からマスター仮想マシン20の優先度情報を取得し、リクエストを転送していない仮想マシンの中で最も優先度が高いものを選択してリクエストを転送する。その後、予め設定された特別な値のステータスコード、上記でいう「900」を受け取った場合、次の優先度の仮想マシンを選択し、リクエストを転送する。特別な値のステータスコードを受け取らなかった場合は、次の優先度の仮想マシンは選択されず、最も高い優先度の仮想マシン上で動作する、URLに対応したWebアプリケーションにより処理を実行し、処理結果がリクエスト転送部26へ送信される。
The processing using this priority information will be described. The
上記においてリクエストを再送する可能性がありうることを説明した。しかしながら、サーバ装置10内で利用可能な高速メモリ(RAM)には上限があり、リクエストをすべてこのRAMに保持することができない場合がある。そこで、RAMに保持するサイズの上限を設け、リクエストのサイズが上限を超える場合には、リクエスト保存部27は、その他のHDD等の記憶媒体に一時的に保存することができる。これにより、RAMのメモリサイズに制約がある場合でも、代わりとなる代替記憶媒体を利用することで、リクエストを再送することができる。
In the above, it has been explained that there is a possibility of resending a request. However, there is an upper limit to the high-speed memory (RAM) that can be used in the
アプリケーション管理部25に登録されたURLが同一で、リクエストを先に振り分けたワーカー仮想マシン30上に対応するWebアプリケーションが存在する場合、図7に示した処理となる。しかしながら、先に振り分けたワーカー仮想マシン30上に対応するWebアプリケーションが存在しない場合、図7と同様の処理にはならない。そこで、この場合の処理の流れを、図8を参照して説明する。
When the URL registered in the
まず、クライアント装置11のHTTPクライアント100から、「GET /url/app3.cgi HTTP/1.1」のリクエストが送信されると(ステップS111)、HTTPサーバ21のリクエスト受信部23がこれを受け取り、そのリクエストを解釈する(ステップS112)。この場合、「ディレクトリ名urlのディレクトリにあるファイル名app3.cgiというファイルを転送規格HTTP/1.1で取得する」と解釈する。なお、リクエストされたファイル“app3.cgi”は、Webアプリケーション42aを指定するものとする。
First, when a request “GET /url/app3.cgi HTTP / 1.1” is transmitted from the
リクエスト受信部23は、リクエストを解釈した後、受け取ったリクエストをアプリケーション管理部25へ渡す(ステップS113)。アプリケーション管理部25は、リクエスト受信部23からリクエストを受け取ると、対応テーブルを参照し、このリクエストに含まれたURLに対応するWebアプリケーションを探索する(ステップS114)。この場合、URLに対応するWebアプリケーションはワーカー仮想マシン30またはワーカー仮想マシン40上で動作するアプリケーションであるため、マスター仮想マシン20上では見つからない。そのため、アプリケーション管理部25は、リクエスト転送部26に対し、ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31またはワーカーHTTPサーバ41へリクエストを転送するよう依頼する(ステップS115)。
The
リクエスト転送部26は、アプリケーション管理部25から転送の依頼を受け付けると、ワーカー仮想マシン30又は40が開いた内部ポートのポート番号に対してリクエストを転送する(ステップS116)。この場合もアプリケーション管理部25に登録されたURLが同じであることから、リクエスト転送部26は、予め設定された優先順位等に基づいて2つのワーカー仮想マシン30、40のどちらかへリクエストを転送する。また、後に残りの仮想マシンへリクエストを再送する可能性があるため、リクエスト転送部26は、受け付けたリクエストをリクエスト保存部27に送信することで(ステップS117)、このリクエストをリクエスト保存部27に一時的に保存する。
When receiving the transfer request from the
ステップS116において、ワーカー仮想マシン30の優先順位がワーカー仮想マシン40よりも上位であった場合、リクエスト転送部26は、まず、ワーカー仮想マシン30の内部ポートのポート番号に対してリクエストを転送する。ワーカー仮想マシン30では、ワーカーHTTPサーバ31のリクエスト受信部33がリクエストを受け付けると、リクエスト受信部23と同様に解釈した後(ステップS118)、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部35に引き渡す(ステップS119)。
In step S <b> 116, when the priority order of the worker
アプリケーション管理部35は、対応テーブルを参照し、リクエスト受信部33から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS120)。しかしながら、ワーカー仮想マシン30上で動作するWebアプリケーション32a、32bの中には、リクエストされたURLに対応するWebアプリケーションは含まれていない。そこで、アプリケーション管理部35は、Webアプリケーション32aを介し、他のワーカー仮想マシン40にリクエストされたURLに対応するWebアプリケーションが存在するか否かを、RPC(VM間通信)を使用して問い合わせる(ステップS121、S122)。なお、ここではWebアプリケーション32aを介して問い合わせを行う態様としたが、これに限らず、ワーカー仮想マシン30上で動作する他のWebアプリケーション(32b)を介して問い合わせを行う態様としてもよい。
The
一方、問い合わせを受け付けたワーカー仮想マシン40のWebアプリケーション42a(42b)では、リクエストされたURLに対応するWebアプリケーションが自身に該当するか否かを判定する(ステップS123)。ここで、自己のWebアプリケーションがリクエストされたURLに該当すると判定した場合、該当するWebアプリケーション42aは、当該URLに該当することを指示したレスポンス(TRUE)を、問い合わせを行ったWebアプリケーション32aに通知する(ステップS124)。なお、図8の場合、Webアプリケーション42bはリクエストされたURLに対応しないが、この場合、Webアプリケーション42bからはURLに該当しないことを指示するレスポンス(FALSE)が通知されるものとする。このように、リクエストが転送されたワーカーHTTPサーバのアプリケーション管理部は、他のワーカーHTTPサーバが対応するアプリケーションを有するか否かを調査するアプリケーション調査部として機能する。
On the other hand, the
Webアプリケーション32aでは、他のワーカー仮想マシン40(Webアプリケーション42a)から、レスポンス(TRUE)を受け取ると(ステップS123)、リクエストされたURLに該当するWebアプリケーションが他のワーカー仮想マシンに存在すること示したレスポンスをアプリケーション管理部35に返す(ステップS125)。アプリケーション管理部35では、Webアプリケーション32aからレスポンスを受け付けると、このレスポンスをレスポンス送信部34に送信する(ステップS126)。レスポンス送信部34は、アプリケーション管理部35から受け付けたレスポンス(TRUE)に応じて、予め設定された特別な値のステータスコード(900 Forward Other)を、マスター仮想マシン20のリクエスト転送部26に送信する(ステップS127)。
When the
リクエスト転送部26は、ワーカー仮想マシン30からステータスコードを受け付けると、このステータスコードが他のワーカー仮想マシンに存在することを示す特別な値、即ち、「900」であるか否かを判定する(ステップS128)。ここで、リクエスト転送部26は、ステータスコードが他のワーカー仮想マシンに存在することを示す特別な値であると判定すると、リクエスト保存部27に保持されたリクエストを読み込み(ステップS129)、次の優先順位のワーカー仮想マシン(ワーカー仮想マシン40)に対し、読み込んだリクエストを転送する(ステップS130)。このように、マスターHTTPサーバ21のリクエスト転送部26は、リクエストを転送したワーカーHTTPサーバから、他のワーカーHTTPサーバが対応するアプリケーションを有しているとのレスポンスを受信した場合にのみ、次の優先順位のワーカーHTTPサーバへリクエストを転送する。
Upon receiving the status code from the worker
一方、ワーカー仮想マシン40では、リクエスト受信部43がリクエストを受信すると、リクエスト受信部23と同様に当該リクエストを解釈する(ステップS131)。次いで、リクエスト受信部43は、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部45に引き渡す(ステップS132)。アプリケーション管理部45は、対応テーブルを参照し、リクエスト受信部43から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS133)。ここで、Webアプリケーション42aは、リクエストされた“app3.cgi”に対応するため、アプリケーション管理部45は、対応するWebアプリケーションがあると判断し、Webアプリケーション42aへ処理を依頼する(ステップS134)。
On the other hand, in the worker
Webアプリケーション42aでは、依頼された処理を実行すると(ステップS135)、この処理結果とともに、リクエストに対する処理が成功した旨のステータスコード「200」をレスポンスとしてアプリケーション管理部45へ返す(ステップS136)。アプリケーション管理部45では、Webアプリケーション42aからレスポンスを受け付けると、このレスポンスをレスポンス送信部44へ送信する(ステップS137)。また、レスポンス送信部44は、アプリケーション管理部45からレスポンスを受け付けると、このレスポンスをマスター仮想マシン20のリクエスト転送部26へ送信する(ステップS138)。
When the requested processing is executed (step S135), the
一方、マスター仮想マシン20のリクエスト転送部26では、ステップS129で転送したリクエストに対するレスポンスを受け付けると、このレスポンスに含まれるステータスコードが他のワーカー仮想マシンに存在することを示す特別な値、即ち「900」であるか否かを判定する(ステップS139)。ステータスコードが特別な値でない場合(本処理では「200」)、リクエスト転送部26は、受け付けたレスポンスを、アプリケーション管理部25を介してレスポンス送信部24に送信する(ステップS140、S141)。次いで、レスポンス送信部24は、アプリケーション管理部25から受け付けたレスポンスをHTTPクライアント100に送信する(ステップS142)。
On the other hand, when the
なお、リクエストされたWebアプリケーションがいずれの仮想マシンにも存在しないような場合も想定される。そこで、図9を参照して、クライアント装置11のHTTPクライアント100から送信されたリクエスト(GET /url/app4.cgi HTTP/1.1)が、各仮想マシンのいずれのWebアプリケーションにも対応しない場合の処理の流れについて説明する。なお、リクエストで指定される“app4.cgi”は、Webアプリケーション22a〜22c、32a、32b、42a、42bの何れにも対応しないものとする。
A case where the requested Web application does not exist in any virtual machine is also assumed. Therefore, referring to FIG. 9, processing when the request (GET /url/app4.cgi HTTP / 1.1) transmitted from the
クライアント装置11のHTTPクライアント100から、「GET /url/app4.cgi HTTP/1.1」を含んだリクエストが送信されると(ステップS151)、上記と同様に、マスター仮想マシン20のリクエスト受信部23は、そのリクエストを受信し、その内容を解釈する(ステップS152)。そして、リクエスト受信部23は、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部25に引き渡す(ステップS153)。
When a request including “GET / url / app4.cgi HTTP / 1.1” is transmitted from the
アプリケーション管理部25は、対応テーブルを参照し、リクエスト受信部23から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS154)。この場合、URLに対応するWebアプリケーションはマスター仮想マシン20上では見つからない。そのため、アプリケーション管理部25は、リクエスト転送部26に対し、ワーカー仮想マシン30上で動作するワーカーHTTPサーバ31またはワーカーHTTPサーバ41へリクエストを転送するよう依頼する(ステップS155)。
The
リクエスト転送部26は、アプリケーション管理部25から転送の依頼を受け付けると、ワーカー仮想マシン30又は40が開いた内部ポートのポート番号に対してリクエストを転送する(ステップS156)。この場合もアプリケーション管理部25に登録されたURLが同じであることから、リクエスト転送部26は、予め設定された優先順位等に基づいて2つのワーカー仮想マシン30、40のどちらかへリクエストを転送する。また、後に残りの仮想マシンへリクエストを再送する可能性があるため、リクエスト転送部26は、受け付けたリクエストをリクエスト保存部27に送信することで(ステップS157)、このリクエストをリクエスト保存部27に一時的に保存する。
When receiving the transfer request from the
ステップS156において、ワーカー仮想マシン30の優先順位がワーカー仮想マシン40よりも上位であった場合、リクエスト転送部26は、まず、ワーカー仮想マシン30の内部ポートのポート番号に対してリクエストを転送する。ワーカー仮想マシン30では、ワーカーHTTPサーバ31のリクエスト受信部33がリクエストを受け付けると、リクエスト受信部23と同様に解釈した後(ステップS158)、このリクエストをどのWebアプリケーションに振り分けるかを決定するため、アプリケーション管理部35に引き渡す(ステップS159)。
If the priority of the worker
アプリケーション管理部35は、対応テーブルを参照し、リクエスト受信部33から受け付けたリクエストに含まれるURLに対応するWebアプリケーションを探索する(ステップS160)。しかしながら、ワーカー仮想マシン30上で動作するWebアプリケーション32a、32bの中には、リクエストされたURLに対応するWebアプリケーションは含まれていない。そこで、アプリケーション管理部35は、Webアプリケーション32aを介し、他のワーカー仮想マシン40にリクエストされたURLに対応するWebアプリケーションが存在するか否かを、RPC(VM間通信)を使用して問い合わせる(ステップS161、S162)。なお、ここではWebアプリケーション32aを介して問い合わせを行う態様としたが、これに限らず、ワーカー仮想マシン30上で動作する他のWebアプリケーション(32b)を介して問い合わせを行う態様としてもよい。
The
一方、問い合わせを受け付けたワーカー仮想マシン40のWebアプリケーション42a(42b)では、リクエストされたURLに対応するWebアプリケーションが自身に該当するか否かを判定する(ステップS163)。なお、本処理の場合、リクエストされたURLに該当するWebアプリケーションは存在しないため、Webアプリケーション42a(42b)は、リクエストされたURLに該当しないことを指示するレスポンス(FALSE)を、問い合わせを行ったWebアプリケーション32aに通知する(ステップS164)。
On the other hand, the
Webアプリケーション32aでは、問い合わせを行ったワーカー仮想マシン40の全てのWebアプリケーション(42a、42b)からレスポンス(FALSE)の通知を受けると、リクエストされたURLに対応するWebアプリケーションが存在しないことを示したレスポンスをアプリケーション管理部35に返す(ステップS165)。アプリケーション管理部35では、Webアプリケーション32aからレスポンスを受け付けると、このレスポンスをレスポンス送信部34に送信する(ステップS166)。レスポンス送信部34は、アプリケーション管理部35から受け付けたレスポンス(FALSE)に応じて、HTTPプロトコルにて存在不明を表すステータスコード「404」を、マスター仮想マシン20のリクエスト転送部26にリクエスト転送部26に送信する(ステップS167)。
When the
リクエスト転送部26は、ワーカー仮想マシン30からステータスコードを受け付けると、このステータスコードが他のワーカー仮想マシンに存在することを示す特別な値、即ち、「900」であるか否かを判定する(ステップS168)。ステータスコードが特別な値でない場合(本処理では「404」)、リクエスト転送部26は、受け付けたレスポンスを、アプリケーション管理部25を介してレスポンス送信部24に送信する(ステップS169、S170)。次いで、レスポンス送信部24は、受け付けたレスポンスをHTTPクライアント100に送信する(ステップS171)。
Upon receiving the status code from the worker
このように、マスターHTTPサーバ21のリクエスト転送部26は、リクエストを転送したワーカーHTTPサーバから、当該リクエストに対応するアプリケーションを有していないとのレスポンスを受信した場合、次の優先順位のワーカーHTTPサーバへリクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスをクライアントへ送信する。これにより、他の仮想マシンへ無駄にリクエストを転送することを防止することができ、Webブラウザへの応答を速くすることができる。
Thus, when the
以上のように、本実施形態によれば、マスターHTTPサーバ21では、対応テーブルと、HTTPクライアント100から受信したリクエストに含まれるURL(アドレス情報)とに基づいて、このリクエストを処理すべき仮想マシンを判別し、当該仮想マシンへ前記リクエストを転送する。これにより、複数の仮想マシンが動作する環境にその開発したWebアプリケーションを追加しても、HTTPクライアント100から受信したリクエストを適切に各仮想マシン上で動作するアプリケーションに振り分けることができる。
As described above, according to the present embodiment, the
また、クライアント側では、HTTPサーバにアクセスするのみで、複数のワーカーHTTPサーバが提供するWebアプリケーションによるサービスを利用することができる。したがって、クライアントは、複数のHTTPサーバが動作していることを意識することなくサービスを利用することができる。 On the client side, a service by a Web application provided by a plurality of worker HTTP servers can be used only by accessing the HTTP server. Therefore, the client can use the service without being aware that a plurality of HTTP servers are operating.
これまで本発明を上述した実施の形態をもって説明してきたが、本発明は上述した実施の形態に限定されるものではなく、他の実施の形態、追加、変更、削除など、当業者が想到することができる範囲内で変更することができ、いずれの態様においても本発明の作用・効果を奏する限り、本発明の範囲に含まれるものである。 The present invention has been described with the above-described embodiments, but the present invention is not limited to the above-described embodiments, and those skilled in the art will conceive other embodiments, additions, changes, deletions, and the like. It can be changed within the range that can be performed, and any embodiment is included in the scope of the present invention as long as the operation and effect of the present invention are exhibited.
したがって、上記の処理をプログラムとして構成し、サーバ装置にそのプログラムを実行させることにより実現することもできる。これは、コンピュータ可読なプログラムとして、そのプログラムを格納したCD−ROMやメモリカード等の記録媒体として提供することもできる。 Therefore, the above processing can be implemented as a program and executed by causing the server device to execute the program. This can also be provided as a computer-readable program as a recording medium such as a CD-ROM or memory card storing the program.
10 サーバ装置
11 クライアント装置
12 ネットワーク
20、30、40 仮想マシン
21、31、41 HTTPサーバ
22a、22b、22c、32a、32b、42a、42b Webアプリケーション
23、33、43 リクエスト受信部
24、34、44 レスポンス送信部
25、35、45 アプリケーション管理部
26 リクエスト転送部
27 リクエスト保存部
28 仮想マシン制御部
DESCRIPTION OF
25, 35, 45
Claims (13)
各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、この第1管理情報に基づいて、クライアントから受信したリクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションを、前記リクエストを処理するアプリケーションとして判別するアプリケーション管理部を含み、
前記複数の仮想マシンのうち、前記クライアントからリクエストを受信する一のマスター仮想マシンは、当該マスター仮想マシン以外の各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、前記第2管理情報に基づいて、前記リクエストに含まれたファイル拡張子に対応する識別情報のワーカー仮想マシン宛に前記リクエストを転送するリクエスト転送部を更に備え、
前記マスター仮想マシンのリクエスト転送部は、前記リクエストに含まれたファイル識別子に対応する識別情報が前記第2管理情報に複数登録されている場合に、これら複数の識別情報のなかから所定の優先順位に基づいて選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、
前記ワーカー仮想マシンの前記アプリケーション管理部は、前記第1管理情報に基づいて、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定し、存在していると判定した場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、存在しないと判定した場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンへ送信し、
前記マスター仮想マシンのリクエスト転送部は、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信することを特徴とする情報処理装置。 An information processing apparatus in which three or more virtual machines operate,
Each of the virtual machines holds, for each application running on its own virtual machine, first management information in which a file name and a file extension to be processed by the application are registered. An application management unit for determining an application corresponding to the file name and file extension included in the request received from the client as an application for processing the request ,
Among the plurality of virtual machines, one master virtual machine that receives a request from the client includes identification information for identifying each worker virtual machine other than the master virtual machine, and an application that operates on the worker virtual machine. Each of which holds second management information associated with at least a file extension to be processed, and an application operating on the worker virtual machine sends a request including the file extension to be processed to the client A request transfer unit that forwards the request to the worker virtual machine of the identification information corresponding to the file extension included in the request based on the second management information,
When a plurality of pieces of identification information corresponding to file identifiers included in the request are registered in the second management information, the request transfer unit of the master virtual machine has a predetermined priority order from the plurality of pieces of identification information. Forwards the request to the worker virtual machine of one identity selected based on
The application management unit of the worker virtual machine has an application corresponding to the file name and file extension included in the request transferred from the master virtual machine based on the first management information. If it is determined that the request exists, the result of processing the request using this application is transmitted to the client via the master virtual machine. If determined, investigate whether there is a corresponding application in another worker virtual machine other than its own worker virtual machine, and send this investigation result to the master virtual machine,
When the request transfer unit of the master virtual machine receives the investigation result indicating that there is an application corresponding to a worker virtual machine other than the worker virtual machine from the worker virtual machine that transferred the request, The request is forwarded to the worker virtual machine of the next priority identification information selected from the plurality of identification information, and the investigation result indicating that there is no application corresponding to any worker virtual machine is accepted. In this case, the information processing apparatus is characterized in that the request is not transferred to the worker virtual machine having the next priority order, and a response indicating that there is no corresponding application is transmitted to the client .
前記HTTPサーバが、前記アプリケーション管理部と、前記リクエストを受信し当該リクエストに含まれた前記アドレス情報を抽出するリクエスト受信部と、前記アプリケーションによる処理結果をレスポンスとして送信するリクエスト送信部とを含み、The HTTP server includes the application management unit, a request reception unit that receives the request and extracts the address information included in the request, and a request transmission unit that transmits a processing result by the application as a response,
前記マスター仮想マシンに含まれるHTTPサーバが、前記リクエストを転送する前記リクエスト転送部を備えるマスターHTTPサーバとされ、前記ワーカー仮想マシンに含まれるHTTPサーバが、転送された前記リクエストを処理し、処理結果を送信するワーカーHTTPサーバとされる請求項1に記載の情報処理装置。The HTTP server included in the master virtual machine is a master HTTP server including the request transfer unit that transfers the request, and the HTTP server included in the worker virtual machine processes the transferred request, and the processing result The information processing apparatus according to claim 1, wherein the information processing apparatus is a worker HTTP server that transmits.
前記ワーカーHTTPサーバは、前記情報処理装置の内部で前記マスターHTTPサーバと通信を行うために内部ポートと、前記情報処理装置自身を識別するループバックアドレスとを使用して、前記リクエストを受信し、前記リクエストに対する処理結果を送信する請求項3に記載の情報処理装置。The worker HTTP server receives the request using an internal port and a loopback address for identifying the information processing device itself to communicate with the master HTTP server inside the information processing device, The information processing apparatus according to claim 3, wherein a processing result for the request is transmitted.
前記リクエストが転送された前記ワーカーHTTPサーバの前記アプリケーション管理部は、前記他のワーカーHTTPサーバが前記対応するアプリケーションを有するか否かを調査するアプリケーション調査部として機能し、前記アプリケーション調査部が、前記他のワーカーHTTPサーバが前記対応するアプリケーションを有することを検出した場合には、前記対応するアプリケーションが存在する旨のレスポンスを送信し、検出しない場合には、前記対応するアプリケーションが存在しない旨のレスポンスを送信する請求項6に記載の情報処理装置。The application management unit of the worker HTTP server to which the request has been transferred functions as an application survey unit that investigates whether the other worker HTTP server has the corresponding application, When it is detected that another worker HTTP server has the corresponding application, a response indicating that the corresponding application exists is transmitted, and when not detected, a response indicating that the corresponding application does not exist The information processing apparatus according to claim 6, which transmits
各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、前記複数の仮想マシンの一つであるマスター仮想マシンは、さらに、他の仮想マシンである各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、Each of the virtual machines holds, for each of the applications running on its own virtual machine, first management information in which file names and file extensions to be processed by the application are registered, and the plurality of virtual machines The master virtual machine, which is one of the above, further includes identification information for identifying each worker virtual machine that is another virtual machine, and file extension that each of the applications running on the worker virtual machine processes. Holding the second management information associated with at least the child,
前記マスター仮想マシンにおいて、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、このリクエストに含まれたファイル拡張子に対応する識別情報が前記第2管理情報に複数登録されているか否かを判定する第1判定ステップと、In the master virtual machine, when a request including a file extension to be processed by an application running on the worker virtual machine is received from the client, an identification corresponding to the file extension included in the request is received. A first determination step of determining whether a plurality of pieces of information are registered in the second management information;
前記第1判定ステップにおいて、一の識別情報のみ登録されていると判定された場合に、この識別情報のワーカー仮想マシン宛に前記リクエストを転送し、複数の識別情報が登録されていると判定された場合に、所定の優先順位に基づいてこれら複数の識別情報のなかから選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送する転送ステップと、In the first determination step, when it is determined that only one piece of identification information is registered, the request is transferred to the worker virtual machine of this identification information, and it is determined that a plurality of pieces of identification information are registered. A transfer step of transferring the request to the worker virtual machine of one identification information selected from among the plurality of identification information based on a predetermined priority,
前記ワーカー仮想マシンにおいて、前記第1管理情報に基づき、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定する第2判定ステップと、In the worker virtual machine, whether or not an application corresponding to the file name and the file extension included in the request transferred from the master virtual machine exists in the worker virtual machine based on the first management information A second determination step for determining
前記第2判定ステップにおいて、対応するアプリケーションが存在していると判定された場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、対応するアプリケーションが存在しないと判定された場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンに送信する第1送信ステップと、In the second determination step, when it is determined that the corresponding application exists, the result of processing the request using the application is transmitted to the client via the master virtual machine, and the response When it is determined that there is no application to be checked, it is investigated whether there is a corresponding application in another worker virtual machine other than its own worker virtual machine, and the result is sent to the master virtual machine. A first transmitting step,
前記マスター仮想マシンにおいて、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信する第2送信ステップと、In the master virtual machine, when the investigation result indicating that there is an application corresponding to another worker virtual machine other than the worker virtual machine is received from the worker virtual machine that transferred the request, the plurality of identifications When the request is forwarded to the worker virtual machine of the next priority identification information selected from the information, and when the investigation result indicating that there is no application corresponding to any worker virtual machine is received, A second transmission step of not transmitting the request to a worker virtual machine of the next priority and transmitting a response to the effect that there is no corresponding application to the client;
を含む情報処理方法。An information processing method including:
前記マスター仮想マシンにおいて、前記取得ステップで取得された前記URLを、当該URLを取得した前記マスター仮想マシンの識別情報と対応付けて前記第2管理情報に登録する登録ステップを更に含む請求項9又は10に記載の情報処理方法。 The registration method further includes a registration step of registering the URL acquired in the acquisition step in the second management information in the master virtual machine in association with identification information of the master virtual machine that acquired the URL. 10. The information processing method according to 10.
各前記仮想マシンは、自己の仮想マシン上で動作するアプリケーションの各々について、当該アプリケーションでの処理の対象となるファイル名及びファイル拡張子を登録した第1管理情報を保持し、前記複数の仮想マシンの一つであるマスター仮想マシンは、さらに、他の仮想マシンである各ワーカー仮想マシンを識別するための識別情報と、当該ワーカー仮想マシン上で動作するアプリケーションの各々が処理の対象とするファイル拡張子とを少なくとも対応付けた第2管理情報を保持し、Each of the virtual machines holds, for each of the applications running on its own virtual machine, first management information in which file names and file extensions to be processed by the application are registered, and the plurality of virtual machines The master virtual machine, which is one of the above, further includes identification information for identifying each worker virtual machine that is another virtual machine, and file extension that each of the applications running on the worker virtual machine processes. Holding the second management information associated with at least the child,
前記マスター仮想マシンにおいて、前記ワーカー仮想マシン上で動作するアプリケーションが処理の対象とするファイル拡張子を含んだリクエストを前記クライアントから受信した場合に、このリクエストに含まれたファイル拡張子に対応する識別情報が前記第2管理情報に複数登録されているか否かを判定する第1判定ステップと、In the master virtual machine, when a request including a file extension to be processed by an application running on the worker virtual machine is received from the client, an identification corresponding to the file extension included in the request is received. A first determination step of determining whether a plurality of pieces of information are registered in the second management information;
前記第1判定ステップにおいて、一の識別情報のみ登録されていると判定された場合に、この識別情報のワーカー仮想マシン宛に前記リクエストを転送し、複数の識別情報が登録されていると判定された場合に、所定の優先順位に基づいてこれら複数の識別情報のなかから選択した一の識別情報のワーカー仮想マシン宛に前記リクエストを転送する転送ステップと、In the first determination step, when it is determined that only one piece of identification information is registered, the request is transferred to the worker virtual machine of this identification information, and it is determined that a plurality of pieces of identification information are registered. A transfer step of transferring the request to the worker virtual machine of one identification information selected from among the plurality of identification information based on a predetermined priority,
前記ワーカー仮想マシンにおいて、前記第1管理情報に基づき、前記マスター仮想マシンから転送された前記リクエストに含まれるファイル名及びファイル拡張子に対応するアプリケーションが自己のワーカー仮想マシン内に存在するか否かを判定する第2判定ステップと、In the worker virtual machine, whether or not an application corresponding to the file name and the file extension included in the request transferred from the master virtual machine exists in the worker virtual machine based on the first management information A second determination step for determining
前記第2判定ステップにおいて、対応するアプリケーションが存在していると判定された場合に、このアプリケーションを使用して前記リクエストを処理した結果を、前記マスター仮想マシンを介して前記クライアントに送信し、対応するアプリケーションが存在しないと判定された場合に、自己のワーカー仮想マシン以外の他のワーカー仮想マシン内に対応するアプリケーションが存在しているか否かを調査し、この調査結果を前記マスター仮想マシンに送信する第1送信ステップと、In the second determination step, when it is determined that the corresponding application exists, the result of processing the request using the application is transmitted to the client via the master virtual machine, and the response When it is determined that there is no application to be checked, it is investigated whether there is a corresponding application in another worker virtual machine other than its own worker virtual machine, and the result is sent to the master virtual machine. A first transmitting step,
前記マスター仮想マシンにおいて、前記リクエストを転送した前記ワーカー仮想マシンから、当該ワーカー仮想マシン以外の他のワーカー仮想マシンに対応するアプリケーションが存在する旨の前記調査結果を受け付けた場合に、前記複数の識別情報のなかから選択した次の優先順位の識別情報のワーカー仮想マシン宛に前記リクエストを転送し、いずれのワーカー仮想マシンにも対応するアプリケーションが存在しない旨の前記調査結果を受け付けた場合に、前記次の優先順位のワーカー仮想マシンへ前記リクエストを転送せず、対応するアプリケーションが存在しない旨のレスポンスを前記クライアントに送信する第2送信ステップと、In the master virtual machine, when the investigation result indicating that there is an application corresponding to another worker virtual machine other than the worker virtual machine is received from the worker virtual machine that transferred the request, the plurality of identifications When the request is forwarded to the worker virtual machine of the next priority identification information selected from the information, and when the investigation result indicating that there is no application corresponding to any worker virtual machine is received, A second transmission step of not transmitting the request to a worker virtual machine of the next priority and transmitting a response to the effect that there is no corresponding application to the client;
を前記情報処理装置に実行させるためのプログラム。For causing the information processing apparatus to execute the program.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008168553A JP4627789B2 (en) | 2007-11-26 | 2008-06-27 | Information processing apparatus, information processing method, and program |
US12/261,795 US8239862B2 (en) | 2007-11-26 | 2008-10-30 | Apparatus, method, and computer program product for processing information |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007303914 | 2007-11-26 | ||
JP2008168553A JP4627789B2 (en) | 2007-11-26 | 2008-06-27 | Information processing apparatus, information processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009151744A JP2009151744A (en) | 2009-07-09 |
JP4627789B2 true JP4627789B2 (en) | 2011-02-09 |
Family
ID=40920782
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008168553A Expired - Fee Related JP4627789B2 (en) | 2007-11-26 | 2008-06-27 | Information processing apparatus, information processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4627789B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120246740A1 (en) * | 2011-03-22 | 2012-09-27 | Brooker Marc J | Strong rights management for computing application functionality |
JP6057666B2 (en) * | 2012-10-25 | 2017-01-11 | キヤノン株式会社 | Image forming apparatus, information processing method, and program |
JP6337437B2 (en) | 2013-09-30 | 2018-06-06 | 富士通株式会社 | Information processing apparatus, information processing system, and program |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000057112A (en) * | 1998-08-11 | 2000-02-25 | Fuji Xerox Co Ltd | Method for executing remote procedure call on network, and network system capable of executing remote procedure call |
JP2004192449A (en) * | 2002-12-12 | 2004-07-08 | Toshiba Corp | Load distribution method for web client/server system, load distribution system, and load distribution program |
JP2005092811A (en) * | 2003-09-19 | 2005-04-07 | Ricoh Co Ltd | Built-in apparatus having www server function, http request distribution method and program, and web system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04322359A (en) * | 1991-04-23 | 1992-11-12 | Nec Corp | Program remote execution system |
JPH10334058A (en) * | 1997-05-27 | 1998-12-18 | Shikoku Nippon Denki Software Kk | On-line system and load dispersing system |
-
2008
- 2008-06-27 JP JP2008168553A patent/JP4627789B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000057112A (en) * | 1998-08-11 | 2000-02-25 | Fuji Xerox Co Ltd | Method for executing remote procedure call on network, and network system capable of executing remote procedure call |
JP2004192449A (en) * | 2002-12-12 | 2004-07-08 | Toshiba Corp | Load distribution method for web client/server system, load distribution system, and load distribution program |
JP2005092811A (en) * | 2003-09-19 | 2005-04-07 | Ricoh Co Ltd | Built-in apparatus having www server function, http request distribution method and program, and web system |
Also Published As
Publication number | Publication date |
---|---|
JP2009151744A (en) | 2009-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0817043B1 (en) | Apparatus and method for operating an aggregation of server computers using a dual-role proxy server computer | |
US5818448A (en) | Apparatus and method for identifying server computer aggregation topologies | |
JP5123800B2 (en) | Information processing apparatus, information processing method, and program | |
JP6092249B2 (en) | Virtual channel for embedded process communication | |
JP3853592B2 (en) | Distributed web application server | |
JP4729172B2 (en) | Method and apparatus for performing transactions in a stateless web environment that supports a declarative paradigm | |
JP3853593B2 (en) | Method and apparatus for implementing an extensible authentication mechanism in a web application server | |
US9183066B2 (en) | Downloadable smart proxies for performing processing associated with a remote procedure call in a distributed system | |
KR20190085108A (en) | Run code on demand with localized device controller | |
US9398084B2 (en) | Information processing system | |
CN110352401B (en) | Local device coordinator with on-demand code execution capability | |
US20180011749A1 (en) | System and method for extending a web service environment to support scalable asynchronous clients | |
JPH1083308A (en) | Subsystem, method, and recording medium for stab retrieval and loading | |
JP5970559B2 (en) | Remote network management system and operation method thereof | |
US20030055862A1 (en) | Methods, systems, and articles of manufacture for managing systems using operation objects | |
US7500251B2 (en) | Method and system for managing programs for web service system | |
US20180234517A1 (en) | Redirecting scanners and printers over a wan | |
US8239862B2 (en) | Apparatus, method, and computer program product for processing information | |
US20020046228A1 (en) | Method and system for facilitating access to a lookup service | |
JP4627789B2 (en) | Information processing apparatus, information processing method, and program | |
US7089263B2 (en) | Apparatus and method for dynamically verifying information in a distributed system | |
TW582147B (en) | Inbound connector | |
WO1999044134A1 (en) | Method and system for facilitating access to a lookup service | |
JP6205013B1 (en) | Application usage system | |
EP1058880A1 (en) | Downloadable smart proxies for performing processing associated with a remote procedure call in a distributed system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091022 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091117 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100114 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100824 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101014 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20101102 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20101108 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131119 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4627789 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |