Spring Boot Micro-service fails Kerberos Authentication when deployed on Pivotal Cloud Foundry Platform

↘锁芯ラ 提交于 2019-12-01 12:46:59

问题


We have developed a Spring Boot Application to query data from Hbase on HDP 2.5.
The application works fine when we run it on our local windows machines as it is able to find the jaas.conf & krb5.conf file which have been kept under resources folder of the application and we have provided them as system properties in our code as e.g.
System.setProperties("javax.security.auth.useSubjectCredsOnly","false"); System.setProperty("java.security.krb5.conf","D:\\host\\workspace\\projectname\\src\\main\\resources\\krb5.conf");

However when we deploy in PCF it is unable to read those file which are set as system properties.

Question
What is the way to set environment variables in PCF ?
How do we place files in PCF so that they are available to the classpath of an application ?


回答1:


You can specify an environment variable in your deployment manifest file. Here are the details.

This is assuming your jar file was packaged with krb5.conf file.

The other option is to use Config Server. Here is an introduction on Spring Cloud Config



来源:https://stackoverflow.com/questions/46425342/spring-boot-micro-service-fails-kerberos-authentication-when-deployed-on-pivotal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!