ES 启动:bin/elasticsearch -d
ES 关闭:
ps -ef | grep elastic
让全网访问 elasticsearch
修改 elasticsearch.yml
将 network.host 设置为 0.0.0.0
问题二:ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
解决:切换到 root 用户,编辑 limits.conf 添加类似如下内容
vi /etc/security/limits.conf
添加如下内容:
- soft nofile 65536
- hard nofile 131072
- soft nproc 2048
- hard nproc 4096
问题三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
解决:切换到 root 用户,进入 limits.d 目录下修改配置文件。
vi /etc/security/limits.d/90-nproc.conf
修改如下内容:
- soft nproc 1024
#修改为 - soft nproc 2048
问题四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决:切换到 root 用户修改配置 sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
注意:jvm.options
-Xms512m
-Xmx512m
需要一致
ES 更新 Mapping,
- curl -XPUT localhost:9200/my_index/my_type/_mapping -d '
- {
-
"my_type": {
-
"properties": {
-
"created": {
-
"type": "multi_field",
-
"fields": {
-
"created": { "type": "string" },
-
"date": { "type": "date" }
-
}
-
}
-
}
-
}
- }
新建 Mapping:
http://172.31.20.50:9200/apm_collector_3 PUT
{
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 1
}
}
}
新建
http://172.31.20.50:9200/apm_collector_3/raw_http_transaction/_mapping?pretty
{
"raw_http_transaction": {
"properties": {
"app_data": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"app_id": {
"type": "long"
},
"bytes_received": {
"type": "long"
},
"bytes_sent": {
"type": "long"
},
"create_time": {
"type": "date"
},
"device_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"error_code": {
"type": "long"
},
"http_method": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"remote_ip": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"session_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_app_version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_area": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_carrier": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_country": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_device_model": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_host": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_os_version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_url_path": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stats_wan_type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"status_code": {
"type": "long"
},
"total_time": {
"type": "float"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于