How to connect eclipse IDE to apache Ignite? - spring

I have written Ignite hello world program in Eclipse and want to connect it to localhost(127.0.0.1). But it is giving me error for example "ignite.xml file path is invalid"
I am starting ignition as follows,
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {}
But I got error like:
Spring XML configuration path is invalid: examples/config/example-ignite.xml.
How do I fix it?

You have the following options:
Provide the absolute file path.
Set IGNITE_HOME system property or environment variable, put the file in this folder and provide the path relative to the home.
Add the configuration file on classpath under META-INF and provide the path relative to it.
The last option is usually the most convenient for the applications with an embedded Ignite node.

Related

spring.flyway.locations property is unable to read files from specified location in kubernetes

I am using flyway script to migrate the database.
In my project setup I have dev env scripts in the default location : /db/migration/
Also a specific location (under root) for pp scripts: /my_app/flyway_pp/
application-preprod.properties
spring.flyway.baseline-on-migrate = true
spring.flyway.locations=filesystem:/my_app/flyway-pp
My application runs as a image in kubernetes cluster. I have checked using classpath: and filesystem: both. But nothing is getting picked up from flyway_pp folder and instead it is picking up from default location always /db/migration/.
My doubt is may be in the kubernetes env it is not able to resolve the path correctly.
But what should I do in this case.

Spring Cloud Config Server Not picking changes

I am trying to setup spring config cloud using local file system.
Below is my config on cloud server.
server.port=8888
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=classpath:/
Bootstrap.properties on client app is as shown below
spring.application.name=hello-world
spring.cloud.config.uri=http://localhost:8888
management.endpoints.web.exposure.include=*
I have also created hello-world.yml on class path for the hello-world spring boot application with property, test: Hello World
Followed below steps to make use of config server.
Step 1: Update the config file and start cloud config server. Able to
see config http://localhost:8888/hello-world/default
Step 2: Start client app hello-world, client app able to read the
test property file from cloud config server.
Step 3: Make changes to config by updating test: Good Bye on
hello-world.yaml.
At this moment, if I check
http://localhost:8888/hello-world/default ,it still shows old value.
Step 4: Run /actuator/refresh on client app. But it won't detect
any change on config server.
The new changes are reflected only if I restart the cloud config server.
Is there any configuration issue causing the cloud config server to unable to listen to changes ?
I could see o.s.cloud.commons.util.InetUtils : Cannot determine local hostname INFO log on cloud config app.
First of all I followed the same exact steps you followed and got the same issue, after almost day of search and study on the matter found out the followings,
we shouldn't use classpath:/<whatever> for
spring.cloud.config.server.native.searchLocations
because when we use so and build the project and run the location refers to the directory inside the generated .jar file, so we will not be able to update it in runtime.
To confirm this you can stop config server, open you .jar archive and delete hello-world.yml file then try http://localhost:8888/hello-world/default you will get default null responses
So we have to use some other locations for spring.cloud.config.server.native.searchLocations either with full directory path or just directory from app running location
Examples
For full path in windows use file:///full-path
spring.cloud.config.server.native.searchLocations: file:///E:\configs
Just for a directory (which will search project root directory if you running from IDE, if running jar then target directory or jar location spring.cloud.config.server.native.searchLocations: configs
spring.cloud.config.server.native.searchLocations: configs\whatever
we can configure multiple locations too as follows, spring.cloud.config.server.native.searchLocations: file:///E:\configs, configs

Springboot 2.2.5 and logging in file

i'm don't find the way to logging in file with spring 2.2.5
I tried in the application.properties
logging.file.name=C:/log/app.log
or
logging.file.path=C:/log
But everytime it created the file, but don't write anything in.
Why ? I don't find any tutorial on web which work
You can set the absolute path with following code
logging.path=D:\logs\logfile.txt
If the folder doesn't exist it gets created. On Windows you have to work with \ as seperator, while on Linux and Mac you need / as seperator. Check create dir and write permission on specified path.
You should either specify logging.file or logging.path, but not both ( when both are specified, logging.path is ignored and only logging.file is considered).

Kafka installation - classpath is empty

I try to install kafka on my windows(8), and it's not work.
I download kafka and extract it on c:\kafka after it i change the server.properties and zookeeper.properties.
I set in those file the logs path.
I even try to download an tun zookeper outside the kafka install but the zookeeper runing and the kafka not.
the Error that i get when i try to run this command is:
bin\windows\zookeeper-server-start.bat .config\zookeeper.properties
and this is the result:
Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'
The solutions is to Download the binary jar file.
go to config\server.properties and config\zookeeper.properties and change the folder. the new folder need to be write with / and not .
and after it you need to got the main folder and run the command:
bin\windows\zookeeper-server-start.bat config\zookeeper.properties
without the . before "config\zookeeper.properties"
I have provided the answer for the similar error here, check this out.
https://i-am-jabi.medium.com/fixing-classpath-is-empty-69288c1509a2
Here are the steps to resolve the issue:
Open kafka-run-class.bat file. You will find this in bin\windows folder of your confluent Kafka.
Search for “rem Classpath addition for core” in kafka-run-class.bat file. When you find it, it looks like below.
Now lets add the below snippet above the “rem Classpath addition for core” line in kafka-run-class.bat file.
rem classpath addition for LSB style path
if exist %BASE_DIR%\share\java\kafka\* (
call:concat %BASE_DIR%\share\java\kafka\*
)
After adding the above snippet, your file will look like this.
Now, when you run the bat files under windows folder, they will run fine without any issues. Here is the zookeeper start log after fixing the classpath error.

how do I change the location of the httpd.conf for Apache on windows?

I am working on setting up a load balancing cluster on windows server 2012 and have a shared drive where I want the configuration files for Apache to exist at. This way each member of the LB can load the exact same config files. How do I change where the config file is located independently of where the ServerRoot is?
Start the Apache process with the -d parameter and give your alternative ServerRoot as an argument, though I'd imagine it would be a much better idea for you to use some mechanism to sync the files locally to each server.
Also read http://httpd.apache.org/docs/2.4/mod/core.html#mutex, as it's advised if you're running from a networked file system.
If you just want to specify the main config file, start the process with the -f parameter and the path to the config file as an argument.

Resources