-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Komadu on Mesos cluster: Web service or Standalone server? #5
Comments
Hi Sid, According to your description, I think it'll be more suitable to use RabbitMQ messaging channel for your use case. Here are the reasons.
You won't need anything special on your VM to Komadu in either mode. If you decide to use RabbitMQ, you'll have to install it in the same VM or another one depending on your load. All you need are network connectivity and java. Let us know if you need further help. Thanks, |
Thanks, Isuru, that's helpful information. Looks like option that uses RabbitMQ should work in our case. |
Another question I have about deployment: we have a three-tier environment starting with user's local machine / desktop, dev environment, and production environment. I am wondering if Komadu running on a single VM can serve the different environments. I looked at Komadu config file and one needs to specify database location and credentials. Is it possible to start Komadu web service that points to different instances of MySQL DB? May be create different collections / tables for the three environments? Or do we need three different instances of Komadu/MySQL/RabbitMQ, one for each of the environments? |
@isurues A question about Komadu ingest and query API. We have deployed Komadu as a message-oriented service (RabbitMQ). From the manual it appears that the current ingest/query API is geared towards axis2 server setup (through We'd like to send provenance notifications to Komadu server from external sources and it is not clear from Komadu manual how we would do that within the messaging framework. |
Hi Sid, Please refer to Komadu user guide as here: https://github.com/Data-to-Insight-Center/komadu/blob/master/docs/KomaduUserGuide.pdf From Page 15-16, the section covers messaging client usage with bash script. For Java APIs, you could find send/receive message APIs in the package package edu.indiana.d2i.komadu.client.messaging; And use Notification and Query class. Please let me know if you have further questions. best, Quan Zhou On Thu, Aug 20, 2015 at 1:03 PM, sid thakur [email protected]
|
@gabrielzhouquan Thanks, I will look up that information. Essentially, we have a web stack (Node.js) within which we'd like to capture events and send notifications to Komadu. Komadu is running on a different VM than our web stack, so need to figure out how to send data between the two servers. |
Hi Sid, Glad that could help you with this. For Node.js, there is a amqp.node lib Best, Gabriel Zhou On Thu, Aug 20, 2015 at 1:22 PM, sid thakur [email protected]
|
Hi Gabriel, Sid |
@gabrielzhouquan I have some more questions about using Komadu through RabbitMQ-based messaging client. I am able to run RabbitMQ server and have better understanding now of how to create and run producer/consumer from my application (e.g., using AMQP for sending / receiving messages from RabbitMQ).
I see those queues even though I am not running Komadu. I see that following parameters are specified in
but am not sure I see how RabbitMQ sets up these queues? I didn't find any information on configuring RabbitMQ server in documentation to set these queues explicitly.
An example of using messaging client that addresses above questions would be helpful, but any other info will be appreciated. Thanks! Sid |
I was able to partly figure out second part of my question above (namely, how to forward messages to Komadu via RabbitMQ). Here is my sample sender python code:
Running above script produces message Clarification of first question above (namely, how does rabbit set up various queues) and any other info would still be helpful. Thanks. |
Hi Sid, It is a good question! In the configuration, we have the KomaduQueueName which can be set up. And for messaging bus, a client send a notification and should get a response. So we append several postfix to KomaduQueueName("Request, “Response”, “_Notification”) to set up 3 queues to handle incoming queries and notifications. {KomaduQueueName}+”Request” — Queue to receive incoming query request Please let me if this clears your question. For templates of notifications, you can find from this url: https://github.com/Data-to-Insight-Center/komadu/tree/master/client-core-messaging/samples https://github.com/Data-to-Insight-Center/komadu/tree/master/client-core-messaging/samples Please let me know if you have any questions. Best, Quan (Gabriel) Zhou
|
Gabriel, Again, thanks for being so responsive to my questions :) |
Here are read outs from my console on queues and exchanges in Rabbit that appear by default (even when komadu server is not running):
|
Hi Sid, This config file is picked up every time when RabbitMQ is started. You can view Rabbit MQ as a daemon which is running forever to take in notifications and send out response. Hope this answers your questions! Best, ——————————————————————————— Quan (Gabriel) Zhou
|
Great, thank you. |
Hi Gabriel, (1) Is it possible to log provenance notification messages using JSON format instead of the default XML schema provided in komad-1.0/client-core-messaging/config/komadu-ingest/query_schema.xsd? (2) Komadu is able to ingest notifications, but when I see the log file
|
Hi Sid, For question 1, Current Komadu version only supports xml format. Sorry for the inconvenience. For quesiton2, The bug should happen due the sql database lock GRANT ALL ON komadu.* TO GRANT SELECT ON mysql.proc TO 'komaduuser'@'localhost'; Many thanks! Best, Quan Zhou
|
@gabrielzhouquan Thanks for the clarifications. A question about configuring Komadu to accept data from different types of clients. We'd like to use a single instance of Komadu messaging service to serve three different environments: prod environment, dev/staging env, and local dev. Last one being localhost on a developer machine. We'd like all three to send messages to the same server, but with different identifiers. My preliminary guess is that this could be achieved by starting komadu messaging service using different config files - one each for the three types of clients, and having different credentials for RabbitMQ and different queue and channel names. Is this what you all would recommend or is there a better/different way of achieving multi-client support? |
Hi Sid, For this question about multi-client support, two options could be available: 1/ Setting up multiple messaging client: 2/ Using prefix to classify notification/query: Hope this can help! Please let me know if this makes sense to you. Best, Quan Zhou
|
Okay, thanks @gabrielzhouquan |
Hi @gabrielzhouquan I am having some trouble getting query response queue. I am using AMQP in node.js to send prov messages to the messaging server. I am able to successfully send messages on the queue If I check the queues set up by RabbitMQ after sending a query request (below), I see a zero against the query response queue. I don't think I have any listener attached to the response queue that would remove the message, so not sure what's going on.
Below is code I am using:
|
Could you please print out the console log output from your node script? Thx!
|
I don't see a log or console output. The subscriber in the Receiver part of code binds to the queue but I don't think the subscribe function is called because the komadu response queue is always empty. Thanks. |
Hi Sid, In yr senders code, when amqp connection is ready, console will have You may refer to this link :https://github.com/squaremo/amqp.node/tree/master/examples/tutorials https://github.com/squaremo/amqp.node/tree/master/examples/tutorials
|
Okay, sorry about the confusion. Yes, connection work fine and I see the message
|
Hi,
I have a client-side listener attached to the query response queue but it never receives any data. Here's an Interesting observation: While my node.js client-side listener is polling, I run the command line script in
Thanks. |
@isurues / @gabrielzhouquan I'd appreciate any inputs regd. my last question in this thread. Basically, I am having trouble getting response from query. Thanks! |
Hi Sid, I missed the last thread. From your description, AMQP client can get query response when you issue the query from JAVA client. However, AMQP cannot get response when you use AMQP client to issue the query. It probably is caused by connection from AMQP client to Komadu Request queue. If possible, could you share me two things? 1/ Your AMQP client codes; Many thanks! Best, Quan Zhou
|
Hi, |
Hi Sid, thanks! Could you attach your logs to the issues in GitHub? best, Gabriel Zhou Could you attach your log to
|
Here you go; I add line delimiter after reading in text file with query.
|
Hi Sid, Got the problem! Sorry that I didn’t see it at the first place. For Komadu query, the client should send query format as following: +”#”+ For your code, please add the response routing key (UUID) to the beginning of provDoc: var array = fs.readFileSync (filePath).toString ().split ("\n”);
//>>> ADDING LINE DELIMITER
function guid() { Please let me if this works for you. Many thanks! Best, Gabriel Zhou
|
Thanks, I'll try it out and let you know. @gabrielzhouquan |
@gabrielzhouquan Komadu log output:
Receiver code. The function
Calling emit and receive in following order:
Console output on my server:
|
@isurues When you get a chance, could you please take a look at previous post Re. issue getting response back from server. I am guessing that @gabrielzhouquan is busy. Thank you all. |
Hi Sid, For the receiver code, var amqp = require('amqp'); var connection = amqp.createConnection({ host: 'dev.rabbitmq.com' }); // Wait for connection to become established.
}); Best, Quan Zhou
|
Thanks. I tried the amqp lib you suggested, but there is no response from server.
I call the the receiver after I close the sender, to make sure that there is no overlap.
Komadu log file reports that response is sent to client:
|
@gabrielzhouquan Any hints at how I could debug the issue with query response? Please see prev. post. Appreciate your time for helping us install and use K, and apologize for this recurring issue. Thanks! |
Hi Sid, No problem at all. I have wrote a functional javascript Komadu query client for you as below: query.js: var amqp = require('amqplib/callback_api'); amqp.connect('amqp://localhost', function(err, conn) {
}); setTimeout(function() { conn.close(); process.exit(0) }, 5000); function guid() { 1/ Install amqplib:
2/ Run query.js:
Example result is as below: [PROV] Document sent: Please let me know if you have further questions or problems. Many thanks! best, Gabriel Zhou
|
@gabrielzhouquan Thank you! I will test it with my application. |
Hi @gabrielzhouquan , Does it have to do with Komadu XSD schema? Thanks.
|
Hi Sid, I have just published Komadu javascript messaging client today. This node module can be found at:
The README.md will give you a detailed usage guide with this module. Please let me know if you encounter any problem when you try out this module. Many thanks! Best, Quan (Gabriel) Zhou
|
Hi, That is great, thank you. I will take a look and let you know. |
@gabrielzhouquan Thanks, I checked out the node module and have integrated it with my code. Send notification works fine. Only a couple issues: [1] In query, following line generates exception below. Changing to
[2] Even though records seem to added via send notification, query almost always returns a sparse result (blank). I have been using the standard notification and query data in the
Should I blow away the database and create a new one from scratch? Thanks! |
Hi Sid,
Could you do the following? rabbitmqctl stop_app If this doesn’t work, another brute force method is as below:
Possibly it is due to conflicting raw provenance notifications in the backend database. Could you drop the Komadu database and setup a new one? Best, Quan (Gabriel) Zhou
|
@gabrielzhouquan Thanks for your quick reply! Will try out your recommendations and let you know. Thanks! |
@gabrielzhouquan After re-setting RabbitMQ server and restarting it, I get following error upon running komadu server:
|
Check your username and password of messaging in komadu.config. After reset, rabbitmq will use default username “guest” with default password “guest”.
|
I guess I need to add users |
@gabrielzhouquan I reset RabbitMQ server and added a new user ('myuser'), different than guest. I also dropped the komadu database and re-created a new one. But no I am getting following error when I attempt to start komadu. Am I missing something here?
RabbitMQ status:
Komadu.properties file:
|
Hi Sid, Trace back to the root of the exception stack: java.net.SocketException: Connection reset This should be due to the settings from RabbitMQ end or your environment settings which would be out of my scope. My suggestion is that please check your rabbitmq log at the directory <rabbitmq_home>/var/log for details. Another way is to re-install RabbitMQ server which would be easier. best, Quan (Gabriel) Zhou
|
Okay, thanks, will check on your suggestions. |
@gabrielzhouquan I fixed the problem by adding permissions for my non-default user using the following:
Thanks. |
Hi @gabrielzhouquan Thanks.
I modified the schema in
|
Hi @gabrielzhouquan could you please look at my previous posting when you get chance? Any guidelines on extending/modifying Komadu XSD would be very helpful. Thank you! |
HI sid, this new information type is onlyinserted into the client side but also need to be inserted into server slide in order to let the server know this new information type. try to update the ingest xsd from the server side. Let me know if this works.
|
Okay, thanks. I had updated only the client side xsd - that makes sense. |
Hi @gabrielzhouquan
query document:
Existing record in MySql database that I expect to be returned:
|
@gabrielzhouquan Hi, any clues to issue in my last post? Thanks. |
Hi Sid, I can see you are using find activity request query xml. Could u using the following schema instead? <quer:findActivityRequest xmlns:quer="http://komadu.d2i.indiana.edu/query"> Element “name" is the name of your targeting activity and “nextActivityID" is the activity which is next to your targeting activity. (In case some activities share the same name) Best, Gabriel
|
Hi @isurues
We have an Apache Mesos cluster within which we'd like to deploy Komadu. Ideally, we'd like komadu to run in its own VM on the cluster and be able to receive event-style notifications from a web app and other process running on another, production-level, VM. Essentially, we'd like to be able to send prov notification events from other VMs to komdu (running in its own VM).
What I'd like to know is which of the two methods of running Komadu, web service or standalone server, would be suitable for our scenario. Please also clarify what accommodations, if any, would we need to make to enable Komadu to function within this multi-VM envrionment.
Thanks,
Sid
The text was updated successfully, but these errors were encountered: