Я развернул службу cassandra 3.11 в openshift (OpenShift Web Console) Через переадресацию портов я должен подключиться к службе cassandra через мой локальный терминал.oc port-forward cassandra-0 9042: 9042 cqlsh -u cassandra -p cassandra Я хочу получить доступ к сервису cassandra через приложение Springboot.Для этого я использую файл свойств ниже.
spring.data.cassandra.contact-points=cassandra-0.cassandra-1:9042,cassandra-1.cassandra-1:9042,cassandra-2.cassandra-1:9042
#spring.data.cassandra.port=9042
spring.data.cassandra.username=cassandra
spring.data.cassandra.password=cassandra
spring.data.cassandra.cluster-name=cassandra
When I am trying to run springboot application through above property file I am getting below error
org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework /boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate forg.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrad: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate /autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate /autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org. springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cassandraTemplate' defined in class path resource [o rg/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'cassandraTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession' defined in class path resource [org/springframework /boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host cassandra.b360—non—prod.svc/10.128.16.156:9042: Host cassandra.b360— non—prod.svc/10.128.16.156:9042 requires authentication, but no authenticator found in Cluster configuration 2019-02-12 00:59:50.026 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-02-12 00:59:50.141 WARN 1 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [cluster1— connection—reaper-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: