Skip to content

Commit

Permalink
Merge pull request #124 from redBorder/bugfix/17120_cluster_is_not_ac…
Browse files Browse the repository at this point in the history
…ting_as_cluster

Druid realtime is not acting as a cluster because shardSpec partition is not correctly set
  • Loading branch information
manegron authored Apr 30, 2024
2 parents d96fe06 + 374d25d commit 4a4d6dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
default["redborder"]["druid"]["historical"]["tier"] = "default"
default["redborder"]["druid"]["historical"]["maxsize"] = -1

# Realtime
default["redborder"]["druid"]["realtime"]["partition_num"] = 0

default["redborder"]["pending_changes"]=0
2 changes: 2 additions & 0 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
druid_realtime "Configure Druid Realtime" do
name node["hostname"]
ipaddress node["ipaddress_sync"]
zookeeper_hosts node["redborder"]["zookeeper"]["zk_hosts"]
partition_num node["redborder"]["druid"]["realtime"]["partition_num"]
memory_kb node["redborder"]["memory_services"]["druid-realtime"]["memory"]
action (manager_services["druid-realtime"] ? [:add, :register] : [:remove, :deregister])
end
Expand Down
5 changes: 5 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
node.default["redborder"]["kafka"]["host_index"] = node["redborder"]["managers_per_services"]["kafka"].index(node.name)
end

#set druid realtime partition id (its needed in cluster mode for druid brokers)
if node["redborder"]["managers_per_services"]["druid-realtime"].include?(node.name)
node.default["redborder"]["druid"]["realtime"]["partition_num"] = node["redborder"]["managers_per_services"]["druid-realtime"].index(node.name)
end

#get an array of managers
managers_list = []
node["redborder"]["cluster_info"].each_key do |mgr|
Expand Down

0 comments on commit 4a4d6dc

Please sign in to comment.