Address of this article http://blog.csdn.net/makefriend7/article/details/60323717
First put the official address https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/index.html
1. Introduction to Plug-ins
Plug-in, as you know by name, is to insert something on ES to enhance ES's ability.
Here's a brief introduction to the classification of plug-ins
- API extension plugin (Action Plugin): This is the API function that extends ES. Most are used for search and mapping, such as enabling ES to support SQL statements
- Alerting plugins: Monitor the index and automatically trigger an alarm when the threshold is exceeded (on behalf of plug-in X-PACK, which periodically calls after you have set some query condition, and if it meets the condition, does what is specified).
- Analysis plugins: An analysis plug-in, in short, is a plug-in that formulates indexing rules, such as SmartCN, which is a Chinese word segmentation plug-in that builds indexing based on Chinese (rather than English blanks) and indexing by sentence and word.
- Discovery plugins: Discovery plugins, in short. It's how the cluster finds its own servers. Officially, it's how to elect a major node in a cluster.
- The ingest plugins: The main function of this plug-in is to enhance the functionality of each node. For example, Ingest Attcahment Processor Plugin allows each node to decompress files and process file formats such as PPT, XLD, PDF.
- Management plugins: Management plugins, of course, interact with and manage ES (such as X-PACK)
- Mapper plugins: This plug-in mainly enhances the data type of ES. For example, add an attachment type, which can store PDF or WORD data.
- Scripting plugins: This plug-in essentially calls the user's script, so you can execute any program, for example, through this plug-in, support javascript language, python language, or any user-defined language or program.
- Security plugins: Provide security controls, of course, such as those API s that control which users can use ES
- Repository plugins: Provide snapshots and recovery, a simple understanding is that you put data on the server, others can access your data through shared folders, you can also restore your data through shared folders. At present, the core plug-ins of ES already support many access modes such as S3,HDFS, etc.
- Store plugins, we know that ES actually uses Lucene for storage. We can also use Store SMB.(windows Shared File Protocol)
1. Content Management System
- Drupal: Drupal is an open source content management framework (CMF) written in PHP language.
- Wp-Elastic search: ES's WordPress plug-in, WordPress, can use ES directly
- And Elastic search, Tiki Wiki Cms Groupware, XWIKI Next Generation Wiki
2. Data import, export and verification
- LogStash output to ES and ES input to LogStash
- ES event filtering in Logstash
- ES bulk codec
- JDBC importer: Importing jdbc's source data into ES
- Kafka Standalone consumer(Indexer): Importing kafka data into ES
- Mongolastic: Importing ES data into MongoDB
- Scrutineer: A Check Tool for Index and Content
- IMAP/POP3/MAIL importer: Import IMAP POP3 data into ES (mailbox data can also enter ES)
- FS Crawler: Index file systems (e.g. PDF, OPEN OFFICE.) Local, or through SSH
3. deployment
ES Provides Puppet Community Provides Chef
3. Framework integration
Or watch the official Internet bar directly https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/integrations.html#data-integrations
4.Hadoop integrations
4. Other Integration
pes: DSL queries supporting JS https://github.com/kodcu/pes
Second, the first PLUGIN program
Plug-ins are very simple. The code is as follows
- public class MyFirstPlugin extends Plugin{
- private final static Logger LOGGER = LogManager.getLogger(MyFirstPlugin.class);
- public MyFirstPlugin() {
- super();
- LOGGER.warn("This is my fisrt Plugin");
- }
- }
Add pomx.ml
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>mygroup1</groupId>
- <artifactId>myart1</artifactId>
- <version>5.2.2-SNAPSHOT</version>
- <name>Plugin: Basic</name>
- <description>Only for test</description>
- <properties>
- <elasticsearch.version>5.2.2</elasticsearch.version>
- <lucene.version>6.4.1</lucene.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.elasticsearch</groupId>
- <artifactId>elasticsearch</artifactId>
- <version>${elasticsearch.version}</version>
- <scope>provided</scope>
- </dependency>
- <!-- Testing -->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- <version>2.7</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>2.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.elasticsearch.test</groupId>
- <artifactId>framework</artifactId>
- <version>${elasticsearch.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-test-framework</artifactId>
- <version>${lucene.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <outputDirectory>${project.build.directory}/releases/</outputDirectory>
- <descriptors>
- <descriptor>${basedir}/src/main/assemblies/plugin.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>
Run the command mvn clean install
Get myart1-5.2.2-SNAPSHOT.zip file in release directory
Running in the ES directory
bin\elasticsearch-plugin install file:///D:/greesoft/elastic/myart1-5.2.2-SNAPSHOT.zip
The plug-in is installed.
There is a small pit here. Under windows. The directories installed in java usually have spaces. Here is a simple modification to the elastic search-plugin.bat file as follows
Set JAVA = D: jdk1.8.0_102 bin java.exe
Run ES. You can see the information we typed out.
Add pom.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>mygroup1</groupId>
- <artifactId>myart1</artifactId>
- <version>5.2.2-SNAPSHOT</version>
- <name>Plugin: Basic</name>
- <description>Only for test</description>
- <properties>
- <elasticsearch.version>5.2.2</elasticsearch.version>
- <lucene.version>6.4.1</lucene.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.elasticsearch</groupId>
- <artifactId>elasticsearch</artifactId>
- <version>${elasticsearch.version}</version>
- <scope>provided</scope>
- </dependency>
- <!-- Testing -->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- <version>2.7</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>2.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.elasticsearch.test</groupId>
- <artifactId>framework</artifactId>
- <version>${elasticsearch.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-test-framework</artifactId>
- <version>${lucene.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <outputDirectory>${project.build.directory}/releases/</outputDirectory>
- <descriptors>
- <descriptor>${basedir}/src/main/assemblies/plugin.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>