@SpringBootApplication
public class CommandLinetoolApplication {
@Value("${person.name}")
private String name;
public static void main(String... argv) {
SpringApplication.run(CommandLinetoolApplication.class, argv);
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用 Eclipse,因此将运行配置设置为
-Dspring-boot.run.arguments=--person.name=firstName
但是当运行我的应用程序时,我收到异常,因为“无法解析值“${person.name}”中的占位符“person.name”
这是我的 DockerFile :-
FROM openjdk:10
ENV AQUILA_HOME /data/config
#USER root
#VOLUME /tmp
ADD a2i-web-1.0.0-SNAPSHOT.jar app.jar
#RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","app.jar"]
Run Code Online (Sandbox Code Playgroud)
我的 jar 是 spring boot 应用程序,需要 postgres。我在本地安装了 portgres,它在我的本地主机上成功运行。我正在通过命令成功构建 DockerFile
sudo docker build -t djtijare/a2i-web:v1 .
Run Code Online (Sandbox Code Playgroud)
但是当通过命令运行它时
sudo docker run -p 8080:8080 -t djtijare/a2i-web:v1
Run Code Online (Sandbox Code Playgroud)
例外情况为:
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Run Code Online (Sandbox Code Playgroud)
我正在从包含 DockerFile 和我的 jar 的目录运行此 docker 命令,我需要设置任何配置来运行 postgres 吗?
我确实尝试过kubectl 描述节点masterNodeName,它给出的输出为:
Name: ip-172-28-3-142
Roles: master
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/arch=amd64
kubernetes.io/hostname=ip-172-28-3-142
kubernetes.io/os=linux
node-role.kubernetes.io/master=
Annotations: kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
node.alpha.kubernetes.io/ttl: 0
projectcalico.org/IPv4Address: 172.28.3.142/20
projectcalico.org/IPv4IPIPTunnelAddr: 192.163.119.24
volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp: Thu, 06 Jun 2019 04:10:28 +0000
Taints: <none>
Unschedulable: false
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
NetworkUnavailable False Sat, 24 Aug 2019 12:10:03 +0000 Sat, 24 Aug 2019 12:10:03 +0000 CalicoIsUp Calico is running on this node
MemoryPressure False Tue, 27 Aug 2019 14:08:19 +0000 Tue, 11 …Run Code Online (Sandbox Code Playgroud) 我运行命令 systemctl stop kubelet 然后尝试启动它 systemctl start kubelet
但无法启动
这是systemctl status kubelet的输出
kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
??10-kubeadm.conf
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-06-05 15:35:34 UTC; 7s ago
Docs: https://kubernetes.io/docs/home/
Process: 31697 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)
Main PID: 31697 (code=exited, status=255)
Run Code Online (Sandbox Code Playgroud)
因此,我无法运行任何 kubectl 命令
kubectl get pods给出的示例
The connection to the server 172.31.6.149:6443 was refused - did you specify the right …Run Code Online (Sandbox Code Playgroud) 如何在 PostgreSQL 11.2 的分区表上创建索引?
我的表是:
CREATE TABLE sometablename
(
column1 character varying(255) COLLATE pg_catalog."default" NOT NULL,
column2 integer NOT NULL,
column3 character varying(255) COLLATE pg_catalog."default" NOT NULL,
"timestamp" timestamp without time zone NOT NULL,
avg_val double precision,
max_val double precision,
min_val double precision,
p95_val double precision,
sample_count double precision,
sum_val double precision,
unit character varying(255) COLLATE pg_catalog."default",
user_id bigint NOT NULL,
CONSTRAINT testtable_pkey PRIMARY KEY (column1, column2, column3, "timestamp", user_id)
)
PARTITION BY HASH (user_id)
WITH (
OIDS = FALSE …Run Code Online (Sandbox Code Playgroud) 在 Eclipse 中打开报表设计视角时出现此异常。
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.birt.report.designer.ui.ide was unable to load class org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:198)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:934)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:282)
at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:230)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:322)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:300)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPart(CompatibilityEditor.java:66)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:1001)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:966)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:411)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:333)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1015)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:675)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:781)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:752)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:746)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) …Run Code Online (Sandbox Code Playgroud) 如何为计算引擎服务帐户或任何其他用户帐户创建和分配具有以下权限的角色
billing.accounts.get
billing.accounts.list
在设置权限时,我遇到了一个错误
Not applicable for project-level custom roles
These permissions can only be added to custom roles at the organization level; they have no effect at the project level or below.
billing.accounts.get
billing.accounts.getIamPolicy
billing.accounts.getPaymentInfo
billing.accounts.getSpendingInformation
billing.accounts.getUsageExportSpec
billing.accounts.list
billing.budgets.get
billing.budgets.list
billing.credits.list
billing.resourceAssociations.list
billing.subscriptions.get
billing.subscriptions.list
Run Code Online (Sandbox Code Playgroud)
编辑:也无法在组织级别设置。有同样的错误
API:https : //cloudbilling.googleapis.com
错误信息:-
You do not have sufficient permissions to view this page
There was an error while loading /iam-admin/iam?authuser=2&folder=&organizationId=1010102021615.
You are missing at least one of the following required permissions:
Organization …Run Code Online (Sandbox Code Playgroud) 我已经安装了postgres。如何打开postgres命令行?当我打开命令提示符时,我有
Microsoft Windows [Version 10.0.17134.590]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\dhanr>
Run Code Online (Sandbox Code Playgroud)
如何导航到 postgres 命令行,因为我的最终目标是运行pg_dump dbname > outfile命令。
我正在尝试使用String.replace(oldChar,newChar),但这将返回一个Changed字符串。例:
String tempString= "abc is very easy";
String replacedString=tempString.replace("very","not");
System.out.println("replacedString is "+replacedString);
System.out.println("tempString is "+tempString);
Run Code Online (Sandbox Code Playgroud)
输出:
replacedString is abc is not easy
tempString is abc is very easy
Run Code Online (Sandbox Code Playgroud)
所以我的问题是有什么方法可以替换字符串而不将其存储在另一个字符串中。
我想要输出
String tempString= "abc is very easy";
tempString.replace("very","not");
System.out.println("tempString is "+tempString);
Run Code Online (Sandbox Code Playgroud)
如
tempString is abc is not easy.
Run Code Online (Sandbox Code Playgroud)
通过使用替换功能。
java ×2
kubernetes ×2
postgresql ×2
amazon-eks ×1
aws-eks ×1
billing ×1
birt ×1
command-line ×1
docker ×1
dockerfile ×1
eclipse ×1
eclipse-rcp ×1
indexing ×1
kubeadm ×1
spring ×1
spring-boot ×1
windows ×1