springboot第63集:Netty,docker,elasticsearch,kibana一文让你走出微服务迷雾架构周刊

科技   其他   2024-03-05 21:05   广东  
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
docker pull elasticsearch:7.17.1
docker pull kibana:7.17.1
docker run -d --name elasticsearch  -p 9200:9200 -p 9300:9300 -e  "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms256m -Xmx256m" elasticsearch:7.17.1

docker pull elasticsearch:7.17.1
docker pull kibana:7.17.1
docker run -d --name elasticsearch  -p 9200:9200 -p 9300:9300 -e  "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms3g -Xmx3g" elasticsearch:7.17.1

docker ps

CONTAINER ID   IMAGE                  COMMAND                  CREATED          STATUS          PORTS                                            NAMES

3d668e6cae1d   elasticsearch:7.17.1   "/bin/tini -- /usr/l…"   46 seconds ago   Up 44 seconds   0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp   elasticsearch

mkdir -p /data/elasticsearch/{config,data,logs,plugins}
mkdir -p ./data/elasticsearch/{config,data,logs,plugins}
yml

docker cp elasticsearch:/usr/share/elasticsearch/config /data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/logs /data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/data /data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/plugins /data/elasticsearch

docker cp elasticsearch:/usr/share/elasticsearch/config /Users/jeskson/data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/logs /Users/jeskson/data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/data /Users/jeskson/data/elasticsearch
docker cp elasticsearch:/usr/share/elasticsearch/plugins /Users/jeskson/data/elasticsearch

vi ./data/elasticsearch/config/elasticsearch.yml

cluster.name: "docker-cluster"
network.hosts:0.0.0.0
# 跨域
http.cors.allow-origin: "*"
http.cors.enabled: true
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

docker stop elasticsearch
docker rm elasticsearch

docker run -d --name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms256m -Xmx256m" \
-v /data/elasticsearch/logs:/usr/share/elasticsearch/logs \
-v /data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
elasticsearch:7.17.1

docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -v ./data/elasticsearch/logs:/usr/share/elasticsearch/logs -v ./data/elasticsearch/data:/usr/share/elasticsearch/data -v ./data/elasticsearch/plugins:/usr/share/elasticsearch/plugins -v ./data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml elasticsearch:7.17.1


docker run -d --name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms256m -Xmx256m" \
-v /Users/jeskson/data/elasticsearch/logs:/usr/share/elasticsearch/logs \
-v /Users/jeskson/data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /Users/jeskson/data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /Users/jeskson/data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
elasticsearch:7.17.1

docker run -d --name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms1g -Xmx1g" \
-v /Users/jeskson/data/elasticsearch/logs:/usr/share/elasticsearch/logs \
-v /Users/jeskson/data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /Users/jeskson/data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /Users/jeskson/data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
elasticsearch:7.17.1
image.png
image.png
docker run -d --name kibana -p 5601:5601 kibana:7.17.1

mkdir -p /data/kibana/config
docker cp kibana:/usr/share/kibana/config /data/kibana/

mkdir -p ./data/kibana/config
docker cp kibana:/usr/share/kibana/config /Users/jeskson/data/kibana/

vim /data/kibana/config/kibana.yml

  
# # ** THIS IS AN AUTO-GENERATED FILE ** # # Default Kibana configuration for docker target server.host: "0" server.shutdownTimeout: "5s" elasticsearch.hosts: [ "http://localhost:9100" ] # 记得修改ip monitoring.ui.container.elasticsearch.enabled: true i18n.locale: "zh-CN"

docker stop kibana 
docker rm kibana

docker run -d --name kibana -p 5601:5601 -v /Users/jeskson/data/kibana/config:/usr/share/kibana/config kibana:7.17.1

访问kibana发现需要token 进入es容器获取token

docker exec -it {elastic_search_container_id} /bin/bash bin/elasticsearch-create-enrollment-token --scope kibana

