Skip to content

Commit

Permalink
[EXT] Updates cluster.start to not use xpack parameter in oss distrib…
Browse files Browse the repository at this point in the history
…ution

Closes #1130
  • Loading branch information
picandocodigo committed Dec 17, 2020
1 parent 6f3939e commit 23a1302
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Cluster
-E path.repo=/tmp \
-E repositories.url.allowed_urls=http://snapshot.test* \
-E discovery.zen.minimum_master_nodes=#{arguments[:number_of_nodes]-1} \
-E xpack.security.enabled=false \
#{'-E xpack.security.enabled=false' unless arguments[:dist] == 'oss'} \
-E node.max_local_storage_nodes=#{arguments[:number_of_nodes]} \
-E logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
#{arguments[:es_params]}
Expand Down Expand Up @@ -472,7 +472,6 @@ def __cluster_url
#
def __determine_version
path_to_lib = File.dirname(arguments[:command]) + '/../lib/'

version = if arguments[:version]
arguments[:version]
elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f =~ /^elasticsearch\-\d/ }.first).nil?
Expand Down Expand Up @@ -530,6 +529,8 @@ def __determine_version
raise RuntimeError, "Cannot determine Elasticsearch version from [#{arguments[:command]} --version] or [#{arguments[:command]} -v]"
end

@dist = output.match(/Build: ([a-z]+)\//)&.[](1)

if(m = output.match(/Version: (\d+\.\d+.\d+).*,/))
m[1]
else
Expand Down Expand Up @@ -564,11 +565,10 @@ def __determine_version
# @return String
#
def __command(version, arguments, node_number)
if command = COMMANDS[version]
command.call(arguments, node_number)
else
raise ArgumentError, "Cannot find command for version [#{version}]"
end
raise ArgumentError, "Cannot find command for version [#{version}]" unless (command = COMMANDS[version])

arguments.merge!({ dist: @dist })
command.call(arguments, node_number)
end

# Blocks the process and waits for the cluster to be in a "green" state
Expand Down Expand Up @@ -670,7 +670,6 @@ def __remove_cluster_data
FileUtils.rm_rf arguments[:path_data]
end


# Check whether process for PIDs are running
#
# @api private
Expand Down

0 comments on commit 23a1302

Please sign in to comment.