小编Bha*_*tel的帖子

为什么我的Kubernetes服务在不同的子网上运行?

我使用服务名称有一个Spring Boot和PostgreSQL通信问题.

我使用Calico创建了一个用于网络的集群,如下所示:

sudo kubeadm init --pod-network-cidr=192.168.0.0/16  --apiserver-advertise-address=178.12.1.10
Run Code Online (Sandbox Code Playgroud)

并使用上述命令生成的输出连接到worker节点.

当我部署pod和服务时,两者都在不同的子网上运行.我错过了什么吗?

kubectl get svc
Run Code Online (Sandbox Code Playgroud)
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
backend-service     ClusterIP      10.110.149.43   <none>        8091/TCP      12s
postgres            ClusterIP      10.108.1.52     <none>        5432/TCP      14m
Run Code Online (Sandbox Code Playgroud)

未生成服务端点.

kubectl get endpoints
Run Code Online (Sandbox Code Playgroud)
NAME                   ENDPOINTS             AGE

backend-service                              20m
postgres               <none>                21m
Run Code Online (Sandbox Code Playgroud)
kubectl get pods --all-namespaces
Run Code Online (Sandbox Code Playgroud)
default       backend-service-6dbd64ff4d-gqkq8           0/1     CrashLoopBackOff   12         57m
default       postgres-7564bcc778-578fx                  1/1     Running            0          57m
kube-system   calico-etcd-b7wqf                          1/1     Running            1          2d3h
kube-system   calico-kube-controllers-74887d7bdf-wxhkd   1/1     Running            1          2d3h
kube-system   calico-node-689b5                          0/1     Running            0          47h
kube-system   calico-node-smkq5                          0/1 …
Run Code Online (Sandbox Code Playgroud)

postgresql spring-boot kubernetes kubectl kubeadm

6
推荐指数
1
解决办法
463
查看次数

无法使用带有参数的构造函数NO_CONSTRUCTOR在MongoDB中实例化com.fasterxml.jackson.databind.node.ObjectNode

在此输入图像描述我正在使用JsonNode从任何类型的jason格式获取数据并将其存储到mongoDb但是当从mongoDB获取数据时,它会抛出错误,如下所示.

Failed to instantiate com.fasterxml.jackson.databind.node.ObjectNode using constructor NO_CONSTRUCTOR with arguments

下面是我的域类

public class Profiler {

 @Id
 private String id;

@Field("email")
private String email;

@Field("profiler")
private Map<String,JsonNode> profiler;

public String getEmail() {
    return email;
}
public void setEmail(String email) {
    this.email = email;
}
public Map<String, JsonNode> getProfiler() {
    return profiler;
}
public void setProfiler(Map<String, JsonNode> profiler) {
    this.profiler = profiler;
}
public Profiler(String email,Map<String,JsonNode> profiler){
    this.email=email;
    this.profiler = profiler;
}
@JsonCreator
public Profiler(@JsonProperty("_id")String id,@JsonProperty("email")String email,@JsonProperty("profiler")Map<String,JsonNode> profiler){
    this.id=id;
    this.email=email;
    this.profiler = …
Run Code Online (Sandbox Code Playgroud)

spring json mongodb

5
推荐指数
1
解决办法
1420
查看次数

如何使用POI + Java获取数据透视表最后填充行号.-version 3.12.x

我有一张包含两张纸的Excel表格.一个是数据表,第二个是数据表.

在包含数据透视表的Excel工作表中获取最后一行编号时遇到问题.
我正在使用-version 3.12.x poi.

我试过了areaRef.getLastCell().getCol();,newSheet.getLastRowNum();还有pivotTable.getDataSheet().getPhysicalNumberOfRows()其他现有的方法.但我没有得到正确的价值.它返回数据表的最后一个记录而不是数据表.

有人知道如何在数据透视表中获得最后一个填充行号吗?

java excel apache-poi

4
推荐指数
1
解决办法
340
查看次数