我通过调用创建了以下持久卷
kubectl create -f nameOfTheFileContainingTheFollowingContent.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-monitoring-static-content
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/some/path"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv-monitoring-static-content-claim
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 100Mi
Run Code Online (Sandbox Code Playgroud)
在此之后我试图删除pvc.但这个命令卡住了.在打电话时kubectl describe pvc pv-monitoring-static-content-claim
我得到以下结果
Name: pv-monitoring-static-content-claim
Namespace: default
StorageClass:
Status: Terminating (lasts 5m)
Volume: pv-monitoring-static-content
Labels: <none>
Annotations: pv.kubernetes.io/bind-completed=yes
pv.kubernetes.io/bound-by-controller=yes
Finalizers: [foregroundDeletion]
Capacity: 100Mi
Access Modes: RWO
Events: <none>
Run Code Online (Sandbox Code Playgroud)
并为 kubectl describe pv pv-monitoring-static-content
Name: pv-monitoring-static-content
Labels: <none> …
Run Code Online (Sandbox Code Playgroud) 我的问题是来自URI-String的实体的反序列化.当我使用by Spring Data Rest生成的HTTP接口时,一切正常.我可以针对我的端点发布以下JSON /api/shoppingLists
,并将其反序列化为以admin为所有者的购物清单.
{
"name":"Test",
"owners":["http://localhost:8080/api/sLUsers/admin"]
Run Code Online (Sandbox Code Playgroud)
}
当我使用自定义RepositoryRestController时,这不再起作用.如果我将完全相同的JSON发布到同一个端点,我会收到此响应.
{
"timestamp" : "2015-11-15T13:18:34.550+0000",
"status" : 400,
"error" : "Bad Request",
"exception" : "org.springframework.http.converter.HttpMessageNotReadableException",
"message" : "Could not read document: Can not instantiate value of type [simple type, class de.yannicklem.shoppinglist.core.user.entity.SLUser] from String value ('http://localhost:8080/api/sLUsers/admin'); no single-String constructor/factory method\n at [Source: java.io.PushbackInputStream@9cad4d2; line: 1, column: 26] (through reference chain: de.yannicklem.shoppinglist.core.list.entity.ShoppingList[\"owners\"]->java.util.HashSet[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class de.yannicklem.shoppinglist.core.user.entity.SLUser] from String value ('http://localhost:8080/api/sLUsers/admin'); no single-String …
Run Code Online (Sandbox Code Playgroud) 我有有一个应用程序@EnableOAuth2Sso
上的WebSecurityConfigurerAdapter
添加@EnableOAuth2Sso
应用程序后,将我重定向到授权服务器,并允许在此授权服务器登录后进行访问.我也想提供API访问,所以我希望应用程序能够通过Authorization-Header传递一个accessstoken来访问我的资源
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
Run Code Online (Sandbox Code Playgroud)
我通过认证过滤器进行了调试,该过滤器与notice一起使用,@EnableOAuth2Sso
未检查Authorization-Header值.
之后我尝试创建自定义过滤器并将此过滤器添加到安全配置中
@Override
public void configure(HttpSecurity http) throws Exception {
http.addFilter(myCustomFilter)
...;
}
Run Code Online (Sandbox Code Playgroud)
但现在我得到以下例外:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 26 more
Caused by: org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:44)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:105)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$f0788cea.CGLIB$springSecurityFilterChain$5(<generated>)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$f0788cea$$FastClassBySpringCGLIB$$7e95689d.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:318)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$f0788cea.springSecurityFilterChain(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native …
Run Code Online (Sandbox Code Playgroud) java spring spring-security spring-boot spring-security-oauth2
我有一个使用Liquibase的基于Spring Boot 1.4.0的项目.
是否可以在liquibase完成后执行方法?
像Bean Post Processor这样的东西?
我想要做的是在应用程序以开发模式启动时向我的数据库添加一些数据.在开发模式下,应用程序使用内存中的h2数据库,因此liquibase必须先创建表,然后才能编写数据.
首先我对文件夹级共享库的理解:这是一个 groovy 脚本,我可以将其放置在存储库中我希望它使用的任何位置(即我的 Jenkinsfile 所在的位置)。
如果这是错误的,请告诉我。
我的问题:我怎样才能包含这个库。对于全局库,我可以使用@Library($libraryName)
导入以名称注册为全局库的库。但是对于文件夹级别的库,没有指定名称。我如何导入它们?我真的必须像这个答案中展示的那样指定 git repo吗?
我在/etc/init.d/中的一个shellcript中有这个命令
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$NAME.pid --background --exec /usr/bin/java -jar /home/username/myjar.jar
Run Code Online (Sandbox Code Playgroud)
如果我执行此操作,我会收到此错误
start-stop-daemon: unable to stat /usr/bin/java -jar /home/username/myjar.jar (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
如果我执行
/usr/bin/java -jar /home/username/myjar.jar
Run Code Online (Sandbox Code Playgroud)
在命令行一切都很好..我没有得到我的错误:(
当我为我的实体使用 Spring Data Rest 提供的默认控制器时,一切都会正常工作。输出如下所示:
{
"_links" : {
"search" : {
"href" : "http://localhost:8080/users/search"
}
},
"_embedded" : {
"users" : [ {
"firstName" : "Max",
"lastName" : "Mustermann",
"email" : "mail@max-mustermann.de",
"_links" : {
"self" : {
"href" : "http://localhost:8080/users/myadmin"
}
}
} ]
}
}
Run Code Online (Sandbox Code Playgroud)
但如果我使用自己的控制器,输出将如下所示:
[ {
"firstName" : "Max",
"lastName" : "Mustermann",
"email" : "mail@max-mustermann.de",
"links" : [ {
"rel" : "self",
"href" : "http://localhost:8080/user/myadmin"
} ]
} ]
Run Code Online (Sandbox Code Playgroud)
我的控制器
@RestController
@RequestMapping("/user")
@EnableHypermediaSupport(type = {HypermediaType.HAL}) …
Run Code Online (Sandbox Code Playgroud) 是否可以为Spring Oauth2 Sso服务设置默认登录成功?
继szenario之后
index.html
index.html
manifest
属性==>浏览器请求清单${sso.host}/login
${sso.host}/login
查询字符串中的代码有没有办法不重定向到受保护的上次请求的资源,但默认情况下重定向到'index.html'?
即使没有办法实现这一点,请告诉我
我有以下 nginx.conf
location /monitoring/prometheus/ {
resolver 172.20.0.10 valid=5s;
set $prometheusUrl http://prometheus.monitoring.svc.cluster.local:9090/;
proxy_set_header Accept-Encoding "";
proxy_pass $prometheusUrl;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
sub_filter_types text/html;
sub_filter_once off;
sub_filter '="/' '="/monitoring/prometheus/';
sub_filter 'var PATH_PREFIX = "";' 'var PATH_PREFIX = "/monitoring/prometheus";';
rewrite ^/monitoring/prometheus/?$ /monitoring/prometheus/graph redirect;
rewrite ^/monitoring/prometheus/(.*)$ /$1 break;
}
Run Code Online (Sandbox Code Playgroud)
当我导航到https://myHost/monitoring/prometheus/graph 时,我被重定向到 /graph ( https://myHost/graph )
当我不使用变量并将 url 直接放置到 proxy_pass 时,一切都按预期工作。我可以导航到https://myHost/monitoring/prometheus/graph并查看 prometheus。
location /monitoring/prometheus/ {
resolver 172.20.0.10 valid=5s;
proxy_set_header Accept-Encoding "";
proxy_pass http://prometheus.monitoring.svc.cluster.local:9090/; …
Run Code Online (Sandbox Code Playgroud) 我知道有3个问题有类似的异常消息.不幸的是,没有一个问题得到解答,评论无法解决我的问题.
我在Windows 10系统上使用64位版本的Octave 4.2.1,总共16 GB RAM和运行时大约11 GB空闲.当我尝试将60000 x 10矩阵乘以10 x 60000矩阵时,Octave会出现以下异常:
错误:内存不足或维度对于Octave的索引类型而言太大
这种乘法将产生60000 x 60000矩阵,因此对于64位索引应该不是问题.我甚至做不到zeros(60000,60000);
我不明白我做错了什么.有人能指出我正确的方向吗?
首先是一些数据说明:
指标名称:query_seconds_count
示例值:
query_seconds_count{correlation_id="someUUID",instance="someIp:Port",job="someJob",query_type="query",segment="overall"}
Run Code Online (Sandbox Code Playgroud)
我想做的事:
delta(query_seconds_count[1m])
Run Code Online (Sandbox Code Playgroud)
问题:
每个查询的标签correlation_id
都是唯一的,因此没有机会找到匹配的相关 ID 来计算增量。因此 Delta 始终为 0。有没有办法correlation_id
在计算 Delta 时忽略标签?
我读到了有关关键字的信息ignoring
,without
但by
它们似乎不适用于 delta 函数。
可能的解决方法
我可以使用它来解决 delta 函数,但这看起来不太优雅。
sum(query_seconds_count) without (correlation_id) - sum(query_seconds_count offset 1m) without (correlation_id)
Run Code Online (Sandbox Code Playgroud) 我正在使用Bosch IoT Suite的权限服务。
我在生成代理凭据时遇到问题。我需要指定什么步骤和参数来生成代理凭证?我正在尝试创建一个代理凭据,该凭据可以自动激活新创建的用户帐户。
java ×6
spring ×5
prometheus ×2
spring-boot ×2
debian ×1
hal-json ×1
iot ×1
jackson ×1
jar ×1
jenkins ×1
json ×1
kubernetes ×1
liquibase ×1
matrix ×1
memory ×1
nginx ×1
octave ×1
permissions ×1
proxypass ×1
service ×1
spring-data ×1
windows ×1