Twitter Storm: Introduction to Local Mode

Source: Internet
Author: User

This article mainly introduces one of the two operations of storm: Local Mode.

The local mode simulates all the functions of a storm cluster in a process, which is very convenient for development and testing. Running topology in local mode is similar to running topology on the cluster.

To create a "cluster" in the process, useLocalClusterObject:

 
123 import backtype.storm.LocalCluster; LocalCluster cluster = new LocalCluster();

Then you can useLocalClusterObject submitTopology method to submit topology, effect andStormSubmitterThe corresponding methods are the same. The submitTopology method requires three parameters: the name of topology, the configuration of topology, And the topology object. You can usekillTopologyMethod to terminate a topology. A topology name is required as a parameter.

To close a local cluster, simply call:

1 cluster.shutdown();

You can.

Some common configurations in Local Mode

You can see the complete configuration list here:

1. Config. TOPOLOGY_MAX_TASK_PARALLELISM this configuration sets the maximum number of threads for each component (spout, bolt) in topology. Generally, the configuration of the production environment is large (about 100), which is too large for local testing. This configuration can be reduced.

2. If the configuration of Config. TOPOLOGY_DEBUG is set to true, storm will log all messages sent by spout and bolt, which is very useful for debugging.

Recommended reading:

Twitter Storm installation configuration (cluster) Notes

Install a Twitter Storm Cluster

Notes on installing and configuring Twitter Storm (standalone version)

Storm practice and Example 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.