mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 22:14:59 +00:00
Merge branch 'pr/19144-discovery-azure-classic'
This commit is contained in:
commit
535157474e
@ -1179,10 +1179,10 @@
|
|||||||
<suppress files="plugins[/\\]analysis-kuromoji[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]JapaneseStopTokenFilterFactory.java" checks="LineLength" />
|
<suppress files="plugins[/\\]analysis-kuromoji[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]JapaneseStopTokenFilterFactory.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]analysis-kuromoji[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]KuromojiAnalysisTests.java" checks="LineLength" />
|
<suppress files="plugins[/\\]analysis-kuromoji[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]KuromojiAnalysisTests.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]analysis-phonetic[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]PhoneticTokenFilterFactory.java" checks="LineLength" />
|
<suppress files="plugins[/\\]analysis-phonetic[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]analysis[/\\]PhoneticTokenFilterFactory.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]AbstractAzureTestCase.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-azure-classic[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]AbstractAzureTestCase.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureMinimumMasterNodesTests.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-azure-classic[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureMinimumMasterNodesTests.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureSimpleTests.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-azure-classic[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureSimpleTests.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureTwoStartedNodesTests.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-azure-classic[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]azure[/\\]AzureTwoStartedNodesTests.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]aws[/\\]AbstractAwsTestCase.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]aws[/\\]AbstractAwsTestCase.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ec2[/\\]AmazonEC2Mock.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ec2[/\\]AmazonEC2Mock.java" checks="LineLength" />
|
||||||
<suppress files="plugins[/\\]discovery-gce[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]gce[/\\]GceNetworkTests.java" checks="LineLength" />
|
<suppress files="plugins[/\\]discovery-gce[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]gce[/\\]GceNetworkTests.java" checks="LineLength" />
|
||||||
|
@ -63,7 +63,7 @@ DEFAULT_PLUGINS = ["analysis-icu",
|
|||||||
"analysis-phonetic",
|
"analysis-phonetic",
|
||||||
"analysis-smartcn",
|
"analysis-smartcn",
|
||||||
"analysis-stempel",
|
"analysis-stempel",
|
||||||
"discovery-azure",
|
"discovery-azure-classic",
|
||||||
"discovery-ec2",
|
"discovery-ec2",
|
||||||
"discovery-gce",
|
"discovery-gce",
|
||||||
"ingest-attachment",
|
"ingest-attachment",
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
[[discovery-azure]]
|
[[discovery-azure-classic]]
|
||||||
=== Azure Discovery Plugin
|
=== Azure Classic Discovery Plugin
|
||||||
|
|
||||||
The Azure Discovery plugin uses the Azure API for unicast discovery.
|
The Azure Classic Discovery plugin uses the Azure Classic API for unicast discovery.
|
||||||
|
|
||||||
[[discovery-azure-install]]
|
// TODO: Link to ARM plugin when ready
|
||||||
|
// See issue https://github.com/elastic/elasticsearch/issues/19146
|
||||||
|
deprecated[5.0.0, Use coming Azure ARM Discovery plugin instead]
|
||||||
|
|
||||||
|
[[discovery-azure-classic-install]]
|
||||||
[float]
|
[float]
|
||||||
==== Installation
|
==== Installation
|
||||||
|
|
||||||
@ -11,13 +15,13 @@ This plugin can be installed using the plugin manager:
|
|||||||
|
|
||||||
[source,sh]
|
[source,sh]
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
sudo bin/elasticsearch-plugin install discovery-azure
|
sudo bin/elasticsearch-plugin install discovery-azure-classic
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
The plugin must be installed on every node in the cluster, and each node must
|
The plugin must be installed on every node in the cluster, and each node must
|
||||||
be restarted after installation.
|
be restarted after installation.
|
||||||
|
|
||||||
[[discovery-azure-remove]]
|
[[discovery-azure-classic-remove]]
|
||||||
[float]
|
[float]
|
||||||
==== Removal
|
==== Removal
|
||||||
|
|
||||||
@ -25,12 +29,12 @@ The plugin can be removed with the following command:
|
|||||||
|
|
||||||
[source,sh]
|
[source,sh]
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
sudo bin/elasticsearch-plugin remove discovery-azure
|
sudo bin/elasticsearch-plugin remove discovery-azure-classic
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
The node must be stopped before removing the plugin.
|
The node must be stopped before removing the plugin.
|
||||||
|
|
||||||
[[discovery-azure-usage]]
|
[[discovery-azure-classic-usage]]
|
||||||
==== Azure Virtual Machine Discovery
|
==== Azure Virtual Machine Discovery
|
||||||
|
|
||||||
Azure VM discovery allows to use the azure APIs to perform automatic discovery (similar to multicast in non hostile
|
Azure VM discovery allows to use the azure APIs to perform automatic discovery (similar to multicast in non hostile
|
||||||
@ -64,7 +68,7 @@ You can use {ref}/modules-network.html[core network host settings]. For example
|
|||||||
|
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
[[discovery-azure-short]]
|
[[discovery-azure-classic-short]]
|
||||||
===== How to start (short story)
|
===== How to start (short story)
|
||||||
|
|
||||||
* Create Azure instances
|
* Create Azure instances
|
||||||
@ -73,7 +77,7 @@ You can use {ref}/modules-network.html[core network host settings]. For example
|
|||||||
* Modify `elasticsearch.yml` file
|
* Modify `elasticsearch.yml` file
|
||||||
* Start Elasticsearch
|
* Start Elasticsearch
|
||||||
|
|
||||||
[[discovery-azure-settings]]
|
[[discovery-azure-classic-settings]]
|
||||||
===== Azure credential API settings
|
===== Azure credential API settings
|
||||||
|
|
||||||
The following are a list of settings that can further control the credential API:
|
The following are a list of settings that can further control the credential API:
|
||||||
@ -100,7 +104,7 @@ The following are a list of settings that can further control the credential API
|
|||||||
your_azure_cloud_service_name
|
your_azure_cloud_service_name
|
||||||
|
|
||||||
|
|
||||||
[[discovery-azure-settings-advanced]]
|
[[discovery-azure-classic-settings-advanced]]
|
||||||
===== Advanced settings
|
===== Advanced settings
|
||||||
|
|
||||||
The following are a list of settings that can further control the discovery:
|
The following are a list of settings that can further control the discovery:
|
||||||
@ -143,7 +147,7 @@ discovery:
|
|||||||
slot: production
|
slot: production
|
||||||
----
|
----
|
||||||
|
|
||||||
[[discovery-azure-long]]
|
[[discovery-azure-classic-long]]
|
||||||
==== Setup process for Azure Discovery
|
==== Setup process for Azure Discovery
|
||||||
|
|
||||||
We will expose here one strategy which is to hide our Elasticsearch cluster from outside.
|
We will expose here one strategy which is to hide our Elasticsearch cluster from outside.
|
||||||
@ -153,7 +157,7 @@ other. That means that with this mode, you can use elasticsearch unicast
|
|||||||
discovery to build a cluster, using the Azure API to retrieve information
|
discovery to build a cluster, using the Azure API to retrieve information
|
||||||
about your nodes.
|
about your nodes.
|
||||||
|
|
||||||
[[discovery-azure-long-prerequisites]]
|
[[discovery-azure-classic-long-prerequisites]]
|
||||||
===== Prerequisites
|
===== Prerequisites
|
||||||
|
|
||||||
Before starting, you need to have:
|
Before starting, you need to have:
|
||||||
@ -243,7 +247,7 @@ azure account download
|
|||||||
azure account import /tmp/azure.publishsettings
|
azure account import /tmp/azure.publishsettings
|
||||||
----
|
----
|
||||||
|
|
||||||
[[discovery-azure-long-instance]]
|
[[discovery-azure-classic-long-instance]]
|
||||||
===== Creating your first instance
|
===== Creating your first instance
|
||||||
|
|
||||||
You need to have a storage account available. Check http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/#create-account[Azure Blob Storage documentation]
|
You need to have a storage account available. Check http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/#create-account[Azure Blob Storage documentation]
|
||||||
@ -396,7 +400,7 @@ This command should give you a JSON result:
|
|||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
[[discovery-azure-long-plugin]]
|
[[discovery-azure-classic-long-plugin]]
|
||||||
===== Install elasticsearch cloud azure plugin
|
===== Install elasticsearch cloud azure plugin
|
||||||
|
|
||||||
[source,sh]
|
[source,sh]
|
||||||
@ -405,7 +409,7 @@ This command should give you a JSON result:
|
|||||||
sudo service elasticsearch stop
|
sudo service elasticsearch stop
|
||||||
|
|
||||||
# Install the plugin
|
# Install the plugin
|
||||||
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install discovery-azure
|
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install discovery-azure-classic
|
||||||
|
|
||||||
# Configure it
|
# Configure it
|
||||||
sudo vi /etc/elasticsearch/elasticsearch.yml
|
sudo vi /etc/elasticsearch/elasticsearch.yml
|
||||||
@ -441,7 +445,7 @@ sudo service elasticsearch start
|
|||||||
|
|
||||||
If anything goes wrong, check your logs in `/var/log/elasticsearch`.
|
If anything goes wrong, check your logs in `/var/log/elasticsearch`.
|
||||||
|
|
||||||
[[discovery-azure-scale]]
|
[[discovery-azure-classic-scale]]
|
||||||
==== Scaling Out!
|
==== Scaling Out!
|
||||||
|
|
||||||
You need first to create an image of your previous machine.
|
You need first to create an image of your previous machine.
|
@ -13,9 +13,9 @@ The core discovery plugins are:
|
|||||||
|
|
||||||
The EC2 discovery plugin uses the https://github.com/aws/aws-sdk-java[AWS API] for unicast discovery.
|
The EC2 discovery plugin uses the https://github.com/aws/aws-sdk-java[AWS API] for unicast discovery.
|
||||||
|
|
||||||
<<discovery-azure,Azure discovery>>::
|
<<discovery-azure-classic,Azure Classic discovery>>::
|
||||||
|
|
||||||
The Azure discovery plugin uses the Azure API for unicast discovery.
|
The Azure Classic discovery plugin uses the Azure Classic API for unicast discovery.
|
||||||
|
|
||||||
<<discovery-gce,GCE discovery>>::
|
<<discovery-gce,GCE discovery>>::
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ A number of discovery plugins have been contributed by our community:
|
|||||||
|
|
||||||
include::discovery-ec2.asciidoc[]
|
include::discovery-ec2.asciidoc[]
|
||||||
|
|
||||||
include::discovery-azure.asciidoc[]
|
include::discovery-azure-classic.asciidoc[]
|
||||||
|
|
||||||
include::discovery-gce.asciidoc[]
|
include::discovery-gce.asciidoc[]
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ The `cloud-aws` plugin has been split into two separate plugins:
|
|||||||
|
|
||||||
The `cloud-azure` plugin has been split into two separate plugins:
|
The `cloud-azure` plugin has been split into two separate plugins:
|
||||||
|
|
||||||
* <<discovery-azure>> (`discovery-azure`)
|
* <<discovery-azure-classic>> (`discovery-azure-classic`)
|
||||||
* <<repository-azure>> (`repository-azure`)
|
* <<repository-azure>> (`repository-azure`)
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ Proxy settings for both plugins have been renamed:
|
|||||||
|
|
||||||
Cloud Azure plugin has been split in three plugins:
|
Cloud Azure plugin has been split in three plugins:
|
||||||
|
|
||||||
* {plugins}/discovery-azure.html[Discovery Azure plugin]
|
* {plugins}/discovery-azure-classic.html[Discovery Azure plugin]
|
||||||
* {plugins}/repository-azure.html[Repository Azure plugin]
|
* {plugins}/repository-azure.html[Repository Azure plugin]
|
||||||
* {plugins}/store-smb.html[Store SMB plugin]
|
* {plugins}/store-smb.html[Store SMB plugin]
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[[modules-discovery-azure]]
|
[[modules-discovery-azure-classic]]
|
||||||
=== Azure Discovery
|
=== Azure Classic Discovery
|
||||||
|
|
||||||
Azure discovery allows to use the Azure APIs to perform automatic discovery (similar to multicast).
|
Azure classic discovery allows to use the Azure Classic APIs to perform automatic discovery (similar to multicast).
|
||||||
It is available as a plugin. See {plugins}/discovery-azure.html[discovery-azure] for more information.
|
It is available as a plugin. See {plugins}/discovery-azure-classic.html[discovery-azure-classic] for more information.
|
||||||
|
@ -20,8 +20,8 @@ import org.elasticsearch.gradle.LoggedExec
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
esplugin {
|
esplugin {
|
||||||
description 'The Azure Discovery plugin allows to use Azure API for the unicast discovery mechanism'
|
description 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism'
|
||||||
classname 'org.elasticsearch.plugin.discovery.azure.AzureDiscoveryPlugin'
|
classname 'org.elasticsearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin'
|
||||||
}
|
}
|
||||||
|
|
||||||
versions << [
|
versions << [
|
@ -17,12 +17,11 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Management;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeServiceImpl;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeServiceImpl;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.inject.AbstractModule;
|
import org.elasticsearch.common.inject.AbstractModule;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
@ -31,7 +30,7 @@ import org.elasticsearch.common.logging.Loggers;
|
|||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.discovery.DiscoveryModule;
|
import org.elasticsearch.discovery.DiscoveryModule;
|
||||||
import org.elasticsearch.plugin.discovery.azure.AzureDiscoveryPlugin;
|
import org.elasticsearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Azure Module
|
* Azure Module
|
||||||
@ -41,7 +40,7 @@ import org.elasticsearch.plugin.discovery.azure.AzureDiscoveryPlugin;
|
|||||||
* to AzureComputeServiceImpl.</li>
|
* to AzureComputeServiceImpl.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @see org.elasticsearch.cloud.azure.management.AzureComputeServiceImpl
|
* @see AzureComputeServiceImpl
|
||||||
*/
|
*/
|
||||||
public class AzureDiscoveryModule extends AbstractModule {
|
public class AzureDiscoveryModule extends AbstractModule {
|
||||||
protected final ESLogger logger;
|
protected final ESLogger logger;
|
||||||
@ -77,19 +76,19 @@ public class AzureDiscoveryModule extends AbstractModule {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDefined(settings, Management.SUBSCRIPTION_ID_SETTING) &&
|
if (isDefined(settings, AzureComputeService.Management.SUBSCRIPTION_ID_SETTING) &&
|
||||||
isDefined(settings, Management.SERVICE_NAME_SETTING) &&
|
isDefined(settings, AzureComputeService.Management.SERVICE_NAME_SETTING) &&
|
||||||
isDefined(settings, Management.KEYSTORE_PATH_SETTING) &&
|
isDefined(settings, AzureComputeService.Management.KEYSTORE_PATH_SETTING) &&
|
||||||
isDefined(settings, Management.KEYSTORE_PASSWORD_SETTING)) {
|
isDefined(settings, AzureComputeService.Management.KEYSTORE_PASSWORD_SETTING)) {
|
||||||
logger.trace("All required properties for Azure discovery are set!");
|
logger.trace("All required properties for Azure discovery are set!");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
logger.debug("One or more Azure discovery settings are missing. " +
|
logger.debug("One or more Azure discovery settings are missing. " +
|
||||||
"Check elasticsearch.yml file. Should have [{}], [{}], [{}] and [{}].",
|
"Check elasticsearch.yml file. Should have [{}], [{}], [{}] and [{}].",
|
||||||
Management.SUBSCRIPTION_ID_SETTING.getKey(),
|
AzureComputeService.Management.SUBSCRIPTION_ID_SETTING.getKey(),
|
||||||
Management.SERVICE_NAME_SETTING.getKey(),
|
AzureComputeService.Management.SERVICE_NAME_SETTING.getKey(),
|
||||||
Management.KEYSTORE_PATH_SETTING.getKey(),
|
AzureComputeService.Management.KEYSTORE_PATH_SETTING.getKey(),
|
||||||
Management.KEYSTORE_PASSWORD_SETTING.getKey());
|
AzureComputeService.Management.KEYSTORE_PASSWORD_SETTING.getKey());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
public class AzureServiceDisableException extends IllegalStateException {
|
public class AzureServiceDisableException extends IllegalStateException {
|
||||||
public AzureServiceDisableException(String msg) {
|
public AzureServiceDisableException(String msg) {
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
public class AzureServiceRemoteException extends IllegalStateException {
|
public class AzureServiceRemoteException extends IllegalStateException {
|
||||||
public AzureServiceRemoteException(String msg) {
|
public AzureServiceRemoteException(String msg) {
|
@ -17,15 +17,15 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure.management;
|
package org.elasticsearch.cloud.azure.classic.management;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.core.utils.KeyStoreType;
|
import com.microsoft.windowsazure.core.utils.KeyStoreType;
|
||||||
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Setting.Property;
|
import org.elasticsearch.common.settings.Setting.Property;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.discovery.azure.AzureUnicastHostsProvider;
|
import org.elasticsearch.discovery.azure.classic.AzureUnicastHostsProvider;
|
||||||
import org.elasticsearch.discovery.azure.AzureUnicastHostsProvider.Deployment;
|
import org.elasticsearch.discovery.azure.classic.AzureUnicastHostsProvider.Deployment;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure.management;
|
package org.elasticsearch.cloud.azure.classic.management;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.Configuration;
|
import com.microsoft.windowsazure.Configuration;
|
||||||
import com.microsoft.windowsazure.core.Builder;
|
import com.microsoft.windowsazure.core.Builder;
|
||||||
@ -28,7 +28,7 @@ import com.microsoft.windowsazure.management.compute.ComputeManagementService;
|
|||||||
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
||||||
import com.microsoft.windowsazure.management.configuration.ManagementConfiguration;
|
import com.microsoft.windowsazure.management.configuration.ManagementConfiguration;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.cloud.azure.AzureServiceRemoteException;
|
import org.elasticsearch.cloud.azure.classic.AzureServiceRemoteException;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
||||||
@ -25,10 +25,10 @@ import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDeta
|
|||||||
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
||||||
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cloud.azure.AzureServiceDisableException;
|
import org.elasticsearch.cloud.azure.classic.AzureServiceDisableException;
|
||||||
import org.elasticsearch.cloud.azure.AzureServiceRemoteException;
|
import org.elasticsearch.cloud.azure.classic.AzureServiceRemoteException;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.component.AbstractComponent;
|
import org.elasticsearch.common.component.AbstractComponent;
|
@ -17,18 +17,18 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.plugin.discovery.azure;
|
package org.elasticsearch.plugin.discovery.azure.classic;
|
||||||
|
|
||||||
import org.elasticsearch.cloud.azure.AzureDiscoveryModule;
|
import org.elasticsearch.cloud.azure.classic.AzureDiscoveryModule;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
|
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||||
import org.elasticsearch.common.logging.ESLogger;
|
import org.elasticsearch.common.logging.ESLogger;
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.settings.SettingsModule;
|
|
||||||
import org.elasticsearch.discovery.DiscoveryModule;
|
import org.elasticsearch.discovery.DiscoveryModule;
|
||||||
import org.elasticsearch.discovery.azure.AzureUnicastHostsProvider;
|
import org.elasticsearch.discovery.azure.classic.AzureUnicastHostsProvider;
|
||||||
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
|
||||||
@ -45,7 +45,9 @@ public class AzureDiscoveryPlugin extends Plugin {
|
|||||||
|
|
||||||
public AzureDiscoveryPlugin(Settings settings) {
|
public AzureDiscoveryPlugin(Settings settings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
logger.trace("starting azure discovery plugin...");
|
DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||||
|
deprecationLogger.deprecated("azure classic discovery plugin is deprecated. Use azure arm discovery plugin instead");
|
||||||
|
logger.trace("starting azure classic discovery plugin...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -17,14 +17,14 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Management;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.plugin.discovery.azure.AzureDiscoveryPlugin;
|
import org.elasticsearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
|
@ -17,14 +17,14 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
||||||
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
||||||
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
||||||
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeServiceAbstractMock;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeServiceAbstractMock;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.CollectionUtils;
|
import org.elasticsearch.common.util.CollectionUtils;
|
@ -17,14 +17,14 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure.classic;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
||||||
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
import com.microsoft.windowsazure.management.compute.models.HostedServiceGetDetailedResponse;
|
||||||
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
import com.microsoft.windowsazure.management.compute.models.InstanceEndpoint;
|
||||||
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
import com.microsoft.windowsazure.management.compute.models.RoleInstance;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeServiceAbstractMock;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeServiceAbstractMock;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.network.NetworkService;
|
import org.elasticsearch.common.network.NetworkService;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.cloud.azure.management;
|
package org.elasticsearch.cloud.azure.classic.management;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
@ -17,14 +17,14 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentSlot;
|
||||||
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
import com.microsoft.windowsazure.management.compute.models.DeploymentStatus;
|
||||||
import com.sun.net.httpserver.Headers;
|
import com.sun.net.httpserver.Headers;
|
||||||
import com.sun.net.httpserver.HttpsConfigurator;
|
import com.sun.net.httpserver.HttpsConfigurator;
|
||||||
import com.sun.net.httpserver.HttpsServer;
|
import com.sun.net.httpserver.HttpsServer;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
import org.elasticsearch.common.io.FileSystemUtils;
|
import org.elasticsearch.common.io.FileSystemUtils;
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
@ -33,7 +33,7 @@ import org.elasticsearch.common.settings.Settings;
|
|||||||
import org.elasticsearch.discovery.DiscoveryModule;
|
import org.elasticsearch.discovery.DiscoveryModule;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.plugin.discovery.azure.AzureDiscoveryPlugin;
|
import org.elasticsearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.transport.TransportSettings;
|
import org.elasticsearch.transport.TransportSettings;
|
@ -17,7 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
@ -17,11 +17,11 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
||||||
import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase;
|
import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase;
|
||||||
import org.elasticsearch.cloud.azure.AzureComputeServiceTwoNodesMock;
|
import org.elasticsearch.cloud.azure.classic.AzureComputeServiceTwoNodesMock;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.discovery.MasterNotDiscoveredException;
|
import org.elasticsearch.discovery.MasterNotDiscoveredException;
|
||||||
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
||||||
@ -63,20 +63,23 @@ public class AzureMinimumMasterNodesTests extends AbstractAzureComputeServiceTes
|
|||||||
logger.info("--> start data node / non master node");
|
logger.info("--> start data node / non master node");
|
||||||
internalCluster().startNode();
|
internalCluster().startNode();
|
||||||
try {
|
try {
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("100ms").execute().actionGet().getState().nodes().getMasterNodeId(), nullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("100ms").get().getState().nodes().getMasterNodeId(),
|
||||||
|
nullValue());
|
||||||
fail("should not be able to find master");
|
fail("should not be able to find master");
|
||||||
} catch (MasterNotDiscoveredException e) {
|
} catch (MasterNotDiscoveredException e) {
|
||||||
// all is well, no master elected
|
// all is well, no master elected
|
||||||
}
|
}
|
||||||
logger.info("--> start another node");
|
logger.info("--> start another node");
|
||||||
internalCluster().startNode();
|
internalCluster().startNode();
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
logger.info("--> stop master node");
|
logger.info("--> stop master node");
|
||||||
internalCluster().stopCurrentMasterNode();
|
internalCluster().stopCurrentMasterNode();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), nullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
nullValue());
|
||||||
fail("should not be able to find master");
|
fail("should not be able to find master");
|
||||||
} catch (MasterNotDiscoveredException e) {
|
} catch (MasterNotDiscoveredException e) {
|
||||||
// all is well, no master elected
|
// all is well, no master elected
|
||||||
@ -84,6 +87,7 @@ public class AzureMinimumMasterNodesTests extends AbstractAzureComputeServiceTes
|
|||||||
|
|
||||||
logger.info("--> start another node");
|
logger.info("--> start another node");
|
||||||
internalCluster().startNode();
|
internalCluster().startNode();
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,12 +17,12 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase;
|
import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase;
|
||||||
import org.elasticsearch.cloud.azure.AzureComputeServiceSimpleMock;
|
import org.elasticsearch.cloud.azure.classic.AzureComputeServiceSimpleMock;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Management;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
|
||||||
@ -38,14 +38,15 @@ public class AzureSimpleTests extends AbstractAzureComputeServiceTestCase {
|
|||||||
super(AzureComputeServiceSimpleMock.TestPlugin.class);
|
super(AzureComputeServiceSimpleMock.TestPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOneNodeDhouldRunUsingPrivateIp() {
|
public void testOneNodeShouldRunUsingPrivateIp() {
|
||||||
Settings.Builder settings = Settings.builder()
|
Settings.Builder settings = Settings.builder()
|
||||||
.put(Management.SERVICE_NAME_SETTING.getKey(), "dummy")
|
.put(Management.SERVICE_NAME_SETTING.getKey(), "dummy")
|
||||||
.put(Discovery.HOST_TYPE_SETTING.getKey(), "private_ip");
|
.put(Discovery.HOST_TYPE_SETTING.getKey(), "private_ip");
|
||||||
|
|
||||||
logger.info("--> start one node");
|
logger.info("--> start one node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
// We expect having 1 node as part of the cluster, let's test that
|
// We expect having 1 node as part of the cluster, let's test that
|
||||||
checkNumberOfNodes(1);
|
checkNumberOfNodes(1);
|
||||||
@ -58,7 +59,8 @@ public class AzureSimpleTests extends AbstractAzureComputeServiceTestCase {
|
|||||||
|
|
||||||
logger.info("--> start one node");
|
logger.info("--> start one node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
// We expect having 1 node as part of the cluster, let's test that
|
// We expect having 1 node as part of the cluster, let's test that
|
||||||
checkNumberOfNodes(1);
|
checkNumberOfNodes(1);
|
@ -17,12 +17,12 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.discovery.azure;
|
package org.elasticsearch.discovery.azure.classic;
|
||||||
|
|
||||||
import org.elasticsearch.cloud.azure.AbstractAzureComputeServiceTestCase;
|
import org.elasticsearch.cloud.azure.classic.AbstractAzureComputeServiceTestCase;
|
||||||
import org.elasticsearch.cloud.azure.AzureComputeServiceTwoNodesMock;
|
import org.elasticsearch.cloud.azure.classic.AzureComputeServiceTwoNodesMock;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Discovery;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Discovery;
|
||||||
import org.elasticsearch.cloud.azure.management.AzureComputeService.Management;
|
import org.elasticsearch.cloud.azure.classic.management.AzureComputeService.Management;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
|
||||||
@ -46,11 +46,13 @@ public class AzureTwoStartedNodesTests extends AbstractAzureComputeServiceTestCa
|
|||||||
|
|
||||||
logger.info("--> start first node");
|
logger.info("--> start first node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
logger.info("--> start another node");
|
logger.info("--> start another node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
// We expect having 2 nodes as part of the cluster, let's test that
|
// We expect having 2 nodes as part of the cluster, let's test that
|
||||||
checkNumberOfNodes(2);
|
checkNumberOfNodes(2);
|
||||||
@ -64,11 +66,13 @@ public class AzureTwoStartedNodesTests extends AbstractAzureComputeServiceTestCa
|
|||||||
|
|
||||||
logger.info("--> start first node");
|
logger.info("--> start first node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
logger.info("--> start another node");
|
logger.info("--> start another node");
|
||||||
internalCluster().startNode(settings);
|
internalCluster().startNode(settings);
|
||||||
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").execute().actionGet().getState().nodes().getMasterNodeId(), notNullValue());
|
assertThat(client().admin().cluster().prepareState().setMasterNodeTimeout("1s").get().getState().nodes().getMasterNodeId(),
|
||||||
|
notNullValue());
|
||||||
|
|
||||||
// We expect having 2 nodes as part of the cluster, let's test that
|
// We expect having 2 nodes as part of the cluster, let's test that
|
||||||
checkNumberOfNodes(2);
|
checkNumberOfNodes(2);
|
@ -0,0 +1,13 @@
|
|||||||
|
# Integration tests for Azure Classic Discovery component
|
||||||
|
#
|
||||||
|
"Discovery Azure Classic loaded":
|
||||||
|
- do:
|
||||||
|
cluster.state: {}
|
||||||
|
|
||||||
|
# Get master node id
|
||||||
|
- set: { master_node: master }
|
||||||
|
|
||||||
|
- do:
|
||||||
|
nodes.info: {}
|
||||||
|
|
||||||
|
- match: { nodes.$master.plugins.0.name: discovery-azure-classic }
|
@ -1,13 +0,0 @@
|
|||||||
# Integration tests for Azure Discovery component
|
|
||||||
#
|
|
||||||
"Discovery Azure loaded":
|
|
||||||
- do:
|
|
||||||
cluster.state: {}
|
|
||||||
|
|
||||||
# Get master node id
|
|
||||||
- set: { master_node: master }
|
|
||||||
|
|
||||||
- do:
|
|
||||||
nodes.info: {}
|
|
||||||
|
|
||||||
- match: { nodes.$master.plugins.0.name: discovery-azure }
|
|
@ -209,7 +209,7 @@ fi
|
|||||||
install_and_check_plugin discovery gce google-api-client-*.jar
|
install_and_check_plugin discovery gce google-api-client-*.jar
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "[$GROUP] install discovery-azure plugin" {
|
@test "[$GROUP] install discovery-azure-classic plugin" {
|
||||||
install_and_check_plugin discovery azure azure-core-*.jar
|
install_and_check_plugin discovery azure azure-core-*.jar
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,8 +341,8 @@ fi
|
|||||||
remove_plugin discovery-gce
|
remove_plugin discovery-gce
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "[$GROUP] remove discovery-azure plugin" {
|
@test "[$GROUP] remove discovery-azure-classic plugin" {
|
||||||
remove_plugin discovery-azure
|
remove_plugin discovery-azure-classic
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "[$GROUP] remove discovery-ec2 plugin" {
|
@test "[$GROUP] remove discovery-ec2 plugin" {
|
||||||
|
@ -31,7 +31,7 @@ List projects = [
|
|||||||
'plugins:analysis-phonetic',
|
'plugins:analysis-phonetic',
|
||||||
'plugins:analysis-smartcn',
|
'plugins:analysis-smartcn',
|
||||||
'plugins:analysis-stempel',
|
'plugins:analysis-stempel',
|
||||||
'plugins:discovery-azure',
|
'plugins:discovery-azure-classic',
|
||||||
'plugins:discovery-ec2',
|
'plugins:discovery-ec2',
|
||||||
'plugins:discovery-gce',
|
'plugins:discovery-gce',
|
||||||
'plugins:ingest-geoip',
|
'plugins:ingest-geoip',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user