how to access kafka with acl in my storm jar? - apache-storm

Before I use kafka with no any SASL or ACL,it works fine, now i built SASL_PLAINTEXT for my kafka cluster,how to access my kafka cluster in my storm jar?
My storm version:1.1.0
Kafka version:0.10.1
I use HDP-2.6.3.0-235
any suggestions would be helpful.thanks

These are the steps I followed to get storm running with kafka in a secured environment
1.You need to use hdp specific dependencies for storm to enable the security protocol property
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.extrepo</id>
<name>Hortonworks HDP</name>
<url>http://repo.hortonworks.com/content/repositories/releases</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.other</id>
<name>Hortonworks Other Dependencies</name>
<url>http://repo.hortonworks.com/content/groups/public</url>
</repository>
</repositories>
and then include the hdp specific dependency for storm[change it as per your hdp version]
<storm-core.version>1.1.0.2.6.2.37-3</storm-core.version>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>${storm-core.version}</version>
<scope>provided</scope>
</dependency>
2.Now you need use the security protocol property while creating spouts(it will not be availaible unless using hdp specific repo)
spoutCfg.securityProtocol = "SASL_PLAINTEXT";
3.Use acl command on your topic by giving the appropriate storm user
bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:storm-user --allow-principal User:zriskcanvas --consumer --producer --group=* --topic testTopic
4.Make sure the storm jaas-conf is getting passed to each node with the user mentioned in ACL

Related

Spring Data MongoDB v3.x

The documentation has details of migration from 2.x to 3.x https://docs.spring.io/spring-data/mongodb/docs/current-SNAPSHOT/reference/html/#upgrading.2-3
However, i cannot find the 3.x maven dependency https://mvnrepository.com/artifact/org.springframework.data/spring-data-mongodb
The latest available is only 2.2.6.RELEASE
Is 3.x not available as of now?
The Spring Data Neumann Release is not GA yet. Please have a look at the wiki for more information on the planned timeline.
Release candidates and snapshot builds are available via repo.spring.io.
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>spring-milestones</id>
<name>libs-milestone</name>
<url>https://repo.spring.io/libs-milestone</url>
</repository>
<repository>
<snapshots />
<id>spring-snapshots</id>
<name>libs-snapshot</name>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>

spring data lovelace m3 and spring boot 2.0

I am using spring boot 2.0.5-RELEASE, and trying to use spring data Lovelace-M3 for it's MongoDB transaction support with MongoTransactionManager class, i added the lovelace-m3 dependency with release train repository as follow :
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Lovelace-M3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-libs-release</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
But maven doesn't download the jar of lovealace, only the pom, can't find anywhere lovelace classes. I don't know what i am missing here.
Milestone version does not publish on https://repo.spring.io/libs-release.
Please add the following code into your ...
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Also, if you need to use milestones plugin, you can add the following code:
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Spring boot 2.0 does not support Spring data lovelace, if someone want to enjoy MongoDB 4 Transaction feature he needs to wait for Spring boot 2.1 unfortunately.
See : https://github.com/spring-projects/spring-boot/issues/14644

Difference between repository and pluginrepository

My Android Maven project pom.xml contains the following entries. Now everything works fine. What is the difference between <repositories> entries and the <pluginRepositories> entries.
<repositories>
<repository>
<id>my-repo</id>
<url>http://10.10.10.230:8081/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>my-repo</id>
<name>my-repo</name>
<url>http://10.10.10.230:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
As #otakun85 stated, There is no technical difference at all. It's for having different configurations->behavior for plugins in contrary to normal artifacts. See repository vs. pluginRepository for more details.
Also check maven-users mailing list archives, It provides quite good explanation to it.
Maven will resolve plugin dependencies using the configured pluginRepository. Other artifact dependencies (eg. a parent pom) are resolved using repository.
Note: Things available on maven central will be resolved by default so you wouldn't normally need to include repository for those.
For example, if your pom.xml specifies a parent pom and a plugin dependency that both exist in the same repository you must still specify both repository AND pluginRepository. If you only configure one then maven will complain with "Unresolvable X" errors.

Twitter4j via maven - classes are missing

I have integrated twitter4j into my project via maven, using the depndencies / repositories as shown on the twitter4j homepage :
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>[2.2,)</version>
</dependency>
..
<repository>
<id>twitter4j.org</id>
<name>twitter4j.org Repository</name>
<url>http://twitter4j.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Unfortunately, not all resourcesfrom the twitter4j core project are available in my project. For example, the interface "StatusListener" is not.
Can maybe someone give me a hint what is wrong?
Looks like the twitter4j.StatusListener class moved to the twitter4j-stream artifact in version 2.2.0. Add it to your dependency list.

Maven repository lookup order

We have an internal Apache Archiva based repository and we have configured the repositories tag in pom.xml to be as follows. Can I assume that all dependency access will get resolved by internal repository if you have access to it and will get resolved by other repositories listed below, if internal repository is down for a certain reason.
<repositories>
<repository>
<id>internal</id>
<name>Internal Repository</name>
<url>http://192.168.1.2/archiva/repository/internal</url>
</repository>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
....
</repositories>
EDIT:
I want to do away with the .m2/settings.xml file. I want to define this in my pom.xml file, so that if my repository manager is UP and running I would want the runtime to connect there, else would want to fallback into the other repositories. Would this be possible?
Maven 3.0 had it fixed as you can see in Maven developer's Jira below. The lookup will be done in the order they are declared.
https://issues.apache.org/jira/browse/MNG-4400

Resources