我一直在使用Kafka 2.4.0 (2.11),昨天由于某种未知原因我不得不强行终止该进程。从那以后,由于以下错误,我一直无法启动 Zookeeper:
[2020-01-11 11:12:43,783] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.io.IOException: No snapshot found, but there are log entries. Something is broken!
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:222)
at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:240)
at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:290)
at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:450)
at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:764)
at org.apache.zookeeper.server.ServerCnxnFactory.startup(ServerCnxnFactory.java:98)
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:144)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:106)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)
Run Code Online (Sandbox Code Playgroud)
一旦我搜索了这个问题,我就发现了ZOOKEEPER-3513报告的问题,这可能会也可能不会解释问题。但是,我发现奇怪的是,如果我删除 Kafka/Zookeeper 目录并从头开始重新下载,问题仍然存在。有谁知道我该如何解决这个问题?
感谢您的帮助
我的代码如下:
import pandas as pd
import numpy as np
df = pd.read_csv("path/to/my/infile.csv")
df = df.sort_values(['distance', 'time'])
df.to_csv("path/to/my/outfile.csv")
Run Code Online (Sandbox Code Playgroud)
此代码成功从 infile.csv(一个 3GB csv 文件)读取数据,对其进行排序,但在尝试写入 outfile.csv 时失败,并出现以下错误:
OSError Traceback (most recent call last)
<ipython-input-10-3a5c8279658d> in <module>
----> 1 df.to_csv('/Users/joaomatos/Desktop/cluster22_sorted_training.csv',index=False)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/frame.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, tupleize_cols, date_format, doublequote, escapechar, decimal)
1743 doublequote=doublequote,
1744 escapechar=escapechar, decimal=decimal)
-> 1745 formatter.save()
1746
1747 if path_or_buf is None:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/io/formats/csvs.py in save(self)
164 encoding=encoding,
165 compression=self.compression) …Run Code Online (Sandbox Code Playgroud) 我经常观察到容器IP在运行时发生了变化,因此我想知道这些事件是否会产生任何后果,特别是当它涉及集群中的Cassandra容器时.
是否有任何预防措施需要考虑或Docker是否解决了所有问题?
例如,由于容器IP更改,是否可能将容器群集节点视为死节点?如果没有Docker,我们可以使用-Dcassandra.replace_address选项来解决死节点替换,以指定old_ip现在是new_ip,我是否需要对Docker执行相同的操作?
感谢您的时间
最近我看到nodetool status显示以下消息:
Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless
Run Code Online (Sandbox Code Playgroud)
我想知道这意味着什么以及是否表明存在任何问题。
感谢您的关注
我要求在容器构建期间从AWS S3下载文件,但是我没有向构建过程提供AWS凭证但没有在Dockerfile中实际对其进行硬编码的情况下未能成功。我得到错误:
泊坞窗致命错误:无法找到凭据
尽管以前执行过:
AWS配置
而且,我不能为此目的使用--build-arg。
我的问题:是否可以在构建时拥有这些凭证,而无需在Dockerfile中对其进行硬编码,如果可以,怎么办?
感谢您的关注。
我是 kubernetes 的新手,我正在尝试使用 Kops 在 aws 中创建一个新集群。不幸的是,如果不指定 dns-zone,我似乎无法继续,当我出于相同目的使用 docker-machine 和 docker swarm 等工具时,我从未需要这样做。此外,我不需要也不想要 Route53 之类的服务。
因此,我的问题是如何在 aws 中创建 kubernetes 集群而不必担心 dns 区域和路由 53?
谢谢
简而言之:使用AmazonS3Client连接到 的本地实例MinIO会导致抛出异常UnknownHostException,因为 url 已解析为http://{bucket_name}.localhost:port。
问题详细描述:
我正在为使用 AmazonS3Client lib 从 S3 检索内容的 Java 服务创建集成测试。我在测试容器中使用 MinIO 来执行 Amazon S3 的角色,如下所示:
@Container
static final GenericContainer<?> minioContainer = new GenericContainer<>("minio/minio:latest")
.withCommand("server /data")
.withEnv(
Map.of(
"MINIO_ACCESS_KEY", AWS_ACCESS_KEY.getValue(),
"MINIO_SECRET_KEY", AWS_SECRET_KEY.getValue()
)
)
.withExposedPorts(MINIO_PORT)
.waitingFor(new HttpWaitStrategy()
.forPath("/minio/health/ready")
.forPort(MINIO_PORT)
.withStartupTimeout(Duration.ofSeconds(10)));
Run Code Online (Sandbox Code Playgroud)
然后我使用如下方式动态导出其 url(因为测试容器部署在随机端口):
String.format("http://%s:%s", minioContainer.getHost(), minioContainer.getFirstMappedPort())
Run Code Online (Sandbox Code Playgroud)
这又会产生这样的 url:
http://localhost:54123
Run Code Online (Sandbox Code Playgroud)
我在测试运行时遇到的问题在于实际实现中AmazonS3Client.getObject(String,String)- 创建请求时,它执行以下验证( class S3RequestEndpointResolver, method resolveRequestEndpoint):
...
if (shouldUseVirtualAddressing(endpoint)) {
request.setEndpoint(convertToVirtualHostEndpoint(endpoint, bucketName));
request.setResourcePath(SdkHttpUtils.urlEncode(getHostStyleResourcePath(), true));
} else {
request.setEndpoint(endpoint); …Run Code Online (Sandbox Code Playgroud) 我被要求为现有的 SpringBoot 项目创建集成测试,该项目的组织不像我希望的那样模块化。例如,有一个包生成与所有服务关联的所有存储库。这成为一个问题,对我来说,当我试图创建一个@WebMvcTest测试片,因为当我使用@ComponentScan,@EnableJpaRepositories,@EntityScan看我的目标类它结束了扫描共享同一包中的所有其他不必要的。
由于更改项目结构并不是我自己可以做出的决定,我的问题是是否有可能让我的测试扫描选择一个特定的类并忽略同一个包中的所有其他类?
感谢您的关注
我的广告连播具有以下配置:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-app
labels:
app: my-app
spec:
serviceName: my-app
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
restartPolicy: Never
containers:
- name: my-app
image: myregistry:443/mydomain/my-app
imagePullPolicy: Always
Run Code Online (Sandbox Code Playgroud)
And it deploys fine without the restartPolicy. However, I do not want the process to be run again once finished, hence I added the 'restartPolicy: Never'. Unfortunately I get the following error when I attempt to deploy:
Error from server (Invalid): error when creating …Run Code Online (Sandbox Code Playgroud) file.txt 多次出现“dummy”一词,目标是用新颖的 UUID 替换每次出现的此类词。
我想知道是否有使用单行命令的解决方案,但如果没有,我想要最简单的 bash 脚本。例如,符合以下条件的内容:
sed -i "s/dummy/$(uuidgen)/g" file.txt
Run Code Online (Sandbox Code Playgroud)
不幸的是,这个命令用相同的 uuid 替换每个单词“dummy”。
例如
输入:
{
{"myid":"dummy"},
{"myid":"ymmud"},
{"myid":"dummy"},
{"myid":"ymmud"},
{"myid":"dummy"},
{"myid":"ymmud"}
}
Run Code Online (Sandbox Code Playgroud)
预期输出:
{
{"myid":"79769E7B-BED5-4CB5-AEF9-CCE445D9212E"},
{"myid":"ymmud"},
{"myid":"F2FDDD4A-4800-4F0F-911A-FEDBC82915DD"},
{"myid":"ymmud"},
{"myid":"52D93565-81E9-479C-8BD9-457754581BBE"},
{"myid":"ymmud"}
}
Run Code Online (Sandbox Code Playgroud) docker ×3
amazon-s3 ×2
cassandra ×2
java ×2
kubernetes ×2
apache-kafka ×1
bash ×1
csv ×1
kops ×1
minio ×1
pandas ×1
python ×1
spring-boot ×1
testing ×1
uuid ×1