当前位置: 首页 > 知识库问答 >
问题:

Kibana没有连接到elasticsearch docker

松茂实
2023-03-14

麋鹿堆叠码头工人的新手。

正在尝试在docker中本地设置麋鹿设置。

使用的命令是

docker network create elasticnew --driver=bridge
docker run --network=elasticnew --name elasticsearchnode -p 9200:9200 -p 9300:9300 docker.elastic.co/elasticsearch/elasticsearch:6.6.1
docker run --network=elasticnew --name kibana -e ELASTICSEARCH_URL=http://elasticsearchnode:9200 -p 5601:5601 docker.elastic.co/kibana/kibana:6.6.1

ElasticSeach是向上和http://localhost:9200/是给json响应。

但是kibana url(http://localhost:5601/)说“Kibana服务器还没有准备好”,请求在浏览器中继续旋转。

在查询docker容器时,它说,

CONTAINER ID:76fe82529fa9       
IMAGE:docker.elastic.co/kibana/kibana:6.6.1                                                      
CREATED:16 minutes ago
STATUS:Up 15 minutes 
PORTS:0.0.0.0:5601->5601/tcp                                            
NAMES:kibana

编辑调查结果:-

1.最初是命令

docker logs kibana 

立即给出空洞的回应。后来发出这个命令,以指数形式回复(5分钟后也看不到日志)

2.浏览器中的localhost:9200也会复制上述行为。(看起来好像kibana正在忙着弹性搜索)

3.检查了kibana容器,它还说状态为“正在运行”。特此也共享日志。

C:\Windows\system32>docker inspect kibana
[
{
    "Id": "da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52",
    "Created": "2019-02-25T18:39:43.1796454Z",
    "Path": "/usr/local/bin/kibana-docker",
    "Args": [],
    "State": {
        "Status": "running",
        "Running": true,
        "Paused": false,
        "Restarting": false,
        "OOMKilled": false,
        "Dead": false,
        "Pid": 3398,
        "ExitCode": 0,
        "Error": "",
        "StartedAt": "2019-02-25T18:39:48.7600134Z",
        "FinishedAt": "0001-01-01T00:00:00Z"
    },
    "Image": "sha256:b94222148a00695eb94bcf9fe5cce02547ffd963531709de15187bf8ade13ea0",
    "ResolvConfPath": "/var/lib/docker/containers/da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52/resolv.conf",
    "HostnamePath": "/var/lib/docker/containers/da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52/hostname",
    "HostsPath": "/var/lib/docker/containers/da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52/hosts",
    "LogPath": "/var/lib/docker/containers/da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52/da312a8bfbe5e47586ac7539f124500945663a0bad61d029a72147c0ead44a52-json.log",
    "Name": "/kibana",
    "RestartCount": 0,
    "Driver": "overlay2",
    "Platform": "linux",
    "MountLabel": "",
    "ProcessLabel": "",
    "AppArmorProfile": "",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": null,
        "ContainerIDFile": "",
        "LogConfig": {
            "Type": "json-file",
            "Config": {}
        },
        "NetworkMode": "elasticnew",
        "PortBindings": {
            "5601/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "5601"
                }
            ]
        },
        "RestartPolicy": {
            "Name": "no",
            "MaximumRetryCount": 0
        },
        "AutoRemove": false,
        "VolumeDriver": "",
        "VolumesFrom": null,
        "CapAdd": null,
        "CapDrop": null,
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": null,
        "GroupAdd": null,
        "IpcMode": "shareable",
        "Cgroup": "",
        "Links": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "SecurityOpt": null,
        "UTSMode": "",
        "UsernsMode": "",
        "ShmSize": 67108864,
        "Runtime": "runc",
        "ConsoleSize": [
            30,
            120
        ],
        "Isolation": "",
        "CpuShares": 0,
        "Memory": 0,
        "NanoCpus": 0,
        "CgroupParent": "",
        "BlkioWeight": 0,
        "BlkioWeightDevice": [],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteIOps": null,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "Devices": [],
        "DeviceCgroupRules": null,
        "DiskQuota": 0,
        "KernelMemory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "OomKillDisable": false,
        "PidsLimit": 0,
        "Ulimits": null,
        "CpuCount": 0,
        "CpuPercent": 0,
        "IOMaximumIOps": 0,
        "IOMaximumBandwidth": 0,
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ]
    },
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/156be4deb6525acdb0b6b32d757c5da721271aa61010fac1c3bdc89e8793d63d-init/diff:/var/lib/docker/overlay2/7afef12f62d8f016bd357422310f4cf3cf58f5b66b4bc03294684e970682a71f/diff:/var/lib/docker/overlay2/e86e9fc46fd2c18605165003912fd99161c6826dea9650fe3f7c591a06a13529/diff:/var/lib/docker/overlay2/a7e09d4df14208f4b48adf12b155a4ba0c1fb2ce5f66e2f4c2e2f2c6f030b9e2/diff:/var/lib/docker/overlay2/aaf3b5122fcff237d0f90bfe3d6ba778c4ff036f6d00db5aa6d301083038026d/diff:/var/lib/docker/overlay2/497685f1ed275b7ad5b6ca23beb3840542abb8e5ba38ac51d9b8fb20ec007c4b/diff:/var/lib/docker/overlay2/532a837d610aaeb5c0e5b98a2dc4df1d899a46559b8e4429ff14a25b5ba60c9a/diff:/var/lib/docker/overlay2/b94ac41fbb4f0941a19161f1d3289d218de10fc36c2037d0667249caf65e049b/diff:/var/lib/docker/overlay2/c9fe17bf9817837aec687bf5e14eeb1e9997ef92c4873c8cd9355d57a75aa71c/diff:/var/lib/docker/overlay2/6e3558bcf051abf5cf3066775f43e81d565158e3b2a9cb817a501b47bc7679a5/diff",
            "MergedDir": "/var/lib/docker/overlay2/156be4deb6525acdb0b6b32d757c5da721271aa61010fac1c3bdc89e8793d63d/merged",
            "UpperDir": "/var/lib/docker/overlay2/156be4deb6525acdb0b6b32d757c5da721271aa61010fac1c3bdc89e8793d63d/diff",
            "WorkDir": "/var/lib/docker/overlay2/156be4deb6525acdb0b6b32d757c5da721271aa61010fac1c3bdc89e8793d63d/work"
        },
        "Name": "overlay2"
    },
    "Mounts": [],
    "Config": {
        "Hostname": "da312a8bfbe5",
        "Domainname": "",
        "User": "1000",
        "AttachStdin": false,
        "AttachStdout": true,
        "AttachStderr": true,
        "ExposedPorts": {
            "5601/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "ELASTICSEARCH_URL=http://elasticsearchnode:9200",
            "PATH=/usr/share/kibana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "ELASTIC_CONTAINER=true"
        ],
        "Cmd": [
            "/usr/local/bin/kibana-docker"
        ],
        "ArgsEscaped": true,
        "Image": "docker.elastic.co/kibana/kibana:6.6.1",
        "Volumes": null,
        "WorkingDir": "/usr/share/kibana",
        "Entrypoint": null,
        "OnBuild": null,
        "Labels": {
            "license": "Elastic License",
            "org.label-schema.build-date": "20181205",
            "org.label-schema.license": "GPLv2",
            "org.label-schema.name": "kibana",
            "org.label-schema.schema-version": "1.0",
            "org.label-schema.url": "https://www.elastic.co/products/kibana",
            "org.label-schema.vcs-url": "https://github.com/elastic/kibana-docker",
            "org.label-schema.vendor": "Elastic",
            "org.label-schema.version": "6.6.1"
        }
    },
    "NetworkSettings": {
        "Bridge": "",
        "SandboxID": "3bb18d0b036874dabdc526080d6cf25ac3e53147b7b2fd44ce77ce58b6104900",
        "HairpinMode": false,
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "Ports": {
            "5601/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "5601"
                }
            ]
        },
        "SandboxKey": "/var/run/docker/netns/3bb18d0b0368",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null,
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "MacAddress": "",
        "Networks": {
            "elasticnew": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "da312a8bfbe5"
                ],
                "NetworkID": "d6e0ffb7617a1a2dd4f1a15c10f7255ed560c980ad6ccf1fb573a292d4515a9c",
                "EndpointID": "91359e830287666cf834372691e2761ea239450c832551360af5b7870546a869",
                "Gateway": "172.19.0.1",
                "IPAddress": "172.19.0.3",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "02:42:ac:13:00:03",
                "DriverOpts": null
            }
        }
    }
}
]

