Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
minLevel3
outlinetrue
stylenone

Cluster Terminology

This topic introduces some of the concepts unique to the cluster creation and communication feature of A-Stack. 

TerminologyDescriptionSynonym Terms

Network

A collection of A-Stack running instances that communicates (notifications) and keep persistent data store in sync.Cluster, Clustering
PeerA-Stack running instance that is participating in forming a Network
NodeA-Stack running instancePeer if participating in forming a network.
GroupLogical Name defined to make communication type between a collection of Nodes
AdvertiseSend Notifications to peer or group
ReplicateReplication of data (TQL Storage) between nodes or a group of nodes

...

AMQP Transport for Cluster Communication

...

languagexml
themeEmacs
titleSffNetworkFacet Capability
linenumberstrue

...

AMQP is a publish/subscribe protocol therefore instead of point-to-point connections between cluster peers a group of peers as a whole connects to the exchange. Recall that peer relationships are defined in terms of groups so every time a peer sends something to a group, the group itself forwards the message to the exchange. The opposite is also true. Group also subscribes to the exchange so it can receive messages published by other peers to that group.


Example of AMQP Topology for 4 peers connected to a single group.


                                 Image Added



Code Block
languagexml
themeEmacs
titleSffNetworkFacet Capability
linenumberstrue
<NewFacetInstance Name="wsNotificationCluster" Type="SffNetworkFacet" Context="new" fid="wsNotificationCluster">
       <OnActivate>
            <ImportFacet>[:RuntimeParams.MacroFacetID:]</ImportFacet>
            <SetLocalData Key="fed">
                <Value>
                    <Server Id="[:RuntimeParams.ClusterName:]_Server1" Host="bkhan" Port="8082"/>
                    <Server Id="[:RuntimeParams.ClusterName:]_Server2" Host="bkhan" Port="8083"/>
                    <Server Id="[:RuntimeParams.ClusterName:]_Server3" Host="bkhan" Port="8084"/>
                    <Server Id="[:RuntimeParams.ClusterName:]_Server4" Host="bkhan" Port="8085"/>
                </Value>
            </SetLocalData>
            <For Each="server" From="$LocalData.fed" In="Server">
                <AddProcessData Key="DeviceEngines.DeviceEngine">
                    <Value>
                        <Name>[:$LocalData.server.Id:]</Name>
                        <URL>ws://[:$LocalData.server.Host:]:[:$LocalData.server.Port:]/fid-wsNotificationCluster</URL>
                        <AdvertiseTo>[:RuntimeParams.ClusterName:]</AdvertiseTo>
                        <Group>[:RuntimeParams.ClusterName:]</Group>
                    </Value>
                </AddProcessData>
            </For>
            <Log Level="INFO" Message="TQLNotificationCluster : Federation AdvertiseTo servers [:$ProcessData.DeviceEngines:]"/>
            <Process>
                <Network>
                    <OnPeerError>
                        <Log Level="error" Message="TQLNotificationCluster : Peer [:$ContextData.$Peer.Key:] error: [:$Error:]"/>
                    </OnPeerError>
                    <Namespace Name="AMQPCluster">
                        <Include>$ProcessData.DeviceEngines</Include>
                    </Namespace>
                     <Group name="[:RuntimeParams.ClusterName:]" UserName="tql" Password="tql12345" 
                           VirtualHost="/" Durability="true"
                           Host="mqtt.atomiton.com" Port="5672" 
                           ExchangeName="AtomitonFanoutExchange" 
                           ExchangeType="fanout" QueueName="peer.[:PeerQName:]">
                           <Send post="amqp://?ClientType=publisher&
                                            UserName=[:UserName:]&
                                            Password=[:Password:]&
                                            VirtualHost=[:VirtualHost:]&
                                            HostName=[:Host:]&
                                            PortNumber=[:Port:]&
                                            ExchangeName=[:ExchangeName:]&
                                            ExchangeType=[:ExchangeType:]&
                                            QueueName=[:QueueName:]&
                                            Durability=[:Durability:]">
                                  <RoutingKey>cluster.[:QName:]</RoutingKey>
                                  <Template>
                                      <Message>
                                          <Value>
                                           <PublishMessage>[:$Request.Message.Value:]</PublishMessage>
                                          </Value>
                                       </Message>
                                    </Template>
                            </Send>
                            <Receive get="amqp://?ClientType=subscriber&
                                              UserName=[:UserName:]&
                                              Password=[:Password:]&
                                              VirtualHost=[:VirtualHost:]&
                                              HostName=[:Host:]&
                                              PortNumber=[:Port:]&
                                              ExchangeName=[:ExchangeName:]&
                                              ExchangeType=[:ExchangeType:]&
                                              QueueName=[:QueueName:]&
                                              Durability=[:Durability:]"
                                         as="ServerPipeline" disable="CMD_SEND">
                                  <Message>
                                    <Value>
                                      <AMQPSubscriptionConfig>
                                        <RoutingKey value="cluster.[:QName:]"/>
                                      </AMQPSubscriptionConfig>
                                    </Value>
                                  </Message>
               <Process>           <Network>   </Receive>
         <C1 fid="cluster" documentation="shared cluster deployment parameters"/>      </Group>
      <Group name="G1"/>          </Network>
    <Namespace name="N1">       </Process>
        <TqlEngine name="P0" url="ws://host:port/fid-[:C1.fid:]" group="G1" advertiseTo="G1" documentation="parent replicator <SffReport Name="wsNotificationCluster_OnActivate"/>
        </OnActivate>
      <TqlEngine  <OnOpen nameModifyPipeline="P1WsServerExtensionArgs" urlContext="ws://host:port/fid-[:C1.fid:]" group="G1" advertiseTo="G1" documentation="parent replicator"/>keep"/>
        <Policy name="MyMetering" type="SffSimplePolicy" kind="metering">
             </Namespace> <inc type="integer" target="RequestCount"/>
            <add   <TqlEngine nametype="integer" target="E2TotalBytes" urlvalue="ws://host:port/fid-[:C1$RawData.fidTotalBytesRead:]" group="G2" replicateTo="G1" documentation="child controller/>
            <set type="integer" target="AvgRequestSize" value="[:$ThisData/(number(TotalBytes div RequestCount)):]"/>
        </Policy>
        <OnError>
            
               <TqlEngine name="E3" url="ws://host:port/fid-[:C1.fid:]" group="G2" replicateTo="G1" documentation="child controller"/><SetLocalData Key="guard" Value=""/>
            <ReportError>
                <Error>[:[:$LocalData.guard:]$Error:]</Network>Error>
                </Process><occurredIn>TQLNotificationCluster</occurredIn>
            </OnActivate>ReportError>
            <OnOpen<SffReport ModifyPipelineName="WsServerExtensionArgswsNotificationCluster_OnError"/>
        </OnError>
    </NewFacetInstance>       

Cluster Topologies

...