I used C # To develop a distributed and online development open cloud platform that can build tens of thousands of computers into a cluster. I would like to share with you

Source: Internet
Author: User
Tags node server visual studio 2010
Functions and usage of the distributed cloud platform for millions of business circles

Platform function Overview:
Simply put, n computers are organized in an orderly hierarchy (logical hierarchy) to form an organism (Computing Cluster) to complete tasks that are hard to accomplish by a computer.

More broadly speaking, this cloud platform is used to convert hundreds of thousands of computers into one.

In short, the cloud platform of millions of business circles provides:
1. Remote File distribution service
2. Remote File delivery service development interface
3. Create a remote non-transparent proxy service
4. Provides interfaces for creating remote object development.
5. Web Server (Microsoft Web application stress tool is used for stress testing, with a maximum of 0.1 million concurrent connections per minute)
6. Regularly retrieve node and cluster performance index services
7. interfaces for obtaining node and cluster performance index service development and call
8. Provides the development interface for creating remote optimal node objects and the development interface for creating objects of remote specified IP node machines
9. interfaces for creating objects in a group of clusters with a remote IP address as the root IP address in parallel

Glossary:
Remote non-transparent proxy service: Creates the optimal proxy, creates a proxy group for a node group, and registers proxy services.
Non-transparent proxy service: Creates and provides a remote object, allowing you to create and call any attribute methods of the real object on the remote node server through the proxy object
For example:
(1) Create the optimal proxy object in the node group starting with 192.168.2.201
Testdemo. Class1 C1 = (testdemo. Class1 ) RF. createthebestremoteobject ( Typeof (Testdemo. Class1 )," 192.168.2.201 ");

(2) create a proxy object with the specified IP address 192.168.2.201
Testdemo. Class1 C1 = (testdemo. Class1 ) RF. createspecifyipremoteobject ( Typeof (Testdemo.Class1 )," 192.168.2.201 ");
Console. writeline (s4.sum (1, 2 )); // Check the output result and you will know the effect.
(3) create a proxy object group in the node group starting with 192.168.2.115
Object [] Objs = RF. createallremoteobjects ( Typeof (Testdemo. Class1 )," 192.168.2.115 ");

Figure 1 cluster small and medium application architecture model

Chart 2 large-scale practical application architecture model

Figure 3 cluster actual test Architecture Model

Platform function Overview:
Simply put, n computers are organized in an orderly hierarchy (logical hierarchy) to form an organism (Computing Cluster) to complete tasks that are hard to accomplish by a computer.
More broadly speaking, this cloud platform is used to convert hundreds of thousands of computers into one!

Platform components:
1,
. Netframework3.5
2,Platform Cloud Cluster Server System
3,Platform cloud cluster Application Development Kit
4,Platform cloud cluster application development example source code

 
Platform components:

1. netframework3.5
Where can I install it? A: It is installed on the cluster node machine, and each machine must be installed.
How to install it? A: Download framework3.5setup.rar, decompress it, and run: dotnetfx35setup.exe. Follow the prompts to go to the next step.
Are there other configurations or settings? A: No.
Note: You can directly install vs2008 (Microsoft Visual Studio 2008) without framework3.5setup.rar ).

