kevinjmao / python-zktreeutil Goto Github PK
View Code? Open in Web Editor NEWManage Zookeeper data in bulk.
License: GNU General Public License v3.0
Manage Zookeeper data in bulk.
License: GNU General Public License v3.0
It appears that there is bug with utf-8 data.
maybe related to : apache/zookeeper#586
command run
sudo python zktreeutil.py --import --file exported.json example.domain:2181/
root@nodename:/opt/zktreeutil$ python --version
Python 2.7.6
Traceback (most recent call last):
File "zktreeutil.py", line 270, in <module>
main()
File "zktreeutil.py", line 266, in main
util.run()
File "zktreeutil.py", line 249, in run
self.run_import(source_file, dest_zk, dest_zk_path, resolve)
File "zktreeutil.py", line 215, in run_import
znode = ZNode(path, znode_val['stat'], str(znode_val['data']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 949: ordinal not in range(128)
e.g.
For a given zookeeper instance, below is what I want to do - copy all the data and folders from source nodename1
to destination newnodename
Source = '\Windows\nodename1`
and the source has various folders beneath it like
\Windows\nodename1\config
\Windows\nodename1\config\manifest
\Windows\nodename1\config2
\Windows\nodename1\filelist
\Windows\nodename1\filelist\destination
destination = '\Windows\newnodename`
Current --copy
command will copy as \destination\source\
and this gets pretty annoying .. the end result will be
\Windows\newnodename\Windows\nodename1\config
\Windows\newnodename\Windows\nodename1\config\manifest
\Windows\newnodename\Windows\nodename1\config2
\Windows\newnodename\Windows\nodename1\filelist
\Windows\newnodename\Windows\nodename1\filelist\destination
vs the expected result should be
\Windows\newnodename\config
\Windows\newnodename\config\manifest
\Windows\newnodename\config2
\Windows\newnodename\filelist
\Windows\newnodename\filelist\destination
This will allow to copy configs from one node (old) to new node and create same folder structure as the OLD node beneath the NEW Node.
Appreciate your help !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.