docker exec -it elasticsearch /bin/bash

elasticsearch-setup-passwords auto

找到你的 Elasticsearch 配置文件(通常位于 /etc/elasticsearch/elasticsearch.yml),然后确保以下配置被正确设置:

xpack.security.enabled: true

重新启动 Elasticsearch:保存修改后,重新启动 Elasticsearch 服务以使配置生效。你可以使用以下命令重启 Elasticsearch:

systemctl restart elasticsearch

curl -XGET "http://localhost:9200/_security/_authenticate?pretty"

root@bd8e7cc3d03e:/usr/share/elasticsearch/bin# elasticsearch-setup-passwords auto Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user. The passwords will be randomly generated and printed to the console. Please confirm that you would like to continue [y/N]y

image.png

在本地就能看到拷贝出来的kibana.yml文件

vim /data/kibana/config/kibana.yml

修改配置为


# ** THIS IS AN AUTO-GENERATED FILE **
#
 
# Default Kibana configuration for docker target
server.host: "0"
server.shutdownTimeout: "5s"
elasticsearch.hosts: [ "http://localhost:9100" ] # 记得修改ip
monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: "zh-CN"
elasticsearch.username: elastic
elasticsearch.password: ""

停掉旧的

docker stop kibana

docker rm kibana

重新启动挂载了地址的新的容器

docker run -d --name kibana -p 5601:5601 -v /Users/jeskson/data/kibana/config:/usr/share/kibana/config kibana:7.17.1

image.png
image.png
image.png
image.png
image.png
image.png
image.png
**Closed.**  This question is [not about programming or software development](https://stackoverflow.com/help/closed-questions). It is not currently accepting answers.  
闭。这个问题与编程或软件开发无关。它目前不接受答案。

* * *

This question does not appear to be about [a specific programming problem, a software algorithm, or software tools primarily used by programmers](https://stackoverflow.com/help/on-topic). If you believe the question would be on-topic on [another Stack Exchange site](https://stackexchange.com/sites), you can leave a comment to explain where the question may be able to be answered.  
这个问题似乎不是关于特定的编程问题、软件算法或程序员主要使用的软件工具。如果您认为该问题将在另一个 Stack Exchange 站点上成为主题,您可以发表评论以解释在哪里可以回答该问题。

Closed 10 months ago. 10个月前关闭。

[Improve this question  
改进此问题](https://stackoverflow.com/posts/58011088/edit)

I have just installed Kibana 7.3 on RHEL 8. The Kibana service is active (running).  
我刚刚在 RHEL 7.3 上安装了 Kibana 8。Kibana 服务处于活动状态(正在运行)。  
I receive `Kibana server is not ready yet` message when i curl to [http://localhost:5601](http://localhost:5601/). My Elasticsearch instance is on another server and it is responding with succes to my requests. I have updated the kibana.yml with that  
当我卷曲到 http://localhost:5601 时,我会收到 `Kibana server is not ready yet` 消息。我的 Elasticsearch 实例位于另一台服务器上,它正在响应我的请求并成功响应。我已经更新了kibana.yml

> elasticsearch.hosts:["[http://EXTERNAL-IP-ADDRESS-OF-ES:9200](http://external-ip-address-of-es:9200/)"]  
> elasticsearch.hosts:[“http://EXTERNAL-IP-ADDRESS-OF-ES:9200”]
image.png
image.png
image.png
image.png
image.png

http://127.0.0.1:9100/?auth_user=elastic&auth_password=

http://localhost:5601/app/home

docker run -d \
--name=elasticsearch-head \
-p 9100:9100 \
mobz/elasticsearch-head:5-alpine

docker run -d --name=elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5-alpine
image.png

磁盘使用率超过洪水水位,索引有只读允许删除块];;

加群联系作者vx:xiaoda0423

仓库地址:https://github.com/webVueBlog/JavaGuideInterview

算法猫叔
程序员:进一寸有一寸的欢喜
 最新文章