2. Platform Cloud Cluster Server System
Where can I install it? A: It is installed on the cluster node machine, and each machine must be installed.
How to install it? A: Download distributedplatform.rar and decompress it. Run the following command: Install. BAT: the installation is complete. Press enter.
Are there other configurations or settings? A: Yes. You need to set the configuration file.
Install or configure first? A: Install the cluster service after configuration.
Usage and description of the Cluster Server System Configuration File (bwsyq.distributed.cluster.exe. config:
<! -- Distributed cluster configuration aliasname: node or sub-node name rootnodeip: current node IP uppernodeip: Upper node IP heartrate: Heartbeat frequency (SEC) webserverport: Web Service port number -->
<Websystem. Framework. Distributed
Aliasname = "1" rootnodeip = "192.168.2.201"
Uppernodeip = "192.168.2.201" heartrate = "1" webserverport = "8080">
<! -- The sub-node information can be configured with multiple nodes (theoretically unlimited). Considering parallel processing, we recommend that you configure 10 sub-nodes for each node and configure up to 10000 machines for layer-4 configuration -->
<Nodeinfo aliasname = "02" IP = "192.168.2.209" webserverport = "8080"/>

<! - No lower-level nodes need to write "<nodeinfo…> "Is this line? A: No need to write -->
<! - How do I write "<nodeinfo…> What about this line? A: One node and one row -->
</Websystem. Framework. Distributed>
Glossary:
Aliasname
Naming rules for nodes or subnodes: No naming rules: Upper-layer node name + XX (00 ~ 99) For example, the root node uses 1xx for the layer-2 node of 1, for example, the layer-3 101 of 10101, and so on.
Aliasname It is recommended that you do not repeat it.
Rootnodeip It must be the root node address (127.0.0.1 cannot be used ).
Uppernodeip Is the address of your upper-layer node (127.0.0.1 cannot be used ).
Heartrate Heartbeat frequency. It is recommended to set it to 1. Unit: Second (the smaller the value, the higher the frequency. Algorithm More accurate) will it affect machine performance? A: Very small.
Webserverport : The Web Service port number can be used externally. If it is used only inside the cluster, the value range is (1 ~ 65535)
Note: Do not use 127.0.0.1 when entering the IP address during cluster configuration. Use the real IP address of the node. Otherwise, unpredictable errors may occur.
3. Platform cloud cluster Application Development Kit
What tools are used for development? A: Microsoft Visual Studio 2008/Microsoft Visual Studio 2010
Where can I install it? A: The developer's computer
Do I need to install it on a cluster node? A: No.
How to use it? A: Download distributedplatformsdk.rar and decompress it. You do not need to install it. You can reference it all during development.
Are there SDK interface functions? A: Yes.
Used for developmentProgram? A: Three programs,
Note: No matter which program is developed, please first reference all DLL class libraries in the SDK
1. Develop a cluster application business logic program, also known as bussinessobject (BO), which is compiled into a DLL class library, for example:
Public class Class1 : Websystem. Framework. Bo. Basebo
{
Public String Sum ( Int A,
Int B)
{
// Make a small experiment when outputting the result. Add an IP address to the result to see which node is running.
Return (A + B). tostring () + "the actual running node is:" +
API . Localips () [0]. tostring ();
}
}
Assume that: Testdemo. dll
Do you have any special requirements? A: Yes. All classes that need to be called on the client must inherit the websystem. Framework. Bo. basebo class. After the class is released to the cluster without inheritance, it cannot be called by other client programs.
2. programs used to manage Clusters
(1) Distribute the developed Bo class library to the cluster. Only two lines are required. Code :
Remotefactory Rf =
Newremotefactory ();
// 192.168.2.201 is the root node IP address. It should be modified according to the actual situation.
RF. distributionfile (@" D: \ testdemo. dll "," 192.168.2.201 ");

In this way, can I publish testdemo. DLL to all the computers in the cluster? A: Yes, it's that simple.

(2) Check the performance indicators and running status of all computers in the cluster. Only eight lines of code are required.
// 192.168.2.201 is the root or subnode IP address. It should be modified according to the actual situation.
Nodesperformancelist Npfs = RF. getperformancelist (" 192.168.2.201 ");
Console . Write (" Nodes in the node group : "+ Npfs. Count );
Foreach ( Nodesperformance NPF in npfs)
{
If (NPF. Index = 0)
Console . Write (" Node host "+ NPF. IP +" Faulty! ");
}
Npfs. Sort ();
Console . Write (" The IP address of the node group with the optimal performance is: "+ Npfs [0]. IP );
In this way, can the running status of the node group be obtained? A: Yes, it's that simple.
Note: If the IP address of the root node is entered, the operation status of the entire cluster is obtained. If the IP address of a subnode is obtained, the operation status of the node group is obtained.
3. Cluster-based distributed applications are developed in three situations:
(1) Development Ranks first among millions of military commanders What does the program mean? Is to let the machine with the best performance in the cluster execute a function and get the returned results
Here we assume that the business logic program developed above Testdemo. dll Has been distributed to the centralized,
First, we need to reference testdemo. dll. The client also needs a copy.
Testdemo. Class1 S4 = (testdemo. Class1 ) RF. createthebestremoteobject ( Typeof (Testdemo. Class1 )," 192.168.2.201 ");
Console . Writeline (s4.sum (1, 2 )); // Check the output result and you will know the effect.
Note: Createthebestremoteobject If the IP address of the root node is entered, the optimal node of the entire cluster is obtained. If the IP address of a subnode is obtained, only the optimal node of the node group is obtained.

(2) What does it mean to develop a specific type of program: let a specified node server in the cluster execute a function and get the returned result?
Here we assume that the business logic program developed above Testdemo. dll Has been distributed to the centralized,
First, we need to reference testdemo. dll. The client also needs a copy.
Testdemo. Class1 S4 = (testdemo. Class1 ) RF. createspecifyipremoteobject ( Typeof (Testdemo. Class1 )," 192.168.2.201 ");
Console . Writeline (s4.sum (1, 2 )); // Check the output result and you will know the effect.
(3) development Wolf group tactics-parallel Is to let all the machines in the cluster/node Group execute a function and get the returned results.
Here we assume that the business logic program developed above Testdemo. dll Has been distributed to the centralized,
First, we need to reference Testdemo. dll Don't be surprised. The client also needs a copy.
Object [] Objs = RF. createallremoteobjects ( Typeof (Testdemo. Class1 )," 192.168.2.115 ");
For (INT I = 0; I <objs. length; I ++)
{
Console . Writeline (testdemo. Class1 ) Objs [I]). getname (); // you can see the output result and you will know the effect.
}
Note: Createallremoteobjects If the root node IP address is entered, all node objects of the entire cluster will be obtained. If it is a subnode IP address, only the node objects of the node group will be obtained.


