spring cloud config with native file - spring-cloud-config

when config files changed,the config server did not reload the changes.
It can't monitor the native file changes or something wrong?
spring:
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/conf/, classpath:/conf/licensingservice/
enter image description here

Since that your configuration are packed in your jar if you change a configuration since that it is saved in your classpath the server do not see the modification.
A better option is save these config in an other place outside the classpath.
you can use a configuration like below:
spring:
application:
name: configserver
cloud:
config:
server:
native:
searchLocations: file://${LOCAL_REPO}
in this way you can pilot the place with the environment variable LOCAL_REPO.
Of course I suggest you for the production to move the configuration repository to a git repository that it is a more suitable production ready choice.
I hope that this can help you

Related

node red cannot GET /myfile from directory

I would like to ask.
I have file in C:\users\nxf68958\.Node-red\report.html
And when I would like to open this file by: localhost:1880/report.html
I get:
Cannot GET /report.html
in Log I have: "Nov 09:52:00 - [info] User directory : \Users\nxf68958\.node-red"
I am using:
NR: 3.0.2
Node: 18.12.0
It worked perfectly on older versions of: NR: 2.2 and Node: 16.13.
Then I actualized and it stopped working.
In settings.js is option: "fileWorkingDirectory" I tried to change it, but without change.
What I am doing wrong?
Thank you
Node-RED will not serve static files by default, you have to explicitly enable it by settings the httpStatic option in the settings.js file.
Settings the httpStatic value to point to the userDir (which is what you have basically done by setting it to __dirname) is a bad idea from a security point of view because this means anybody can download your flows.json and flows_creds.json files and the files like settings.js and .config.runtime.json (which holds the default encryption key for the creds file).
fileWorkDirectory is purely to set the default working directory for the code nodes that interact with the filesystem, it will have no effect on what files are served by the HTTP server.

Cannot find Lando apache default config files

I'm using Lando to create a local development server for a Laravel project with the recipe below in .lando.yml
name: projectname
recipe: laravel
config:
php: '7.3'
composer_version: '2.0.7'
via: apache:2.4
webroot: .
database: mysql:5.7
cache: none
xdebug: false
config:
server: lando/httpd.conf
I need to add a few lines to a custom httpd.conf so I specify a path server: lando/httpd.conf. However, I couldn't locate the current default httpd.conf in order to make a copy and use it as a custom file. The link provided on Lando official site doesn't seem to work.
Did you try looking in the apache2 foler in the container?
$lando ssh
$cd /etc/apache2

How can I use Akka.NET lighthouse with hyperion

Currently I'm using the akka.net lighthouse docker image which is on dockerhub. Together with Akka.Bootstrap.Docker it's nice to override akka hocon configuration from the environment variables. I've set the following environment variables in my k8s deployment file
- name: AKKA__ACTOR__SERIALIZERS__HYPERION
value: "\"Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion\""
- name: AKKA__ACTOR__SERIALIZATION-BINDINGS__System__Object
value: hyperion
But if I want to enable hyperion serialization it fails with the following message:
The type name for serializer 'hyperion' did not resolve to an actual Type: 'Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion'
The documentation of Akka.NET Lighthouse is very scarce so does anyone of you know how I can use hyperion serialization with Akka.NET lighthouse?
Akka.NET is trying to load hyperion serializer via Type.GetType("Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion") call, and fails to do that, because Lighthouse docker image does not include Akka.Serialization.Hyperion package.
So what you need to do is:
Clone Lighthouse repo and add Akka.Serialization.Hyperion package to Lighthouse project references
Build your own docker image and use it instead.

Janus Graph Remote Graph NoSuchFieldError: V3_0 error

I follow this example;
https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-examples/example-remotegraph
and I would like to debug this project, I configured(HBase+Solr) and run Janus Graph server with
$JANUSGRAPH_HOME/bin/gremlin-server.sh $JANUSGRAPH_HOME/conf/gremlin-server/gremlin-server.yaml
command.
I passed this argument to IDEA via Run Configuration > Program Arguments
[Project Home]/conf/jgex-remote.properties
my jgex-remote.properties file is:
gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
# cluster file has the remote server configuration
gremlin.remote.driver.clusterFile=[Project Home]/conf/remote-objects.yaml
# source name is the global graph traversal source defined on the server
gremlin.remote.driver.sourceName=g
and my remote-objects.yaml file includes:
hosts: [127.0.0.1]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
config: {
ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
}
}
It tries to run this command:
cluster = Cluster.open(conf.getString("gremlin.remote.driver.clusterFile"));
And throws this exception:
Exception in thread "main" java.lang.NoSuchFieldError: V3_0 at
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0.(GryoMessageSerializerV3d0.java:41)
at
org.apache.tinkerpop.gremlin.driver.ser.Serializers.simpleInstance(Serializers.java:77)
at
org.apache.tinkerpop.gremlin.driver.Cluster$Builder.(Cluster.java:472)
at
org.apache.tinkerpop.gremlin.driver.Cluster$Builder.(Cluster.java:469)
at
org.apache.tinkerpop.gremlin.driver.Cluster.getBuilderFromSettings(Cluster.java:167)
at
org.apache.tinkerpop.gremlin.driver.Cluster.build(Cluster.java:159)
at org.apache.tinkerpop.gremlin.driver.Cluster.open(Cluster.java:233)
at
com.ets.dataplatform.init.RemoteGraphApp.openGraph(RemoteGraphApp.java:72)
at com.ets.dataplatform.init.GraphApp.runApp(GraphApp.java:290) at
com.ets.dataplatform.init.RemoteGraphApp.main(RemoteGraphApp.java:195)
It is not meaningful for me.
Thanks in advance.
I would try to align your versions. I assume that you are using JanusGraph 0.2.0. If you look at the pom.xml for that version you'll see that it is bound to TinkerPop 3.2.6:
https://github.com/JanusGraph/janusgraph/blob/v0.2.0/pom.xml#L68
Change to that version in your application and see if the connection works. Taking that approach should not only fix your problem but also ensure that you don't run into other incompatibilities. That is not to say that you can't configure later versions of TinkerPop to work with 3.2.6, but it requires a bit more configuration and you have to be aware of minor changes that might affect how certain operations might behave.

