Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 935689 Details for
Bug 1072415
pcs GUI should support creating dual-ring clusters (RRP)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed fix 2/2
0002-Add-RRP-support-to-GUI.patch (text/plain), 15.56 KB, created by
Tomas Jelinek
on 2014-09-09 13:10:27 UTC
(
hide
)
Description:
proposed fix 2/2
Filename:
MIME Type:
Creator:
Tomas Jelinek
Created:
2014-09-09 13:10:27 UTC
Size:
15.56 KB
patch
obsolete
>From 9f2d96d91c47072501d84533431432f284ec91bd Mon Sep 17 00:00:00 2001 >From: Tomas Jelinek <tojeline@redhat.com> >Date: Tue, 9 Sep 2014 14:49:06 +0200 >Subject: [PATCH 2/2] Add RRP support to GUI > >--- > pcs/utils.py | 2 +- > pcsd/pcsd.rb | 8 ++++- > pcsd/public/js/nodes-ember.js | 8 +++++ > pcsd/public/js/pcsd.js | 63 +++++++++++++++++++++++++++++++- > pcsd/remote.rb | 42 ++++++++++++++++++++-- > pcsd/views/manage.erb | 84 ++++++++++++++++++++++++++++++++++++++++--- > pcsd/views/nodes.erb | 6 ++++ > 7 files changed, 204 insertions(+), 9 deletions(-) > >diff --git a/pcs/utils.py b/pcs/utils.py >index 7df43f8..6f0bdc0 100644 >--- a/pcs/utils.py >+++ b/pcs/utils.py >@@ -388,7 +388,7 @@ def getCorosyncActiveNodes(): > if retval != 0: > return [] > >- nodename_re = re.compile(r"^nodelist\.node\.(\d+)\.ring\d+_addr.*= (.*)", re.M) >+ nodename_re = re.compile(r"^nodelist\.node\.(\d+)\.ring0_addr.*= (.*)", re.M) > nodestatus_re = re.compile(r"^runtime\.totem\.pg\.mrp\.srp\.members\.(\d+).status.*= (.*)", re.M) > nodenameid_mapping_re = re.compile(r"nodelist\.node\.(\d+)\.nodeid.*= (\d+)", re.M) > >diff --git a/pcsd/pcsd.rb b/pcsd/pcsd.rb >index 756ab8e..2594688 100644 >--- a/pcsd/pcsd.rb >+++ b/pcsd/pcsd.rb >@@ -413,10 +413,16 @@ if not DISABLE_GUI > @manage = true > @cluster_name = params[:clustername] > @nodes = [] >+ @nodes_rrp = [] > options = {} > params.each {|k,v| > if k.start_with?("node-") and v != "" > @nodes << v >+ if params.has_key?("ring1-" + k) and params["ring1-" + k] != "" >+ @nodes_rrp << v + "," + params["ring1-" + k] >+ else >+ @nodes_rrp << v >+ end > end > if k.start_with?("config-") and v != "" > options[k.sub("config-","")] = v >@@ -437,7 +443,7 @@ if not DISABLE_GUI > } > > $logger.info("Sending setup cluster request for: " + @cluster_name + " to: " + @nodes[0]) >- code,out = send_request_with_token(@nodes[0], "setup_cluster", true, {:clustername => @cluster_name, :nodes => @nodes.join(','), :options => options.to_json}) >+ code,out = send_request_with_token(@nodes[0], "setup_cluster", true, {:clustername => @cluster_name, :nodes => @nodes_rrp.join(';'), :options => options.to_json}) > > if code == 200 > pcs_config.clusters << Cluster.new(@cluster_name, @nodes) >diff --git a/pcsd/public/js/nodes-ember.js b/pcsd/public/js/nodes-ember.js >index 7297db7..8922b97 100644 >--- a/pcsd/public/js/nodes-ember.js >+++ b/pcsd/public/js/nodes-ember.js >@@ -59,6 +59,14 @@ Pcs = Ember.Application.createWithMixins({ > Pcs.nodesController.update(data); > Pcs.settingsController.update(data); > Pcs.set("cluster_settings",data[Object.keys(data)[0]].cluster_settings); >+ Pcs.set('need_ring1_address', false) >+ $.each(data, function(node, node_data) { >+ $.each(node_data, function(key, value) { >+ if (key == 'need_ring1_address' && value) { >+ Pcs.set('need_ring1_address', true); >+ } >+ }); >+ }); > Ember.run.next(this,disable_checkbox_clicks); > if (first_run) { > Ember.run.next(this,function () { >diff --git a/pcsd/public/js/pcsd.js b/pcsd/public/js/pcsd.js >index d67d2bc..d016557 100644 >--- a/pcsd/public/js/pcsd.js >+++ b/pcsd/public/js/pcsd.js >@@ -605,6 +605,9 @@ function update_create_cluster_dialog(nodes) { > var cant_connect_nodes = 0; > var cant_auth_nodes = 0; > var good_nodes = 0; >+ var addr1_match = 1; >+ var ring0_nodes = []; >+ var ring1_nodes = []; > var cluster_name = $('input[name^="clustername"]').val() > $('#create_new_cluster input[name^="node-"]').each(function() { > if ($(this).val() == "") { >@@ -628,6 +631,33 @@ function update_create_cluster_dialog(nodes) { > } > } > }); >+ >+ if ($("#create_new_cluster select[name='config-transport']").val() == "udpu") { >+ $('#create_new_cluster input[name^="node-"]').each(function() { >+ if ($(this).val().trim() != "") { >+ ring0_nodes.push($(this).attr("name")); >+ } >+ }); >+ $('#create_new_cluster input[name^="ring1-node-"]').each(function() { >+ if ($(this).val().trim() != "") { >+ ring1_nodes.push($(this).attr("name").substr("ring1-".length)); >+ } >+ }); >+ if (ring1_nodes.length > 0) { >+ if (ring0_nodes.length != ring1_nodes.length) { >+ addr1_match = 0 >+ } >+ else { >+ for (var i = 0; i < ring0_nodes.length; i++) { >+ if (ring0_nodes[i] != ring1_nodes[i]) { >+ addr1_match = 0; >+ break; >+ } >+ } >+ } >+ } >+ } >+ > if (cant_connect_nodes != 0 || cant_auth_nodes != 0) { > $("#unable_to_connect_error_msg").show(); > } else { >@@ -646,8 +676,14 @@ function update_create_cluster_dialog(nodes) { > $("#bad_cluster_name_error_msg").hide(); > } > >+ if (addr1_match == 0) { >+ $("#addr0_addr1_mismatch_error_msg").show(); >+ } >+ else { >+ $("#addr0_addr1_mismatch_error_msg").hide(); >+ } > >- if (good_nodes != 0 && cant_connect_nodes == 0 && cant_auth_nodes == 0 && cluster_name != "") { >+ if (good_nodes != 0 && cant_connect_nodes == 0 && cant_auth_nodes == 0 && cluster_name != "" && addr1_match == 1) { > $('#create_new_cluster_form').submit(); > } > >@@ -678,17 +714,42 @@ function create_cluster_dialog() { > > function create_cluster_add_nodes() { > node_list = $("#create_new_cluster_form tr").has("input[name^='node-']");; >+ var ring1_node_list = $("#create_new_cluster_form tr").has( >+ "input[name^='ring1-node-']" >+ ); > cur_num_nodes = node_list.length; >+ > first_node = node_list.eq(0); > new_node = first_node.clone(); > $("input",new_node).attr("name", "node-"+(cur_num_nodes+1)); > $("input",new_node).val(""); > $("td", new_node).first().text("Node " + (cur_num_nodes+1)+ ":"); > new_node.insertAfter(node_list.last()); >+ >+ var ring1_first_node = ring1_node_list.eq(0); >+ var ring1_new_node = ring1_first_node.clone(); >+ $("input", ring1_new_node).attr("name", "ring1-node-" + (cur_num_nodes + 1)); >+ $("input", ring1_new_node).val(""); >+ $("td", ring1_new_node).first().text( >+ "Node " + (cur_num_nodes+1) + " (Ring 1):" >+ ); >+ ring1_new_node.insertAfter(ring1_node_list.last()); >+ > if (node_list.length == 7) > $("#create_new_cluster_form tr").has("input[name^='node-']").last().next().remove(); > } > >+function create_cluster_display_rrp(transport) { >+ if(transport == 'udp') { >+ $('#rrp_udp_transport').show(); >+ $('#rrp_udpu_transport').hide(); >+ } >+ else { >+ $('#rrp_udp_transport').hide(); >+ $('#rrp_udpu_transport').show(); >+ }; >+} >+ > function show_hide_constraints(element) { > //$(element).parent().siblings().each (function(index,element) { > $(element).parent().nextUntil(".stop").toggle(); >diff --git a/pcsd/remote.rb b/pcsd/remote.rb >index 3e7ef01..4ebdc80 100644 >--- a/pcsd/remote.rb >+++ b/pcsd/remote.rb >@@ -378,9 +378,11 @@ end > > def setup_cluster(params) > $logger.info("Setting up cluster: " + params.inspect) >- nodes = params[:nodes].split(',') >+ nodes_rrp = params[:nodes].split(';') > options = [] > myoptions = JSON.parse(params[:options]) >+ transport_udp = false >+ options_udp = [] > myoptions.each { |o,v| > if ["wait_for_all", "last_man_standing", "auto_tie_breaker"].include?(o) > options << "--" + o + "=1" >@@ -392,13 +394,29 @@ def setup_cluster(params) > > if o == "transport" and v == "udp" > options << "--transport=udp" >+ transport_udp = true >+ end >+ >+ if ["addr0", "addr1", "mcast0", "mcast1", "mcastport0", "mcastport1", "ttl0", "ttl1"].include?(o) >+ options_udp << "--" + o + "=" + v >+ end >+ >+ if ["broadcast0", "broadcast1"].include?(o) >+ options_udp << "--" + o > end > > if o == "ipv6" > options << "--ipv6" > end > } >+ if transport_udp >+ nodes = [] >+ nodes_rrp.each { |node| nodes << node.split(',')[0] } >+ else >+ nodes = nodes_rrp >+ end > nodes_options = nodes + options >+ nodes_options += options_udp if transport_udp > stdout, stderr, retval = run_cmd(PCS, "cluster", "setup", "--enable", "--start", "--name",params[:clustername], *nodes_options) > if retval != 0 > return [400, stdout.join("\n") + stderr.join("\n")] >@@ -497,7 +515,9 @@ def node_status(params) > "pacemaker_standby" => pacemaker_standby, > "cluster_name" => $cluster_name, "resources" => out_rl, "groups" => group_list, > "constraints" => constraints, "cluster_settings" => cluster_settings, "node_id" => node_id, >- "node_attr" => node_attributes} >+ "node_attr" => node_attributes, >+ "need_ring1_address" => need_ring1_address?, >+ } > ret = JSON.generate(status) > return ret > end >@@ -1035,3 +1055,21 @@ def get_local_node_id > return out[0].split(/ = /)[1].strip() > end > end >+ >+def need_ring1_address? >+ out, errout, retval = run_cmd(COROSYNC_CMAPCTL) >+ if retval != 0 >+ return false >+ else >+ udpu_transport = false >+ rrp = false >+ out.each { |line| >+ if /^totem\.transport.*= udpu$/.match(line) >+ udpu_transport = true >+ elsif /^totem\.rrp_mode.*= passive$/.match(line) or /^totem\.rrp_mode.*= active$/.match(line) >+ rrp = true >+ end >+ } >+ return (rrp and udpu_transport) >+ end >+end >diff --git a/pcsd/views/manage.erb b/pcsd/views/manage.erb >index 5291b98..5089732 100644 >--- a/pcsd/views/manage.erb >+++ b/pcsd/views/manage.erb >@@ -96,6 +96,7 @@ > <tr><td align=center style="color: red" colspan=2"><span id="unable_to_connect_error_msg" style="display:none;">Unable to contact nodes highlighted in red.<br><span style="color:orange;">Unable to authenticate to nodes highlighted in orange.</span><br>Please make sure pcsd is started on all nodes.</span></td></tr> > <tr><td align=center style="color: red" colspan=2"><span id="at_least_one_node_error_msg" style="display:none;">At least one valid node must be entered.</span></td></tr> > <tr><td align=center style="color: red" colspan=2"><span id="bad_cluster_name_error_msg" style="display:none;">You may not leave the cluster name field blank</span></td></tr> >+ <tr><td align=center style="color: red" colspan=2"><span id="addr0_addr1_mismatch_error_msg" style="display:none;">Ring 1 addresses do not match to Ring 0 addresses</span></td></tr> > </table> > <span onclick='$(".advanced_open").toggle();$("#advanced_cluster_create_options").toggle();'><span class="advanced_open rightarrow sprites"></span><span class="advanced_open downarrow sprites" style="display:none;"></span>Advanced Options:</span> > <div id="advanced_cluster_create_options" style="display:none;"> >@@ -161,16 +162,91 @@ The window of time between when a node (or group of nodes die) and quorum \ > is recalculated if the 'Last Man Standing' option is enabled." %> > <% use_ipv6_desc = "\ > Enables IPv6 for cluster communication (default: off)" %> >- <tr> >- <td title="<%= h(transport_desc) %>" align=right>Transport:</td> >- <td><select name="config-transport"><option value="udpu" selected>UDPU (default)</option><option value="udp">UDP</option></select></td> >- </tr> >+ <% rrp_addr_0_1_desc = "\ >+Enables Redundant Ring Protocol (RRP) (default: off) >+ >+Specify ring 0 and ring 1 network address if you want to use RRP." %> >+ <% rrp_broadcast_0_1_desc = "\ >+Enables broadcast communication in the ring (default: off)" %> >+ <% rrp_mcast_0_1_desc = "\ >+Optionally specify ring multicast address." %> >+ <% rrp_mcastport_0_1_desc = "\ >+Optionally specify ring multicast port." %> >+ <% rrp_ttl_0_1_desc = "\ >+Optionally specify ring TTL." %> >+ <% rrp_addr1_desc = "\ >+Enables Redundant Ring Protocol (RRP) (default: off) >+ >+Specify ring 1 address for each node if you want to use RRP." %> >+ <tr> >+ <td title="<%= h(transport_desc) %>" align=right>Transport:</td> >+ <td> >+ <select name="config-transport" onchange="create_cluster_display_rrp(this.value);"> >+ <option value="udpu" selected>UDPU (default)</option> >+ <option value="udp">UDP</option> >+ </select> >+ </td> >+ </tr> > <tr title="<%= h(wait_for_all_desc) %>"><td align=right>Wait for All:</td><td><input type=checkbox name="config-wait_for_all"></td></tr> > <tr title="<%= h(auto_tie_desc) %>"><td align=right>Auto Tie Breaker:</td><td><input type=checkbox name="config-auto_tie_breaker"></td></tr> > <tr title="<%= h(last_man_desc) %>"><td align=right>Last Man Standing:</td><td><input type=checkbox name="config-last_man_standing"></td></tr> > <tr title="<%= h(last_man_window_desc) %>"><td align=right>Last Man Standing Window:</td><td><input type=input size=5 name="config-last_man_standing_window" value=10000>ms</td></tr> > <tr title="<%= h(use_ipv6_desc) %>"><td align=right>Use IPv6</td><td><input type=checkbox name="config-ipv6"></td></tr> > </table> >+ <div id="rrp_udp_transport" style="display: none;"> >+ <br> >+ Redundant Ring Protocol settings for UDP transport: >+ <table> >+ <tr> >+ <td></td> >+ <td align="center">Ring 0</td> >+ <td align="center">Ring 1</td> >+ </tr> >+ <tr title="<%= h(rrp_addr_0_1_desc) %>"> >+ <td align="right">Address:</td> >+ <td><input type="text"name="config-addr0"></td> >+ <td><input type="text"name="config-addr1"></td> >+ </tr> >+ <tr title="<%= h(rrp_broadcast_0_1_desc) %>"> >+ <td align="right">Use Broadcast:</td> >+ <td><input type="checkbox"name="config-broadcast0"></td> >+ <td><input type="checkbox"name="config-broadcast1"></td> >+ </tr> >+ <tr title="<%= h(rrp_mcast_0_1_desc) %>" class="transport_udp_only"> >+ <td align="right">Multicast Address:</td> >+ <td><input type="text"name="config-mcast0" value="239.255.1.1"></td> >+ <td><input type="text"name="config-mcast1" value="239.255.2.1"></td> >+ </tr> >+ <tr title="<%= h(rrp_mcastport_0_1_desc) %>" class="transport_udp_only"> >+ <td align="right">Multicast Port:</td> >+ <td><input type="text"name="config-mcastport0" value="5405"></td> >+ <td><input type="text"name="config-mcastport1" value="5405"></td> >+ </tr> >+ <tr title="<%= h(rrp_ttl_0_1_desc) %>" class="transport_udp_only"> >+ <td align="right">TTL:</td> >+ <td><input type="text"name="config-ttl0"></td> >+ <td><input type="text"name="config-ttl1"></td> >+ </tr> >+ </table> >+ </div> >+ <div id="rrp_udpu_transport"> >+ <br> >+ Redundant Ring Protocol settings for UDPU transport: >+ <table title="<%= h(rrp_addr1_desc) %>"> >+ <tr> >+ <td align=right>Node 1 (Ring 1):</td> >+ <td><input size="50" name="ring1-node-1" type="text"></input></td> >+ </tr> >+ <tr> >+ <td align=right>Node 2 (Ring 1):</td> >+ <td><input size="50" name="ring1-node-2" type="text"></input></td> >+ </tr> >+ <tr> >+ <td align=right>Node 3 (Ring 1):</td> >+ <td><input size="50" name="ring1-node-3" type="text"></input></td> >+ </tr> >+ </table> >+ </div> > </div> > </form> > </div> >diff --git a/pcsd/views/nodes.erb b/pcsd/views/nodes.erb >index 8fc8c91..78afd73 100644 >--- a/pcsd/views/nodes.erb >+++ b/pcsd/views/nodes.erb >@@ -257,6 +257,12 @@ > <td>Node Name:</td> > <td><input type=text name=new_nodename></td> > </tr> >+ {{#if Pcs.need_ring1_address}} >+ <tr> >+ <td>Ring1 address:</td> >+ <td><input type=text name=new_ring1addr></td> >+ </tr> >+ {{/if}} > <tr> > <td>Auto Start/Enable:</td> > <td><input type="checkbox" name="auto_start" value="1" checked></td> >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1072415
:
935688
| 935689 |
940740