为那些大圆木感到遗憾。

PS:我使用Win 10 Enterprise,6GB内存,运行kibana和elastic search docker容器后,内存使用率接近70%及以上。

有人能在这里分享一些意见吗

  1. 为什么kibana无法与弹性搜索连接

共有2个答案

越英韶
2023-03-14

不幸的是,以下技巧奏效了。

  1. 删除mobylinux虚拟机并启动docker
  2. 使用kibana和docker的6.6.0版本

这使得kibana在浏览器中的5601端口响应。

将尝试删除mobylinux并尝试6.6.1版本。

欢迎提出任何建议。

沈宏朗
2023-03-14

在我的情况下,问题是由于我的容器命名。。。请注意此处的名称elasticsearch:

docker run -d --name elasticsearch --net elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.4.0

docker run -d --name kibana --net elasticsearch -p 5601:5601 kibana:7.4.0

我给这个容器起了另一个名字,kibana抱怨它无法连接。将其更改为elasticsearch,然后等待大约1分钟,等待kibana创建索引并安装插件。

只需查看kibanas的日志,直到它显示“服务器在http://0:5601运行”

docker logs kibana
 类似资料:
  • 我正在尝试使用Kubernetes 1.7.12 fluentd elasticsearch插件:https://github.com/kubernetes/kubernetes/tree/v1.7.12/cluster/addons/fluentd-elasticsearch ElasticSearch启动并可以响应: 但Kibana仍然无法连接到它。连接错误始于: ElasticSearch启

  • 问题内容: 我已经在RHEL7上安装了ES 7.5和Kibana 7.5,但是在启动Kibana并检查UI后,我看到了错误,“ Kibana服务器尚未准备好。” 检查Kibana日志,我发现它没有正确连接到ES。任何帮助表示赞赏! 这是 journalctl –unit kibana 的输出: Elasticsearch.yml Kibana.yml 另外,当我运行 ss -tunlp | gre

  • 我已经在RHEL7上安装了ES 7.5和Kibana 7.5,但是在启动Kibana并检查UI之后,我看到了错误,“Kibana服务器还没有准备好。” 检查Kibana日志,我看到它没有正确连接到ES。感谢任何帮助! 以下是journalctl的输出——单位kibana: 弹性搜索。yml 基巴纳。yml 此外,当我在Kibana启动期间运行ss-tunlp|grep 5601时,我看到Kiban

  • 问题内容: 我已经在服务器上安装了Kibana 5.4和Elastic search 5.4,我可以通过使用本地计算机上的curl来访问Kibana和Elastic search 我得到以下回应 var hashRoute =’/ app / kibana’; var defaultRoute =’/ app / kibana’; var hash = window.location.hash;

  • 我已经在服务器上安装了Kibana 5.4和Elastic search 5.4,我可以使用 我得到以下回应 var hashRoute='/app/kibana'; var defaultRoute='/app/kibana'; var hash=window.location.hash; if(hash.length){window.location=hashRoute hash;}其他{wi

  • 请注意,这个问题看起来可能是这个问题的重复,但事实并非如此。下面我包括我的理性 我正在尝试将Sleuth / Zipkin跟踪添加到我的项目中。为此,我遵循了本教程。 我的项目已经在使用RabbitMQ在工作正常的不同微服务之间进行通信。 我的问题是,当我使用web连接时,我能够很好地获得跟踪,但当我尝试使用RabbitMQ通信时,我会遇到无法连接错误。 正如第一行评论的那样,我的问题似乎与rab