Playframework 2.5 and Intellij IDEA

I am using IDEA for my Playframework development. However, I don't seem to be able to run/debug my application anymore I was able to do two months ago. I haven't done any active development on this project, and there have been updates to IDEA.
When I now debug my application it doesn't not load the 'dev' configuration file.
This is specified as -Dconfig.resource=application.dev.conf under JVM options on the Run/Debug configurations.
This used to work fine, but it now loads the application.conf which contains the default db parameters to connect to a MySQL server and not the mem server. I don't think I have changed anything. A ny pointers what can be wrong?
I am still on sbt-plugin 2.5.16.
[Edit]
Loading config from properties {jline.esc.timeout=0, config.resource=application.dev.conf, java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib, java.vm.version=25.25-b02, user.country.format=IE, gopherProxySet=false, java.vm.vendor=Oracle Corporation, java.vendor.url=http://java.oracle.com/, path.separator=:, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, file.encoding.pkg=sun.io, user.country=GB, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, user.dir=/Users/xxx/Documents/Java/Y2kBooking, java.runtime.version=1.8.0_25-b17, java.awt.graphicsenv=sun.awt.CGraphicsEnvironment, java.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/endorsed, os.arch=x86_64, java.io.tmpdir=/var/folders/6g/mllv8zcn73v3p9mgt8f78jd80000gn/T/, line.separator=
, java.vm.specification.vendor=Oracle Corporation, os.name=Mac OS X, sun.jnu.encoding=UTF-8, java.library.path=/Users/xxx/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., jboss.modules.system.pkgs=com.intellij.rt, java.specification.name=Java Platform API Specification, java.class.version=52.0, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, os.version=10.13.2, http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, user.home=/Users/xxx, user.timezone=Europe/Dublin, java.awt.printerjob=sun.lwawt.macosx.CPrinterJob, java.specification.version=1.8, file.encoding=UTF-8, user.name=xxx, java.class.path=/Users/xxx/Library/Application Support/IntelliJIdea2017.3/Scala/launcher/sbt-launch.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Users/xxx/Library/Caches/IntelliJIdea2017.3/captureAgent/debugger-agent.jar, jline.shutdownhook=false, java.vm.specification.version=1.8, sun.arch.data.model=64, java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre, sun.java.command=xsbt.boot.Boot run, java.specification.vendor=Oracle Corporation, user.language=en, awt.toolkit=sun.lwawt.macosx.LWCToolkit, config.trace=loads, java.vm.info=mixed mode, java.version=1.8.0_25, java.ext.dirs=/Users/xxx/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java, sun.boot.class.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/classes:/Users/xxx/Library/Caches/IntelliJIdea2017.3/captureAgent/debugger-agent-storage.jar, java.vendor=Oracle Corporation, file.separator=/, java.vendor.url.bug=http://bugreport.sun.com/bugreport/, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeBig, socksNonProxyHosts=local|*.local|169.254/16|*.169.254/16, ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, sun.cpu.isalist=}
Loading config from class loader sbt.PluginManagement$PluginClassLoader#4cc89246 but there were no resources called application.dev.conf
exception loading application.dev.conf: java.io.IOException: resource not found on classpath: application.dev.conf
Loading config from a String akka {
log-dead-letters = 0
log-dead-letters-during-shutdown = off
}
Loading config from resource 'reference.conf' URL jar:file:/Users/xxx/.ivy2/cache/scala_2.10/sbt_0.13/com.typesafe.sbt/sbt-js-engine/jars/sbt-js-engine-1.1.3.jar!/reference.conf from class loader sbt.PluginManagement$PluginClassLoader#4cc89246
Loading config from a URL: jar:file:/Users/xxx/.ivy2/cache/scala_2.10/sbt_0.13/com.typesafe.sbt/sbt-js-engine/jars/sbt-js-engine-1.1.3.jar!/reference.conf
Try debugging the configuration loading with -Dconfig.trace=loads as described here.
The -Dconfig.resource option loads a file from the classpath so make sure that file is in your IntelliJ classpath. I assume you put the file in the usual conf directory? You may need to check the IntelliJ Project Structure settings to make sure it includes that directory as a Resource Folder.
Finally, you may wish to check that the application works correctly when run using sbt run or sbt start.