Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure webui nginx load balancer #150

Merged
merged 17 commits into from
Jun 13, 2024
1 change: 1 addition & 0 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

# webui
default['redborder']['webui']['port'] = 8001
default['redborder']['webui']['hosts'] = []

# memcached
default['redborder']['memcached']['elasticache'] = false
Expand Down
1 change: 1 addition & 0 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
end

webui_config 'Configure Nginx WebUI' do
hosts node['redborder']['webui']['hosts']
cdomain node['redborder']['cdomain']
port node['redborder']['webui']['port']
if manager_services['webui'] && manager_services['nginx']
Expand Down
10 changes: 7 additions & 3 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,19 @@
# zk_hosts = node['redborder']['managers_per_services']['zookeeper'].map {|z| '#{z}.node:#{zk_port}'}.join(',')
node.default['redborder']['zookeeper']['zk_hosts'] = "zookeeper.service.#{node['redborder']['cdomain']}:#{node['redborder']['zookeeper']['port']}"

# Set all nodes with s3 configured (nginx load balancer)
s3_hosts = node['redborder']['managers_per_services']['s3'].map { |z| "#{z}.node:9000" }
node.default['redborder']['s3']['s3_hosts'] = s3_hosts
# set webui hosts
webui_hosts = node['redborder']['managers_per_services']['webui'].map { |z| "#{z}.node" }
node.default['redborder']['webui']['hosts'] = webui_hosts

# set kafka host index if kafka is enabled in this host
if node['redborder']['managers_per_services']['kafka'].include?(node.name)
node.default['redborder']['kafka']['host_index'] = node['redborder']['managers_per_services']['kafka'].index(node.name)
end

# Set all nodes with s3 configured (nginx load balancer)
s3_hosts = node['redborder']['managers_per_services']['s3'].map { |z| "#{z}.node:9000" }
node.default['redborder']['s3']['s3_hosts'] = s3_hosts

# 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)
Expand Down
Loading