2017-04-03 5 views
1

AzureにESクラスタを設定する際に問題があります。クラスターをアプリケーションゲートウェイの背後に置いて、シールド認証も使用したいと思います。アプリケーションゲートウェイへの認証なしでelasticsearchから200の応答を与える方法はありますか?

問題は、Azureアプリケーションゲートウェイがヘルスpingをクラスタに送信して200応答を返さなければならないことです。それ以外の場合は、502「不良ゲートウェイ」が返されます。私は匿名の使用を作成する場合、私は200を返すためにクラスターを得ることができますが、私はむしろ匿名ユーザーを有効にし、代わりに基本認証を使用したいと思います。

ユーザーが認証されておらず、匿名ユーザーがオフになっている場合でも、クラスター上にエンドポイントが200個ありますか?

ありがとうございます!

答えて

2

Elasticsearchにそのようなエンドポイントはありません。キバナには統計apiエンドポイントのためのstatus.allowAnonymousがありますが、Elasticsearchではこれと似ていません。

特定のhealthcheck URLにアクセスできる独自のユーザーを定義し、その匿名アクセスを有効にする必要があります。

healthchecksストーリーにはバリエーションがあります。特定のノードの状態(/_cluster/health?local=true)、またはクラスタの正常性をチェックします。 by defaultなどの状況でもノードで_search操作が許可されているなど、_searchリクエスト(preference=_local)を特定のノードに送信した場合、そのクラスタに選択されたマスターノードがなくても200を取得できます。

1

@Andrei's answerに加えて、Elastic's Azure ARM templateを見て、アプリケーションゲートウェイが負荷分散とSSLオフロード用に構成されたクラスタを展開できることをお勧めします。

これはまた、pingのチェックが中に資格証明書を供給サポートされている場合それは素晴らしいことだだけ

cluster: 
    - cluster:monitor/main 

へのアクセスを持つロールが割り当てられているアプリケーション・ゲートウェイのpingヘルスチェックのための匿名アクセスを設定することでX-Pack Securityで動作します将来の場合、匿名アクセスは必要なくなり、物事をさらに拘束します。

は、AzureのPowerShellの

function PromptCustom($title, $optionValues, $optionDescriptions) 
{ 
    Write-Host $title 
    Write-Host 
    $a = @() 
    for($i = 0; $i -lt $optionValues.Length; $i++){ 
     Write-Host "$($i+1))" $optionDescriptions[$i] 
    } 
    Write-Host 

    while($true) 
    { 
     Write-Host "Choose an option: " 
     $option = Read-Host 
     $option = $option -as [int] 

     if($option -ge 1 -and $option -le $optionValues.Length) 
     { 
      return $optionValues[$option-1] 
     } 
    } 
} 

function Prompt-Subscription() { 
    # Choose subscription. If there's only one we will choose automatically 
    $subs = Get-AzureRmSubscription 
    $subscriptionId = "" 

    if($subs.Length -eq 0) { 
     Write-Error "No subscriptions bound to this account." 
     return 
    } 

    if($subs.Length -eq 1) { 
     $subscriptionId = $subs[0].SubscriptionId 
    } 
    else { 
     $subscriptionChoices = @() 
     $subscriptionValues = @() 

     foreach($subscription in $subs) { 
      $subscriptionChoices += "$($subscription.SubscriptionName) ($($subscription.SubscriptionId))"; 
      $subscriptionValues += ($subscription.SubscriptionId); 
     } 

     $subscriptionId = PromptCustom "Choose a subscription" $subscriptionValues $subscriptionChoices 
    } 

    return $subscriptionId 
} 

$subscriptionId = "{YOUR SUBSCRIPTION ID}" 

try { 
    Select-AzureRmSubscription -SubscriptionId $subscriptionId -ErrorAction Stop 
} 
catch { 
    Write-Host "Please Login" 
    Login-AzureRmAccount 
    $subscriptionId = Prompt-Subscription 
    Select-AzureRmSubscription -SubscriptionId $subscriptionId 
} 

# Specify the template version to use. This can be a branch name, commit hash, tag, etc. 
# NOTE: different template versions may require different parameters to be passed, so be sure to check 
# the parameters/password.parameters.json file in the respective tag branch 
$templateVersion = "master" 

$templateSrc = "https://raw.githubusercontent.com/elastic/azure-marketplace/$templateVersion/src" 
$elasticTemplate = "$templateSrc/mainTemplate.json" 
$location = "Australia Southeast" 
$resourceGroup = "app-gateway-cluster" 
$name = $resourceGroup 
$cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("{PATH TO cert.pfx}")) 

$clusterParameters = @{ 
    "artifactsBaseUrl"= $templateSrc 
    "esVersion" = "5.1.2" 
    "esClusterName" = $name 
    # Deploy to same location as Resource Group location 
    "location" = "ResourceGroup" 
    # Install X-Pack plugins. 
    # Will install trial license 
    "xpackPlugins" = "Yes" 
    # Use Application Gateway 
    "loadBalancerType" = "gateway" 
    "vmDataDiskCount" = 2 
    "dataNodesAreMasterEligible" = "Yes" 
    "adminUsername" = "russ" 
    "authenticationType" = "password" 
    "adminPassword" = "{Super Secret Password}" 
    "securityAdminPassword" = "{Super Secret Admin User Password}" 
    "securityReadPassword" = "{Super Secret Read User Password}" 
    "securityKibanaPassword" = "{Super Secret Kibana User Password}" 
    "appGatewayCertBlob" = $cert 
    "appGatewayCertPassword" = "{Password for cert.pfx (if it has one)}" 
} 

Write-Host "[$(Get-Date -format 'u')] Deploying cluster" 
New-AzureRmResourceGroup -Name $resourceGroup -Location $location 
New-AzureRmResourceGroupDeployment -Name $name -ResourceGroupName $resourceGroup -TemplateUri $elasticTemplate -TemplateParameterObject $clusterParameters 
Write-Host "[$(Get-Date -format 'u')] Deployed cluster" 

、各データノードに接続するディスクの大きさや数などの他の要素を制御するために使用することができる他のparameters available for the templateを見てくださいを使用して、アプリケーション・ゲートウェイとのクラスタを展開しますスナップショット/復元などのためのAzure Cloudプラグインの設定

関連する問題