4. Example of platform cloud cluster application developmentSource code

Platform cloud cluster application development example source code

Platform System Environment requirements:XP/Vista/win7/win2003/win2008

FAQ & Glossary:
Cluster: A cluster is a loose coupling composed of two or more node servers.
A set of computing nodes that provide users with a single customer view of network services or applications (including databases, web services and file services), and provide fault recovery capabilities close to fault tolerance machines. Cluster System 1
Through two or more node server systems through the corresponding hardware and software interconnection, each cluster node is an independent server that runs its own process. These processes can communicate with each other.
A single system is formed to provide users with applications, system resources and data in collaboration. In addition to providing services as a single system, the cluster system also has the ability to recover server-level faults. The cluster system can also
In the cluster, you can add servers to the cluster, increase the server processing capability internally, and provide inherent reliability and availability through system-level redundancy.
Root Node:The highest level of the cluster.
Subnode:All machines except the root node in the cluster are a subnode.
Node group:Starting from a subnode, a set of all the following nodes is called a subcluster. If there are no nodes below, the node group is itself.
A node group:A node group under the cluster.
Non-transparent proxy service:Create and provide a remote object so that you can create and call any attribute method of the real object on the remote node server through the proxy object.

Is this cloud platform stable?
A: It is very stable. 13 PCs have been used for testing for a week without any faults.
How to obtain the business logic programs distributed in the previous cluster for newly added nodes?
A: It's easy. 1. Once the service is enabled for a new node, it is automatically obtained from the upper-layer node. 2. You can also copy it manually.
Is this cloud platform excellent log record?
A: There are detailed log records in the configuration file bwsyq.distributed.cluster.exe. config,
Change <level value = "off"/> to <level value = "all"/>.
Is this cloud platform completely free of charge?
A: Yes.
WHO developed this cloud platform?
A: It's me. My name is HUANG Zhi, a typical Chinese. It's handsome, elegant, refreshing, honest, hardworking, and kind. My QQ number is 99923309.
What is the purpose of developing this cloud platform?
A: Breaking the technological monopoly of large companies, lowering technical barriers, and revitalizing China, so that ordinary people can quickly implement large-scale applications.
What specific applications can this cloud platform have?
Answer: scientific computing, large-scale retrieval, high-performance computing, massive data storage, deciphering of alien signals, and high-performance data information collection
Is there any third-party Technology on this cloud platform?
A: No. I have completely imagined it. I have never referenced any third-party code.
Can I use this cloud platform to create a large-scale website like Google?
A: It is easy to implement.
What should I do if I find a platform error or have good suggestions?
A: mail me bwsyq@bwsyq.com

:
1,
. Netframework3.5
2,Platform Cloud Cluster Server System
3,Platform cloud cluster Application Development Kit
4,Platform cloud cluster application development example source code

Others:
Open-source: fully self-developed Search Engine 1.0 source code and instructions, a single machine 4 million web page, any 50 words search within 20 milliseconds
Open-source: Parallel collector with Word Segmentation developed based on the. NET development framework of millions of business circles
Million business circles. Net Development Framework 2.0 and Development Framework API specification (bwfw) (including parallel computing and Chinese and English Word Segmentation functions)
Share a little code (small C web development framework), use a web File Uploaded in C Language (including all source code) I
The consequences of all the source code of Tianxin tianzi erp pdk come to me-beyond the Web tianyun
Let's take a look at how my BS Gantt Chart schedule works? Without refreshing the new Ajax Gantt chart, the production scheduling result is displayed.
Software Engineering overview-enterprise architecture-the foundation for IT enterprises to become bigger and stronger-my views
Practice tests show that the Asp.net project only needs to be modified in three places during Linux mono compilation.
I personally wrote a general Ajax framework, which is fully compatible with various ie Firefox versions! (Complete source code and complete examples are provided)
A Chinese Word Segmentation Server (C Language Development + dictionary + Source Code) has been developed. The biggest feature can be called by JavaScript!
I wrote an htmlparse (Web analyzer) out-of-band collection function in pure C language. The size is only 200 KB (free + OPEN SOURCE + operation)

I hope you can correct it. Thank you!My QQ 99923309

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.