It is possible to restore document in solr usinf tlog file

北战南征 提交于 2020-03-04 18:41:48

问题


Every time when i add/update document in solr , tlog file maintains the request query for each commit.

example: when i commit using update command:

curl -XPOST -H 'Content-Type: application/json' 'http://localhost:8983/solr/sample_list/update' --data-binary '{"add":{"doc":{ "id":"7","name":"test dfasdata jan565765"}},"commit":{}}'

tlog file content look likes:

^B
^B)SOLR_TLOGA'strings<83>"id$name)version^@^@^@)<83>A^G^VYîÖ·^@^@^@^P^C^H?<80>^@^@á!7â7test dfasdata jan565765ã^G^VYîÖ·^@^@^@^@^@^@8<83>D`-SOLR_TLOG_END^@^@^@^Q

It is possible to execute the request query in tlog file for recovery purpose which is not in readable format?


回答1:


i also got the same problem, i found a solution (workaround): open your tlog file and remove at the end of the file "ƒD`-SOLR_TLOG_END " then start your solr the content of the tlog file is indexed/commitet to the index. In my testcase i only hat one tlog file in the folder.

To find out the chars which you should delete just add in the admin webinterface under "Documents" a example document with "commit within" 100000 value afer that stop immediately the solr. It is important that you stop the solr before solr does the commit (commit within time should be high). Then copy the new tlog file on your desktop or an other folder. Start the solr again and compare the two files, then you will see after the tlog is added to the index solr appends the "ƒD`-SOLR_TLOG_END " string.

short information: tlog is used to add documents to the index if the solr goes down without the commit. if the solr gets up again the tlog is used to add the not committed documents to the index.

regards Madde



来源:https://stackoverflow.com/questions/52160945/it-is-possible-to-restore-document-in-solr-usinf-tlog-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!