From 36f216cb7cb16958d98b3d77e121198596fd2213 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Mon, 19 Jun 2017 08:44:04 -0700 Subject: PLT-6080 moving clustering to memberlist (#6499) * PLT-6080 adding cluster discovery service * Adding memberlist lib * Adding memberlist lib * WIP * WIP * WIP * WIP * Rolling back config changes * Fixing make file * Fixing config for cluster * WIP * Fixing system console for clustering * Fixing default config * Fixing config * Fixing system console for clustering * Tweaking hub setting * Bumping up time * merging vendor dir * Updating vendor dir * Fixing unit test * Fixing bad merge * Remove some testing code * Moving comment * PLT-6868 adding db ping retry * Removing unused loc strings * Adding defer to cancel --- .../components/admin_console/cluster_settings.jsx | 160 ++++++++++++++++----- webapp/components/admin_console/cluster_table.jsx | 31 ++-- 2 files changed, 134 insertions(+), 57 deletions(-) (limited to 'webapp/components/admin_console') diff --git a/webapp/components/admin_console/cluster_settings.jsx b/webapp/components/admin_console/cluster_settings.jsx index 14bc46240..0c3346c5a 100644 --- a/webapp/components/admin_console/cluster_settings.jsx +++ b/webapp/components/admin_console/cluster_settings.jsx @@ -21,21 +21,18 @@ export default class ClusterSettings extends AdminSettings { this.getConfigFromState = this.getConfigFromState.bind(this); this.renderSettings = this.renderSettings.bind(this); + this.overrideHandleChange = this.overrideHandleChange.bind(this); } getConfigFromState(config) { - config.ClusterSettings.Enable = this.state.enable; - config.ClusterSettings.InterNodeListenAddress = this.state.interNodeListenAddress; - - config.ClusterSettings.InterNodeUrls = this.state.interNodeUrls.split(','); - config.ClusterSettings.InterNodeUrls = config.ClusterSettings.InterNodeUrls.map((url) => { - return url.trim(); - }); - - if (config.ClusterSettings.InterNodeUrls.length === 1 && config.ClusterSettings.InterNodeUrls[0] === '') { - config.ClusterSettings.InterNodeUrls = []; - } - + config.ClusterSettings.Enable = this.state.Enable; + config.ClusterSettings.ClusterName = this.state.ClusterName; + config.ClusterSettings.OverrideHostname = this.state.OverrideHostname; + config.ClusterSettings.UseIpAddress = this.state.UseIpAddress; + config.ClusterSettings.UseExperimentalGossip = this.state.UseExperimentalGossip; + config.ClusterSettings.ReadOnlyConfig = this.state.ReadOnlyConfig; + config.ClusterSettings.GossipPort = this.parseIntNonZero(this.state.GossipPort, 8074); + config.ClusterSettings.StreamingPort = this.parseIntNonZero(this.state.StreamingPort, 8075); return config; } @@ -43,9 +40,14 @@ export default class ClusterSettings extends AdminSettings { const settings = config.ClusterSettings; return { - enable: settings.Enable, - interNodeUrls: settings.InterNodeUrls.join(', '), - interNodeListenAddress: settings.InterNodeListenAddress, + Enable: settings.Enable, + ClusterName: settings.ClusterName, + OverrideHostname: settings.OverrideHostname, + UseIpAddress: settings.UseIpAddress, + UseExperimentalGossip: settings.UseExperimentalGossip, + ReadOnlyConfig: settings.ReadOnlyConfig, + GossipPort: settings.GossipPort, + StreamingPort: settings.StreamingPort, showWarning: false }; } @@ -101,7 +103,7 @@ export default class ClusterSettings extends AdminSettings { className='alert alert-warning' > - @@ -110,7 +112,7 @@ export default class ClusterSettings extends AdminSettings { } var clusterTableContainer = null; - if (this.state.enable) { + if (this.state.Enable) { clusterTableContainer = (); } @@ -121,12 +123,12 @@ export default class ClusterSettings extends AdminSettings {

{warning} } - value={this.state.enable} + value={this.state.Enable} + onChange={this.overrideHandleChange} + /> + + } + placeholder={Utils.localizeMessage('admin.cluster.ClusterNameEx', 'Ex "Production" or "Staging"')} + helpText={ + + } + value={this.state.ClusterName} + onChange={this.overrideHandleChange} + /> + + } + placeholder={Utils.localizeMessage('admin.cluster.OverrideHostnameEx', 'Ex "app-server-01"')} + helpText={ + + } + value={this.state.OverrideHostname} + onChange={this.overrideHandleChange} + /> + + } + helpText={ + + } + value={this.state.UseIpAddress} + onChange={this.overrideHandleChange} + /> + + } + helpText={ + + } + value={this.state.UseExperimentalGossip} + onChange={this.overrideHandleChange} + /> + + } + helpText={ + + } + value={this.state.ReadOnlyConfig} onChange={this.overrideHandleChange} - disabled={true} /> } - placeholder={Utils.localizeMessage('admin.cluster.interNodeListenAddressEx', 'Ex ":8075"')} + placeholder={Utils.localizeMessage('admin.cluster.GossipPortEx', 'Ex "8074"')} helpText={ } - value={this.state.interNodeListenAddress} + value={this.state.GossipPort} onChange={this.overrideHandleChange} - disabled={true} /> } - placeholder={Utils.localizeMessage('admin.cluster.interNodeUrlsEx', 'Ex "http://10.10.10.30, http://10.10.10.31"')} + placeholder={Utils.localizeMessage('admin.cluster.StreamingPortEx', 'Ex "8075"')} helpText={ } - value={this.state.interNodeUrls} + value={this.state.StreamingPort} onChange={this.overrideHandleChange} - disabled={true} /> ); diff --git a/webapp/components/admin_console/cluster_table.jsx b/webapp/components/admin_console/cluster_table.jsx index 542b1691d..e7157635d 100644 --- a/webapp/components/admin_console/cluster_table.jsx +++ b/webapp/components/admin_console/cluster_table.jsx @@ -9,7 +9,7 @@ import {FormattedMessage} from 'react-intl'; import * as Utils from 'utils/utils.jsx'; import statusGreen from 'images/status_green.png'; -import statusRed from 'images/status_red.png'; +import statusYellow from 'images/status_yellow.png'; export default class ClusterTable extends React.Component { static propTypes = { @@ -34,10 +34,12 @@ export default class ClusterTable extends React.Component { var version = ''; var configHash = ''; + var singleItem = false; if (this.props.clusterInfos.length) { version = this.props.clusterInfos[0].version; configHash = this.props.clusterInfos[0].config_hash; + singleItem = this.props.clusterInfos.length === 1; } this.props.clusterInfos.map((clusterInfo) => { @@ -45,7 +47,7 @@ export default class ClusterTable extends React.Component { versionMismatch = ( ); } @@ -54,7 +56,7 @@ export default class ClusterTable extends React.Component { configMismatch = ( ); } @@ -77,34 +79,29 @@ export default class ClusterTable extends React.Component { clusterInfo.config_hash = Utils.localizeMessage('admin.cluster.unknown', 'unknown'); } - if (clusterInfo.id === '') { - clusterInfo.id = Utils.localizeMessage('admin.cluster.unknown', 'unknown'); - } - - if (clusterInfo.is_alive > 0) { + if (singleItem) { status = ( ); } else { status = ( ); } return ( - + {status} {clusterInfo.hostname} {versionMismatch} {clusterInfo.version}
{configMismatch} {clusterInfo.config_hash}
- {clusterInfo.internode_url} -
{clusterInfo.id}
+ {clusterInfo.ipaddress} ); }); @@ -160,13 +157,7 @@ export default class ClusterTable extends React.Component { - - - -- cgit v1.2.3-1-g7c22