Search in sources :

Example 1 with TcpDiscoveryS3IpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder in project ignite by apache.

the class DiscoveryInTheCloud method awsExample1.

public static void awsExample1() {
    // tag::aws1[]
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    BasicAWSCredentials creds = new BasicAWSCredentials("yourAccessKey", "yourSecreteKey");
    TcpDiscoveryS3IpFinder ipFinder = new TcpDiscoveryS3IpFinder();
    ipFinder.setAwsCredentials(creds);
    ipFinder.setBucketName("yourBucketName");
    spi.setIpFinder(ipFinder);
    IgniteConfiguration cfg = new IgniteConfiguration();
    // Override default discovery SPI.
    cfg.setDiscoverySpi(spi);
    // Start a node.
    Ignition.start(cfg);
// end::aws1[]
}
Also used : TcpDiscoveryS3IpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 2 with TcpDiscoveryS3IpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder in project ignite by apache.

the class DiscoveryInTheCloud method awsExample2.

public static void awsExample2() {
    // tag::aws2[]
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    AWSCredentialsProvider instanceProfileCreds = new InstanceProfileCredentialsProvider(false);
    TcpDiscoveryS3IpFinder ipFinder = new TcpDiscoveryS3IpFinder();
    ipFinder.setAwsCredentialsProvider(instanceProfileCreds);
    ipFinder.setBucketName("yourBucketName");
    spi.setIpFinder(ipFinder);
    IgniteConfiguration cfg = new IgniteConfiguration();
    // Override default discovery SPI.
    cfg.setDiscoverySpi(spi);
    // Start a node.
    Ignition.start(cfg);
// end::aws2[]
}
Also used : InstanceProfileCredentialsProvider(com.amazonaws.auth.InstanceProfileCredentialsProvider) TcpDiscoveryS3IpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) AWSCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)2 TcpDiscoveryS3IpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder)2 AWSCredentialsProvider (com.amazonaws.auth.AWSCredentialsProvider)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 InstanceProfileCredentialsProvider (com.amazonaws.auth.InstanceProfileCredentialsProvider)1