Skip to content

Commit

Permalink
deploy: 5247ca8
Browse files Browse the repository at this point in the history
  • Loading branch information
thrau committed Sep 15, 2023
1 parent 3c136e8 commit 2bf809f
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 60 deletions.
2 changes: 1 addition & 1 deletion categories/localstack-pro/index.html

Large diffs are not rendered by default.

92 changes: 72 additions & 20 deletions categories/localstack-pro/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3863,35 +3863,87 @@ You will see a response similar to the following:</p>
<li><a href="https://github.com/localstack/localstack-pro-samples/tree/master/sample-archive/emr-hadoop-spark-jobs">Running data analytics jobs using EMR</a></li>
<li><a href="https://github.com/localstack/localstack-pro-samples/tree/master/emr-serverless-sample">Running EMR Serverless Jobs with Java</a></li>
&lt;/ul></description></item><item><title>User-Guide: ElastiCache</title><link>/user-guide/aws/elasticache/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/user-guide/aws/elasticache/</guid><description>
&lt;p>A basic version of &lt;a href="https://aws.amazon.com/elasticache/">ElastiCache&lt;/a> is provided. By default, the API is started on http://localhost:4598 and supports running a local Redis instance (Memcached support coming soon).&lt;/p>
&lt;p>After starting LocalStack Pro, you can test the following commands:
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>awslocal elasticache create-cache-cluster --cache-cluster-id i1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;CacheCluster&amp;#34;: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;CacheClusterId&amp;#34;: &amp;#34;i1&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;ConfigurationEndpoint&amp;#34;: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;Address&amp;#34;: &amp;#34;localhost&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;Port&amp;#34;: 4510
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/p>
&lt;p>Then use the returned port number (&lt;code>4510&lt;/code>) to connect to the Redis instance:
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>Amazon ElastiCache is a managed in-memory caching service provided by Amazon Web Services (AWS).
It facilitates the deployment and operation of in-memory caches within the AWS cloud environment.
ElastiCache is designed to improve application performance and scalability by alleviating the workload on backend databases.
It supports popular open-source caching engines like Redis and Memcached (LocalStack currently supports Redis),
providing a means to efficiently store and retrieve frequently accessed data with minimal latency.&lt;/p>
&lt;p>LocalStack supports ElastiCache via the Pro offering, allowing you to use the ElastiCache APIs in your local environment.
The supported APIs are available on our API Coverage Page,
which provides information on the extent of ElastiCache integration with LocalStack.&lt;/p>
&lt;h2 id="getting-started">Getting started&lt;/h2>
&lt;p>This guide is designed for users new to ElastiCache and assumes basic knowledge of the AWS CLI and our &lt;code>awslocal&lt;/code> wrapper script.&lt;/p>
&lt;h3 id="create-a-single-node-redis-cluster">Create a single-node Redis cluster&lt;/h3>
&lt;p>After starting LocalStack Pro, you can create a cluster with the following command.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>awslocal elasticache create-cache-cluster \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --cache-cluster-id my-redis-cluster \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --cache-node-type cache.t2.micro \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --engine redis \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --num-cache-nodes 1&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>You should see LocalStack responding with something like:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;#34;CacheCluster&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;#34;CacheClusterId&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#4e9a06">&amp;#34;my-redis-cluster&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;#34;ConfigurationEndpoint&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;#34;Address&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#4e9a06">&amp;#34;localhost&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;#34;Port&amp;#34;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#0000cf;font-weight:bold">4510&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000;font-weight:bold">},&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a40000">...&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="interact-with-the-cache-cluster">Interact with the cache cluster&lt;/h3>
&lt;p>By default, the cache cluster (in this case the Redis server) is exposed on a random port of the &lt;a href="/references/external-ports/">external service port range&lt;/a>.
You can see the port in the &lt;code>ConfigurationEndpoint&lt;/code> directive returned by the &lt;code>create-cache-cluster&lt;/code> command.
You can also get the port by calling &lt;code>awslocal elasticache describe-cache-clusters&lt;/code>.&lt;/p>
&lt;p>Use the returned port number (in this case &lt;code>4510&lt;/code> - but it will be a random port within the range) to connect to the Redis instance:
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>redis-cli -p 4510 ping
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PONG
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>redis-cli -p 4510 set foo bar
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>OK
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>redis-cli -p 4510 get foo
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;#34;bar&amp;#34;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/p>
&lt;p>We also support the &lt;code>create-replication-group&lt;/code> API which supports the replication groups in ElastiCache clusters. With the API, you can now have a Redis cluster, a Redis replication group with cluster mode disabled, and a Redis replication group with cluster mode enabled.&lt;/p>
&lt;h3 id="replication-group">Replication group&lt;/h3>
&lt;p>We also support the &lt;code>create-replication-group&lt;/code> API which supports the replication groups in ElastiCache clusters.
With the API, you can now have a Redis cluster, a Redis replication group with cluster mode disabled, and a Redis replication group with cluster mode enabled.&lt;/p>
&lt;p>You can create a replication group as follows:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>&lt;span class="command-prefix">$ &lt;/span>awslocal elasticache create-replication-group \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --engine redis \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --replication-group-id my-redis-replication-group \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --primary-cluster-id my-primary-redis-cluster \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --automatic-failover-enabled \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --cache-node-type cache.m5.large \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --num-cache-clusters 2 \
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --replication-group-description &amp;#39;my replication group&amp;#39;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>In the LocalStack log output, you should be able to see that Redis starts in the cluster mode (&lt;code>Running mode=cluster&lt;/code>):&lt;/p>
&lt;pre tabindex="0">&lt;code>2023-09-11T15:19:20.527 INFO --- [functhread27] l.s.elasticache.redis : 813:M 11 Sep 2023 15:19:20.527 * Running mode=cluster, port=4511.
&lt;/code>&lt;/pre>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Redis requires at least 3+ nodes to form a Redis replication group with cluster mode enabled. Hence, if the user requests only 2 node groups, we transparently upgrade to 3 nodes behind the scenes, to avoid raising an error.
&lt;/div></description></item><item><title>User-Guide: IoT</title><link>/user-guide/aws/iot/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/user-guide/aws/iot/</guid><description>
Redis requires at least three or more nodes to form a Redis replication group with cluster mode enabled.
Hence, if the user requests only two node groups, we transparently upgrade to three nodes automatically to avoid raising an error.
&lt;/div>
&lt;h2 id="resource-browser">Resource browser&lt;/h2>
&lt;p>The LocalStack Web Application provides a Resource Browser for managing ElastiCache resources.
You can access the Resource Browser by opening the LocalStack Web Application in your browser and navigating to the Resources section, then clicking on ElastiCache.&lt;/p>
&lt;p>In the ElastiCache resource browser you can:&lt;/p>
&lt;ul>
&lt;li>List and remove existing cache clusters
&lt;img src="/user-guide/aws/elasticache/elasticache-resource-browser-list.png"
alt="Create a ElastiCache cluster in the resource browser"/> &lt;/li>
&lt;li>View details of cache clusters
&lt;img src="/user-guide/aws/elasticache/elasticache-resource-browser-show.png"
alt="Create a ElastiCache cluster in the resource browser"/> &lt;/li>
&lt;li>Create new cache clusters
&lt;img src="/user-guide/aws/elasticache/elasticache-resource-browser-create.png"
alt="Create a ElastiCache cluster in the resource browser"/> &lt;/li>
&lt;/ul>
&lt;h2 id="limitations">Limitations&lt;/h2>
&lt;p>LocalStack currently supports Redis single-node and cluster mode, but not memcached.
Moreover, LocalStack emulation support for ElastiCache is mostly centered around starting/stopping Redis servers.
Resource necessary to operate a cluster, like parameter groups, security groups, subnets groups, etc. are mocked, but have no effect on the functioning of the Redis servers.
LocalStack currently doesn&amp;rsquo;t support ElastiCache snapshots, users, user groups, service updates, global replication groups, migrations or tests.
You can find a detailed list of covered API methods on the &lt;a href="/references/coverage/coverage_elasticache/">ElastiCache coverage page&lt;/a>.&lt;/p></description></item><item><title>User-Guide: IoT</title><link>/user-guide/aws/iot/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/user-guide/aws/iot/</guid><description>
&lt;p>LocalStack Pro supports IoT Core, IoT Data, IoT Analytics and related APIs.
Common operations for creating and updating things, groups, policies, certificates and other entities are implemented with full CloudFormation support.&lt;/p>
&lt;h2 id="mqtt-broker">MQTT Broker&lt;/h2>
Expand Down
2 changes: 1 addition & 1 deletion sitemap.xml

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2bf809f

Please sign in to comment.