zooker-util issue
i am downloading zooker-util in this url https://github.com/sroegner/zookeeper-util
when i run zkutil i got this exception
Cannot find the jruby distribution in /usr/share/java/zookeeper-util
Is there any solution for this issue
There is - the error message is now different (shows the correct path where jruby is missing) and the error also now includes the hint for you to download the jruby-complete-*jar from jruby.org.
Let me know if that works for you.
I used like this ./zkutil dump -c localhost:2181 > first.txt dump is working perfectly and the data is stored in first.txt file.
Then i delete the entire data in zookeeper using ./zkutil purge -c localhost:2181 purge is also working fine.
i import the data using above file ./zkutil import -c localhost:2181 -f first.txt
first.txt
/bss/msv/logManagement/config/nodes/vmx0562/logMgmtXML:: djnetrtrte ertretre tertretre
suppose in first.txt file data having more than 1 line, 2nd&3rd lines are not imported in zookeeper and i got the following exception
java.lang.IllegalArgumentException: Path must start with / character
org/apache/zookeeper/common/PathUtils.java:99:in validatePath': java.lang.IllegalArgumentException: Invalid path string "/outputPathtvar/log/ngee/pm/reportstdefaultReportert0com.ericsson.caf.pm.reporter.AggregationReportertjavaCafPmConfigIdt1tcounterFileLoaderIntervalsrjava.lang.Integer⠤���8Ivaluexrjava.lang.Number��� ���xpu0tcounterFilePatht/opt/ngee/latest/base/conf" caused by null character not allowed @12 (NativeException) from org/apache/zookeeper/ZooKeeper.java:788:inexists'
from org/apache/zookeeper/ZooKeeper.java:837:in exists' from /usr/share/zookeeper-util-master/usr/share/zookeeper-util/bin/zookeeper.rb:23:inpath_exists?'
from /usr/share/zookeeper-util-master/usr/share/zookeeper-util/bin/zookeeper.rb:31:in create_path' from /usr/share/zookeeper-util-master/usr/share/zookeeper-util/bin/zk_import.rb:71 from /usr/share/zookeeper-util-master/usr/share/zookeeper-util/bin/zk_import.rb:63:ineach_line'
from /usr/share/zookeeper-util-master/usr/share/zookeeper-util/bin/zk_import.rb:63
[root@vmx0562 bin]# PuTTY
This is main problem suppose in first.txt file data having more than 1 line, 2nd&3rd lines are not imported in zookeeper eg: /bss/msv/logManagement/config/nodes/vmx0562/logMgmtXML:: djnetrtrte ertretre tertretre
only 1st line is imported in zookeeper.
please suggest any solution for the above problem
I can see how you perceive this as a problem (especially with the dump being produced by the same tool). But i don't see a meaningful way of importing multi-line dumps - they are not supported. The reason you end up with this is as far as i can tell the fact that you have binary data in there. This tool does not support a case like that (which would take proper serialization) - only very plain text key-value pairs.
This project also is only here for reference - I haven't worked on this in years. Maybe you want to look at https://github.com/netflix/curator for a better tool.
Sorry Steffen
our data is not a binary data. but the data having multiple lines. can you please explain each line in the below. This is import.rb file File.new(options[:filename]).each_line do |line| next if line =~ /^\s*#/ next if line.empty?
line.chomp!
a = line.split(colsep)
if(a.size == 1)
puts "# Creating path #{a[0]}" if options[:verbose]
zk.create_path(a[0].chomp)
elsif(a.size == 2)
puts "# Writing data '#{a[1]}' to Path #{a[0]}" if options[:verbose]
zk.set_data(a[0].chomp, a[1].chomp)
else
puts "#{line} is broken"
end
end
The code reads through the dump, creates a path if there is only a path, writes to a path if there is a path, a separator and data, otherwise bails out with an error (which is what you see). Please understand that the feature you are looking for was deliberately omitted in favor of simplicity.