-
Notifications
You must be signed in to change notification settings - Fork 42
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
Orion LD with mongo 7.0 #1620
Comments
I updated the C driver to 1.27.2 but still the same error. But still the its the same error! Is there something I'm missing - do I need to build/compile the orion-LD again after updating the C++ drivers? Also, the Fiware Orion-LD documentation does not say anything about installing C++ driver: https://github.com/FIWARE/context.Orion-LD/blob/develop/doc/manuals-ld/installation-guide-ubuntu-22.04.md |
Sorry for the late response, I hadn't seen this issue until right now, thanks to your update. |
Ok thank you so much. I was wondering if there was any option. Very helpful. I will try this again. I only need NGSI-LD |
See also #1062 |
Thanks for the heads up @rschwebel, I see that a lot of work needs to be done. |
@kzangeli Another question, slightly related to Mongo drivers. Now I plan to replace Cygnus NGSI (built from sources - if you recall), with Cygnus NGSI-LD, will I come across the same issue as in related to the mongocpp legacy drivers? |
Not a clue, but I see no real reason why. It's an implementation detail. Did you know that NGSI-LD brokers actually save the history (to postgres) if you ask it to? |
@kzangeli thanks for this. So I see that I may not need cygnus as long a I have postgres installed. |
Yeah, if posrgres is OK for you as sink. |
@kzangeli thanks for this. So I see that I may not need cygnus as long a I have postgres installed. How do I pass the postgres host and port number? |
Start Orion-LD with -u (usage) and you see the CLI options. Think they're called "-troeHost", "-troeUser" etc. Can't verify right now, in an airport ... |
Thank you, I'll do that for now! |
Ok I got orionld running with -troe -troeHost -troePort -troeUser -troePwd, it starts with no errors. |
No that should be all. |
Ok I didn't take a log at the log file. I'll do it and get back with the results.
Thanks
18 Jun 2024 11:17:34 pm Ken Zangelin ***@***.***>:
…
No that should be all.
Let's have a look at the logfile. Something must be failing.
*cat /tmp/orionld.log*
—
Reply to this email directly, view it on GitHub[#1620 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/BDNMUOI4ENRIADGOFNHDKN3ZICPWRAVCNFSM6AAAAABI2M3KWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWHE4TAOJTHE].
You are receiving this because you authored the thread.
[Tracking image][https://github.com/notifications/beacon/BDNMUOPNHKVY4WGKPH527U3ZICPWRA5CNFSM6AAAAABI2M3KWCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUBYI7NW.gif]
|
orionld.log |
Ok, weird. Where does the data go??? |
It might also be quite useful to check the log of CrateDB. |
Ok thanks for this. I restarted orionld with CLI, and I'm looking at the crateDB logs too, nothing there from the orionLD ip. |
I see in the terminal that orionLd is trying to insert data into attributes and entities tables... Should orionLd create if they do not exists? |
time=Wednesday 19 Jun 10:03:03 2024.446Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mhdConnectionInit.cpp[1073]:mhdConnectionInit | msg=------------------------- Servicing NGSI-LD request 002: POST /ngsi-ld/v1/entities -------------------------- |
ok, good.
|
Yes, each and every create/update/delete on an entity/attribute should get recorded in Crate/postgres. |
Long time ago I implemented this but, I believe the broker creates the tables. I'll check the source code. Skellefteå? |
Verified, the DB is created in run-time and then the tables are created. |
Ok, so I got psql, I pasted the SQL on the CLI and I got reply from crateDB 'entities' unknown. means that the table is not there. CrateDB uses schemas instead of databases, so the default schema is DOC and it has translation service for postgres that all tables are created in this schema. Hope I'm making sense. developer=> INSERT INTO entities(instanceId,ts,opMode,id,type) VALUES ('urn:ngsi-ld:attribute:instance:1e0a34a2-2e23-11ef-85eb-00163eee2746', '2024-06-19T10:03:03.446Z', 'Create', 'urn:ngsi-ld:Skelleftea:Campus:VirtualSensor:004', 'https://uri.etsi.org/ngsi-ld/default-context/VirtualSensor004'); hmm please excuse my ignorance, what are tenants? Oh that's interesting, how come you ended up in Spain - is that correct if I'm right? I'm working on Fiware project for the Lulea technical university, Skellefea campus. So looks like the tables were not created. Is that something to do with the tenants? I'm running the service via systemctl with this execstart command: |
It's about data separation, each tenant has a different database, both in mongo and postgres.
Met a girl in Madrid back in 1992. Moved there in 1995.
So, by default, the broker doesn't use tenants ( So, where on earth is the data? Start the broker with another troe password, or user or IP ... That is step 01. Step 02, I'll implement something ugly, just for you and just for debugging. Not sure exactly what, we'll see. |
What postgres database are you on? |
Thanks for the feedback. Ok, I get about the tenants. I see that in orionLD is storing data in mongo but not historical data. Its using the same collection as orionNGSI as it was already setup previously. Oh that's interesting. That's been a long time - I'm sure you still visit Sweden! I just did a quick log/error check by giving the incorrect password and both Orion and Crate logged it. But nothing is logged when there is an issue with sql statement. I'll restart the service with tenants and play with that. |
CrateDB uses schemas, instead of databases, the default schema is DOC, so maybe I'll have to create a schema as 'orion;
These are the schemas present: |
ok, perhaps this explains everything.
Good to hear that "other errors" are logged. At least now we know the broker is actually contacting the db. With some luck you can fix things with those schemas. |
Ok I managed to create a schema, these are automatically created when a table is created:
+---------------------------------------------------------------------+---------------+--------+-------------------------------------------------+---------------------------------------------------------------+ Now, I am unable to create the attributes table as this field definition is not supported: In our use case the only field we will need from the above is the geoPoint, which I believe is a combination of latitude and longitude. however there is no geography data type in crate, but there is GEO_POINT which takes lat and log as an array, do you think this will work? Thank you once again for your help. |
Oops, that's not good ...While I of course could implement an exception here (not sure when I'd ever have time for a thing like that), it's not only the broker involved. I explain: I'd strongly recommend you forget about CrateDB for this and install a normal postgres instead. |
Ok thanks for the heads up Ken! That's disappointing but its better to know that crateDB may not work. I'll scrap it and go along with postgres. |
I've installed postgres, with postgis and timescaledb. Now temporal values are being stored in postgres- that's great. Still, I'm not sure how do I query temporal values? Does mintaka needs to be installed as well? I do not see any instructions here: https://github.com/FIWARE/context.Orion-LD/blob/develop/doc/manuals-ld/installation-guide-ubuntu-22.04.md |
Yes, you need to install Mintaka as well . |
Thanks Ken! I'll work on that. |
Hi @kzangeli `https://github.com/FIWARE/mintaka/blob/main/docker/Dockerfile
mvn -version
Now I get the error: | / () ___ _ __ ___ _ __ __ _ _ | | 08:04:41.213 [main] WARN i.m.context.DefaultBeanContext - The bean created event listener io.micronaut.transaction.jdbc.TransactionAwareDataSource will not be executed because one or more other bean created event listeners inject javax.sql.DataSource: Message: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry] Message: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry] Message: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry] Note: when I was compiling the project, I set the mvn version to |
Hello
I followed this guide to install Orion LD: doc/manuals-ld/installation-guide-ubuntu-22.04.md
I am using Mongo 7.0 and I installed mongo-c-driver-1.24.3 instead of mongo-c-driver-1.22 as mentioned in the documentation.
However, when I run orionld -fg, I get this error:
time=Wednesday 05 Jun 10:16:00 2024.829Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongocInit.cpp[300]:mongocInit | msg=Connecting to mongo for the C driver (URI: mongodb://localhost/) time=Wednesday 05 Jun 10:16:00 2024.858Z | lvl=TMP | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongoConnectionPool.cpp[313]:mongoConnectionPoolInit | msg=Connecting to mongo for the C++ legacy driver time=Wednesday 05 Jun 10:16:00 2024.871Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongoSubCache.cpp[596]:mongoSubCacheRefresh | msg=Runtime Error (exception in nextSafe(): nextSafe(): { $err: "OP_QUERY is no longer supported. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal", code: 5739101, ok: 0.0 } at mongoSubCacheRefresh:594 - query: {}) terminate called after throwing an instance of 'mongo::UserException' what(): nextSafe(): { $err: "OP_QUERY is no longer supported. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal", code: 5739101, ok: 0.0 } Aborted
My question is that if I update the driver to 1.27 will this work, or is mongo C driver 1.27 supported by Orion NGSI LD?
Thanks
The text was updated successfully, but these errors were encountered: