NEWS
History: Migration von File zu MySQL mit Daten-Mitnahme möglich?
-
Danke, ich bin inzwischen ein bisschen weiter aber doch nicht erfolgreich.
Hab inzwischen herausgefunden das ich die instanz history.0 beenden muss damit es funktioniert.
Aber: Sobald ich das ganze starte mit
nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPsbekomme ich folgende Fehlermeldung und der SQL Adapter startet sich neu:
host.raspberrypi 2018-01-21 10:53:58.512 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-01-21 10:53:58.505 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) sql.0 2018-01-21 10:53:42.969 error Error: connect EMFILE 10.0.0.130:3307 - Local (undefined:undefined) -
Also an sich kann history.0 nebenher laufen. Sollte nicht stören.
Den Fehler von sql kenne ich nicht, sieht mir aber nach was andere aus: https://stackoverflow.com/questions/103 … in-node-js Schau mal eher warum sql.0 solche Probleme macht ...
Wegen dem anderen Fehler schaue ich noch
-
Hallo,
entschuldige das ich mich erst so spät wieder melde, aber ich war gerade beruflich ziemlich beschäftigt.
Leider kann ich die sql-Version von github nicht installieren, bekomme immer folgende Fehler:
$ ./iobroker url "https://github.com/ioBroker/ioBroker.sql" install https://github.com/ioBroker/ioBroker.sql/tarball/master npm install https://github.com/ioBroker/ioBroker.sql/tarball/master --production --save --prefix "/opt/iobroker" (System call) npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js. node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@4.8.4 (node-v46 ABI) (falling back to source compile with node-gyp) -
Hm ich hab jetzt den adapter aktualisert. Wenn ich nun
nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPsstarte fängt er auch an
root@raspberrypi:/opt/iobroker/node_modules/iobroker.history/converter# nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPs Send Data to sql.0 Start at 20180120 Use historyDir /mnt/history Use Delay multiplicator 2 Log changes only once per 60 minutes EarliesDBValues initialized from cache 21 ExistingDBTypes initialized from cache 21 started processFiles with 21 known db values We start earliest at 20180120 Day 20180120 - history.hm-rega.0.11818.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11819.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11820.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11821.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11822.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11823.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11824.json cut filedata to 0 Day 20180120 - history.hm-rega.0.16971.json cut filedata to 0 Day 20180120 - history.hm-rega.0.16972.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2477.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2478.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2829.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2830.json cut filedata to 0 Day 20180120 - history.hm-rega.0.3650.json cut filedata to 9520 datapoints reduced from 9520 --> 9520 sorted out 0 valuesaber im ioBroker Log sehe ich folgendes:
host.raspberrypi 2018-02-10 11:53:38.228 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-02-10 11:53:38.227 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) history.0 2018-02-10 11:53:07.332 info starting. Version 1.7.2 in /opt/iobroker/node_modules/iobroker.history, node: v4.8.7Der SQL-Adapter startet also neu…
-
Hallo,
geht auch über : http://forum.iobroker.net/viewtopic.php … sql#p15757
-
Ich wollte mich auch nochmal bedanken, es funktioniert perfekt. Einziger Nachteil: ich habe eine Datensammlung von über einem Jahr und z.T. sind es über 1000 Werte pro Tag bei insgesamt ca. 25 protokollierten Objekten :lol: Zweimal ist mir jetzt die SSH Session abgeschmiert so dass ich mich jetzt entschieden habe das auf der Konsole der VM zu machen, da bricht der Task wenigstens nicht ab :)
Verursacht aber schon ganz schön Load auf der CPU so ne Konvertierung..

-
Steht auch die Meldung bzw dir exception im log?? `
Gerade nochmal probiert:
sql.0 2018-02-11 13:01:12.707 info Connected to mysql sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rpc.0.OEQ0086710.1.TEMPERATURE sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rpc.0.OEQ0086710.1.HUMIDITY sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rega.0.16972 sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rega.0.16971 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.2.CUX4000001.7.CONTROL sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.0.OEQ0023416.2.POWER sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.0.OEQ0023416.2.ENERGY_COUNTER sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11824 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11823 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11822 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11821 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11820 sql.0 2018-02-11 13:01:12.621 info enabled logging of hm-rega.0.11819 sql.0 2018-02-11 13:01:12.621 info enabled logging of hm-rega.0.11818 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.6951 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.3650 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2830 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2829 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2478 sql.0 2018-02-11 13:01:12.619 info enabled logging of hm-rega.0.2477 sql.0 2018-02-11 13:01:12.618 info enabled logging of hm-rpc.0.MEQ0690418.1.FILLING_LEVEL sql.0 2018-02-11 13:01:12.549 info starting. Version 1.6.9 in /opt/iobroker/node_modules/iobroker.sql, node: v4.8.7 host.raspberrypi 2018-02-11 13:01:09.270 info instance system.adapter.sql.0 started with pid 6276 host.raspberrypi 2018-02-11 13:00:39.238 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-02-11 13:00:39.237 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) history.0 2018-02-11 13:00:06.863 info starting. Version 1.7.2 in /opt/iobroker/node_modules/iobroker.history, node: v4.8.7 -
Klingt nach "mal Host neu starten"
-
Alternative ist: sql Adapter beenden über Admin. In /opt/iobroker folgendes an der Konsole ausführen:
node node_modules/iobroker.sql/main.js —force —logs
Damit startest du den sql Adapter manuell. Dann in zweiter Shell den Converter starten. Falls es wieder abstürzt dann solltest du ggf einen besseren Fehler bekommen.
-
So, hab den adapter jetzt neu installiert. Selber fehler cannot find module pg-negative.
Hier der Install-Log:
$ ./iobroker add sql npm install iobroker.sql --production --prefix "/opt/iobroker" (System call) npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js. node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@4.8.7 (node-v46 ABI) (falling back to source compile with node-gyp) ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)’:../src/database.cc:144:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), ^ ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)’:../src/database.cc:230:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), ^ ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)’:../src/database.cc:525:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), ^ ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)’:../src/database.cc:625:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginPrepare(node_sqlite3::Database::Baton*)’:../src/statement.cc:118:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), ^ In file included from ../src/statement.cc:6:0:../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginBind(node_sqlite3::Statement::Baton*)’: ../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:322:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(Bind); ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginGet(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:370:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(Get); ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginRun(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:438:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(Run); ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginAll(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:504:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(All); ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginEach(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:601:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(Each); ^ ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginReset(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable] int status = uv_queue_work(uv_default_loop(), \ ^ ../src/statement.cc:724:5: note: in expansion of macro ‘STATEMENT_BEGIN’ STATEMENT_BEGIN(Reset); ^ host.raspberrypi install adapter sql got /opt/iobroker/node_modules/iobroker.sql/admin upload [5] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/words.js words.js application/javascript upload [4] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/sql.png sql.png image/png upload [3] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/index_m.html index_m.html text/html upload [2] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/index.html index.html text/html upload [1] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/custom_m.html custom_m.html text/html upload [0] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/custom.html custom.html text/html host.raspberrypi object system.adapter.sql created host.raspberrypi object _design/custom created host.raspberrypi create instance sql host.raspberrypi object sql.0.info.connection created host.raspberrypi object sql.0.info created host.raspberrypi object system.adapter.sql.0.outputCount created host.raspberrypi object system.adapter.sql.0.inputCount created host.raspberrypi object system.adapter.sql.0.uptime created host.raspberrypi object system.adapter.sql.0.memRss created host.raspberrypi object system.adapter.sql.0.memHeapTotal created host.raspberrypi object system.adapter.sql.0.memHeapUsed created host.raspberrypi object system.adapter.sql.0.connected created host.raspberrypi object system.adapter.sql.0.alive created host.raspberrypi object system.adapter.sql.0 created process exited with code 0
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden