GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SEARCH::ELASTICSEARCH::TESTSERVER (3)

.ds Aq ’

NAME

Search::Elasticsearch::TestServer - A helper class to launch Elasticsearch nodes

CONTENTS

VERSION

version 2.00

SYNOPSIS



    use Search::Elasticsearch;
    use Search::Elasticsearch::TestServer;

    my $server = Search::Elasticsearch::TestServer->new(
        es_home   => /path/to/elasticsearch,
    );

    my $nodes = $server->start;
    my $es    = Search::Elasticsearch->new( nodes => $nodes );
    # run tests
    $server->shutdown;



DESCRIPTION

The Search::Elasticsearch::TestServer class can be used to launch one or more instances of Elasticsearch for testing purposes. The nodes will be shutdown automatically.

METHODS

CWnew()



    my $server = Search::Elasticsearch::TestServer->new(
        es_home   => /path/to/elasticsearch,
        instances => 1,
        http_port => 9600,
        es_port   => 9700,
        conf      => [script.disable_dynamic=false],
    );



Params:
o es_home

Required. Must point to the Elasticsearch home directory, which contains ./bin/elasticsearch.

o instances

The number of nodes to start. Defaults to 1

o http_port

The port to use for HTTP. If multiple instances are started, the http_port will be incremented for each subsequent instance. Defaults to 9600.

o es_port

The port to use for Elasticsearch’s internal transport. If multiple instances are started, the es_port will be incremented for each subsequent instance. Defaults to 9700

o conf

An array containing any extra startup options that should be passed to Elasticsearch.

start()



    $nodes = $server->start;



Starts the required instances and returns an array ref containing the IP and port of each node, suitable for passing to new() in Search::Elasticsearch:



    $es = Search::Elasticsearch->new( nodes => $nodes );



shutdown()



    $server->shutdown;



Kills the running instances. This will be called automatically when $server goes out of scope or if the program receives a SIGINT.

AUTHOR

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Elasticsearch BV.

This is free software, licensed under:



  The Apache License, Version 2.0, January 2004



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SEARCH::ELASTICSEARCH::TESTSERVER (3) 2015-10-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.