In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Storm uses a language other than JVM
Main points:
1. Create topology (the official document says that it is easy to create it in other languages, because topology itself is a thrift structure, see stotm.thrift)
2. Implement spout and bolt in other languages, which are called multilang components "or" shelling "
A: there is a specified protocol Multilang protocol
The b:thrift structure allows you to explicitly define multilang components as a program and script
C: in Java, you override ShellBolt or ShellSpolt to create a multilang components, and notice that the declaration of the output field occurs in the thrift structure, so creating a multilang components in Java is as follows: specify it to declare the domain in Java, specify the structure of shellbolt in other language processing code, multilang uses JSON messages to communicate with child processes in standard input / output, storm accompanies ruby, python and other language implementation protocols, showing an example of python:
Python supports emitting, anchoring, acking, and logging
D:storm shell makes it easier to pack jar packages and upload nimbus.
Jar package and upload
The caller nimbus uses the host/port,jar file using the id number
Define a non-JVM language for Storm
Because Storm topology is a thrift structure, and nimbus is a thrift process, you can create and submit topology in any language, starting with storm.thrift. When you create thrift structures for spout and bolt, the code structures specified by spolt and bolt are:
Union ComponentObject {
1: binary serialized_java
2: ShellComponent shell
3: JavaObject java_object
}
In non-jvm languages, you may use 2 or 3.ShellCompont to let you specify a script to run, and JavaObject lets you specify java's spolt and bolt,storm shell commands to help you submit topology
Storm shell resources/ python topology.py arg1 arg2
Storm shell will pack the jar package and upload the jar package to nimbus with the following command:
Python topology.py arg1 arg2 {nimbus-host} {nimbus-port} {uploaded-jar-location}
Submit topology to the cluster
Void submitTopology (1: string name, 2: string uploadedJarLocation, 3: string jsonConf, 4: StormTopology topology) throws (1: AlreadyAliveException e, 2: InvalidTopologyException ite)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.