我已经按照aws doc扩展了弹性根音量,
并将我的根卷大小从8 GB增加到20 GB,我确认使用了它lsblk.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 20G 0 disk
??xvda1 202:1 0 8G 0 part /
但更新后的大小没有反映在df -h命令中,即使我使用sudo resize2fs /dev/xvda1命令显式调整设备大小,因为我ext4使用sudo file -s /dev/xvd*命令检查了我的文件系统类型.sudo resize2fs /dev/xvda1命令给出以下输出: -
sudo resize2fs/dev/xvda1 resize2fs 1.42.12(29-Aug-2014)文件系统已经是2096635(4k)块长.没事做!
让我知道,我需要为操作系统做些什么来获取我的音量大小.
谢谢
我很确定这是因为版本不匹配,所以我共享我的所有 pom 文件,当我在必须使用 cognito 的模块之一中工作时,我有项目模块,我添加了依赖项并将所有其他更改为新版本因为 cognito 不支持旧版本,但现在在另一个模块中,我收到此错误
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.109</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1201-jdbc41</version>
</dependency>
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>2.2.0</version>
<exclusions>
<exclusion>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.6</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency> …Run Code Online (Sandbox Code Playgroud) 我有一个执行器服务,我提交多个线程做一些工作,现在我想取消/中断一些线程的执行,让我知道我怎么能这样做?
例如: - 下面是我的Thread类,它在无限间隔一段时间后打印线程名称.
public class MyThread implements Runnable {
String name;
public MyThread(String name) {
this.name = name;
}
@Override
public void run() {
try {
System.out.println("Thread "+ name + " is running");
sleep(500);
}catch (InterruptedException e){
System.out.println("got the interrupted signal");
e.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
现在我将通过给它们命名来创建多个线程,以便稍后我可以中断该特定线程并停止执行.
现在在我的Test类中,我创建了4个线程,并希望停止执行名为amit和k的2个线程.
public class ThreadTest {
public static void main(String[] args) {
ExecutorService executorService = Executors.newCachedThreadPool();
MyThread amit = new MyThread("amit");
MyThread k = new MyThread("k");
MyThread blr = new …Run Code Online (Sandbox Code Playgroud) 我在下面的代码,我试图在使用字符串打印所有匹配Matcher.group().
public static void main(String[] args) {
String s = "foo\r\nbar\r\nfoo"
+ "foo, bar\r\nak = "
+ "foo, bar\r\nak = "
+ "bar, bar\r\nak = "
+ "blr05\r\nsdfsdkfhsklfh";
//System.out.println(s);
Matcher matcher = Pattern.compile("^ak\\s*=\\s*(\\w+)", Pattern.MULTILINE)
.matcher(s);
matcher.find();
// This one works
System.out.println("first match " + matcher.group(1));
// Below 2 lines throws IndexOutOfBoundsException
System.out.println("second match " + matcher.group(2));
System.out.println("third match " + matcher.group(3));
}
Run Code Online (Sandbox Code Playgroud)
上面的代码在线程"main"中抛出异常java.lang.IndexOutOfBoundsException:No group 2 Exception.
所以我的问题是如何Matcher.group()工作和你可以看到我将有3个匹配的字符串,我怎么能用它打印所有这些group().
最近安装了Elasticsearch 7.3.2后,发现绑定localhost或者127.0.0.1后,服务器运行正常。
但是我使它可供外部使用,即在特定 IP 或 0.0.0.0 上,它引发了我的错误并停止了服务器:
绑定或发布到非环回地址,强制执行引导程序检查 [2019-09-19T18:21:43,962][ERROR][oebBootstrap] [MARFEEN] 节点验证异常 [1] 引导程序检查失败
我必须实现超过 500,000 个名字的自动完成,这些名字以后可能会增加到超过 400 万个名字。
后端是使用 Spring 的 Java REST Web 服务调用。我应该使用 MongoDB、 Redis还是 Elasticsearch 来存储和查询/搜索名称?
我可以使文档不可变吗?当文档提交给同一个 id 时,它们不会被重写吗?
POST "localhost:9200/index001/_doc/1" // First time it is created
'
{
"stuff": {
}
}
'
POST "localhost:9200/index001/_doc/1" // Fails
'
{
"otherstuff": {
}
}
'
Run Code Online (Sandbox Code Playgroud)
elastic 的 _version 字段可以帮助解决这个问题吗?
删除 /var/lib/elasticseach 后:此处更正
我不得不删除它,因为我在尝试从索引搜索时遇到了一些错误,并且一些 stackoverflow 答案指出最好删除数据路径并重新启动 Elasticsearch。
我在 centos 上,正在尝试为 laravel scout 配置它。
当我尝试做诸如PUT /index或GET /_cluster/health?pretty我得到的事情时
{
"error": {
"root_cause": [
{
"type": "master_not_discovered_exception",
"reason": null
}
],
"type": "master_not_discovered_exception",
"reason": null
},
"status": 503
}
Run Code Online (Sandbox Code Playgroud)
这是我的elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish …Run Code Online (Sandbox Code Playgroud) 我们有一个每秒向 ES 集群添加数千个文档的应用程序。每次我们滚动正在写入的索引并开始写入新索引时,我们都会收到以下错误,这些错误不允许在大约 1 分钟内摄取文档。1 分钟后,一切都会恢复正常,直到我们再次滚动索引。
[WARN ][o.e.c.s.MasterService ] [NODE_NAME_1] took [28.3s], which is over [10s], to compute cluster state update for [put-mapping[_doc, _doc, ...
[DEBUG][o.e.a.a.i.m.p.TransportPutMappingAction] [NODE_NAME_1] failed to put mappings on indices [[[INDEX_1/SOME_ID]]], type [_doc]
org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException: failed to process cluster event (put-mapping) within 30s
at org.elasticsearch.cluster.service.MasterService$Batcher.lambda$onTimeout$0(MasterService.java:143) [elasticsearch-7.5.2.jar:7.5.2]
at java.util.ArrayList.forEach(ArrayList.java:1507) [?:?]
at org.elasticsearch.cluster.service.MasterService$Batcher.lambda$onTimeout$1(MasterService.java:142) [elasticsearch-7.5.2.jar:7.5.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:703) [elasticsearch-7.5.2.jar:7.5.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:830) [?:?]
Run Code Online (Sandbox Code Playgroud)
在第一行中,我在末尾添加了省略号,因为它实际上相当大,这是我们所看到的图像(正如您在图像中看到的那样,该行突然结束):
您知道这些错误消息是关于什么的吗?
我们是否有可能因为集群状态太大而看到这些消息?这是否意味着我们有太多的分片或节点?
谢谢。
笔记:
我是 ES7 的新手,正在尝试了解乐观并发控制。
我想我明白,当我获取请求一个文档并将其_seq_no和_primary_term值在稍后的写入请求中发送到同一文档时,如果值不同,则写入将被完全忽略。
但是,在我不发送 和 _seq_no值的默认情况下,文档会发生什么情况_primary_term?_seq_no即使它具有较旧的_primary_term值(因此使索引不一致),写入也会继续进行,还是仅在值较新时才被处理?
如果是前者,文档最终会保持一致吗?
我试图弄清楚我是否需要发送这些值以获得最终的一致性,或者我是否可以免费获得它而不发送这些值。
multithreading distributed-system eventual-consistency optimistic-concurrency elasticsearch
java ×3
amazon-ebs ×1
amazon-ec2 ×1
autocomplete ×1
linux ×1
mongodb ×1
redis ×1
regex ×1
ubuntu ×1
versioning ×1