Versions Compared

Key

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

...

Code Block
docker-compose up -d


Add the nodes in Odysseus Studio

Before adding the worker nodes to Odysseus Studio, stop the OdysseusNet feature in the nodes tab, it will be started automatically when adding the nodes dynamically with OdysseusScript.

Image Added

Before you can install queries on the nodes, you have to add the worker nodes with:

Code Block
#CONFIG DISTRIBUTE true
#PARSER PQL

#DEFINE HOST 192.168.188.36
#ADD_NODE (name=worker_1) (serverAddress=${HOST}) (serverPort=18881) (username=System) (password=manager)
#ADD_NODE (name=worker_2) (serverAddress=${HOST}) (serverPort=18882) (username=System) (password=manager)
#ADD_NODE (name=worker_3) (serverAddress=${HOST}) (serverPort=18883) (username=System) (password=manager)


Install the remote query

Run the following OdysseusScript query in Odysseus Studio.

Code Block
#REMOTEQUERY (name=worker_1)
#PARSER PQL


#RUNQUERY
nexmark:person := ACCESS({source='nexmark:person',
    wrapper='GenericPush',
    transport='TCPClient',
    protocol='SizeByteBuffer',
    dataHandler='Tuple',
    options=[
        ['host', 'nexmark'],
        ['port', '65440'],
        ['ByteOrder', 'LittleEndian']
        ],
    schema=[
        ['timestamp', 'STARTTIMESTAMP'],
        ['id', 'INTEGER'],
        ['name', 'STRING'],
        ['email', 'STRING'],
        ['creditcard', 'STRING'],
        ['city', 'STRING'],
        ['state', 'STRING']
        ]
    })
    
    

#RUNQUERY
out = nexmark:person
Note

Remark, that the host is 'nexmark' instead of 'localhost', because the remote worker node 'worker_01' is started in the default docker network and access the nexmark by the DNS resolved service name 'nexmark'


See the remote query output

Here is described how you can see the remote query output.

Odysseus Studio

You can the following query in Odysseus Studio to access the output (Reading Query Results via REST/Websocket):

Code Block
#PARSER PQL
#RUNQUERY
in = ACCESS({
    transport = 'WebsocketClient', 
    wrapper = 'GenericPush',
    datahandler = 'Tuple',
    protocol = 'CSV',
    source = 'access',
    readMetadata = 'true',
    options = [
        ['uri','ws://localhost:18881/queries/0/a2e1a574-6c72-4961-b304-111c01708445/0/CSV/fif8htets00ql9q71okbuu7qs9']
    ],
    schema = [['timestamp','StartTimestamp'],['id','Integer'],['name','String'],['email','String'],['creditcard','String'],['city','String'],['state','String']]
    }
)

You have to adjust the optioins-uri in the query with the rootOperators-websockets-CSV uri from http://localhost:18881/queries/0 


Odysseus Webstudio