Below is a tool that was supposed to be productize. This is written by Ajay Hampapur who is main architect of the API server and all DB schema. Any thing you do, I would recommend you start with this. This a consistency checker for data within (ZK, IFMAP, Cassandra).
Consistency checker https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/db_manage.py <https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/db_manage.py> Test below exercises the script above and can be used as reference how to use. https://github.com/Juniper/contrail-controller/blob/312c7655e7384263694ff0749411a8ef59bee9af/src/config/api-server/tests/test_crud_basic.py#L3497 <https://github.com/Juniper/contrail-controller/blob/312c7655e7384263694ff0749411a8ef59bee9af/src/config/api-server/tests/test_crud_basic.py#L3497> Cassandra JSON dump and import https://github.com/Juniper/contrail-controller/blob/master/src/config/common/db_json_exim.py <https://github.com/Juniper/contrail-controller/blob/master/src/config/common/db_json_exim.py> Test below tests above https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/tests/test_crud_basic.py#L4552 <https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/tests/test_crud_basic.py#L4552> I would prefer people to use above to further build any tools. Since it is most authentic knowledge about contrail databases. Regards -Harshad > On Oct 27, 2017, at 8:54 AM, Nabeel Asim <[email protected]> wrote: > > Hi Jean, > > Is the tool dependent on any specific Contrail version? > > > Regards > > -----Original Message----- > From: Dev [mailto:[email protected]] On Behalf Of > Jean-Philippe Braun > Sent: Friday, October 27, 2017 11:42 AM > To: [email protected] > Cc: [email protected] > Subject: Re: [opencontrail-dev] contrail-gremlin a set of tools to check > contrail DB consistency > > Thanks for trying out the tool, > > From my understanding the dump wasn't properly generated, if you have the > possibility of sharing me the dump file I could have a look at it. > > Since your are running the docker image, you can find the dump.json file from > the mountpoint in the host system, something like: > /var/lib/docker/devicemapper/mnt/8e791d0973b92ab926675831ef08eeb68ed3d8cb66741e5c28f668f38e1e0e3c/rootfs/srv/apache-tinkerpop-gremlin-console/ > > If not, it means that two different edges with the same id were created, its > something that shouldn't happen. You can open the dump with a text editor and > look for that particular id and see to which resources theses edges refers > to. It might reflect an issue in the contrail DB. > > I've never encounter this kind of issue on our platforms though. > > JP > > Le Friday 27 Oct 2017 à 20:03:44 (+0500), [email protected] a écrit : >> Hello! >> >> Thank you for the tools! >> >> Trying to run contrail-fsck on a test db, get an error: >> "Error in checks.groovy at [8: >> g.io(graphson()).readGraph(graphFilename);] - Edge with id already exists: >> 1694" >> >> What further steps would you recommend for troubleshooting? >> >> >> 18.10.2017, 23:07, "Illia Polliul" <[email protected]>: >> >> That utility looks very helpful! I’ll definitely check it, it can be a >> life-saver at certain moments. >> My appreciation for all contrail-api-cli stuff >> >> Best regards, >> Illia Polliul >> Sr. Deployment Engineer | Mirantis, Inc. >> Skype: ilya_pollul >> >> >> On Oct 17, 2017, at 1:02 PM, Jean-Philippe Braun <[email protected]> >> wrote: >> >> Hi all, >> >> Since several months @cloudwatt we worked on some tools to be able to >> check the consistency of our contrail config DB on our different >> platforms. >> >> As you know the contrail data model is a graph with resources >> connected >> to each others with parent or ref links so it felt natural to use a >> graph db to process the config DB. We choose the tinkerpop stack[1] >> that >> provide a language to traverse graphs: gremlin. >> >> You will find the different tools we worked on the repo >> https://github.com/eonpatapon/contrail-gremlin. >> >> We also provide a simple to use docker image to run the consistency >> checks[2] we have. It's a good entrypoint to discover the project. >> More >> info at: https://github.com/eonpatapon/contrail-gremlin/tree/master/ >> docker. >> >> If you have any comments or feedback, don't hesitate >> >> Thanks >> >> Jean-Philippe >> >> [1] http://tinkerpop.apache.org/ >> [2] https://github.com/eonpatapon/contrail-gremlin/blob/master/ >> gremlin-checks/checks.groovy >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://lists.opencontrail.org/mailman/listinfo/ >> dev_lists.opencontrail.org >> >> >> , >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> >> http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org >> > > > _______________________________________________ > Dev mailing list > [email protected] > http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org
_______________________________________________ Dev mailing list [email protected] http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org
