我主要在windows上使用Bash for subsystem,安装了docker for windows(版本17.06.0-ce-win19(12801))并设置为Linux容器。
我试图通过以下命令启动它
sudo docker run -d -p 9200 elasticsearch:2.3.5
如果我尝试通过bash上的curl访问它,或者找不到浏览器。我尝试了以下方法:
- docker logs e727aa95a49d
- [2017-07-30 01:07:50,114] [WARN] [bootstrap]无法安装系统调用过滤器:seccomp不可用:你的内核有问题 你应该升级
- [2017-07-30 01:07:50,296] [INFO] [节点] [Alysande Stuart]版本[2.3.5],pid [1], 构建[90f439f / 2016-07-27T10:36:52Z]
- [2017-07-30 01:07:50,296] [INFO] [节点] [Alysande Stuart]初始化......
- [2017-07-30 01:07:51,046] [INFO] [plugins] [Alysande Stuart]模块[reindex,lang-expression,lang-groovy], plugins [],sites []
- [2017-07-30 01:07:51,066] [INFO] [env] [Alysande Stuart]使用[1]数据路径,坐骑 [[/ usr / share / elasticsearch / data(/ dev / sda1)]],net usable_space [54.3gb],净total_space [58.8gb],旋转? [可能],键入s [ext4]
- [2017-07-30 01:07:51,066] [INFO] [env] [Alysande Stuart]堆大小[1007.3mb],压缩普通对象 指针[true]
- [2017-07-30 01:07:52,684] [INFO] [节点] [Alysande Stuart]初始化
- [2017-07-30 01:07:52,685] [INFO] [节点] [Alysande Stuart]首发......
- [2017-07-30 01:07:52,852] [INFO] [transport] [Alysande Stuart] publish_address {172.17.0.2:9300},bound_addresses {0.0.0.0:9300}
- [2017-07-30 01:07:52,857] [INFO] [发现] [Alysande Stuart] elasticsearch / TIf_RDG_SpqbfJ_rJmfizA
- [2017-07-30 01:07:55,920] [INFO] [cluster.service] [Alysande Stuart] new_master {Alysande Stuart} {TIf_RDG_SpqbfJ_rJmfizA} {172.17.0.2} {172.17.0.2:9300},原因: zen-disco-join(elections_as_master,[0]加入收到)
- [2017-07-30 01:07:55,972] [INFO] [http] [Alysande Stuart] publish_address {172.17.0.2:9200},bound_addresses {0.0.0.0:9200}
- [2017-07-30 01:07:55,972] [INFO] [节点] [Alysande Stuart]开始
- [2017-07-30 01:07:55,999] [INFO] [网关] [Alysande Stuart]将[0]索引恢复为cluster_state
答案 0 :(得分:1)
-p 9200
告诉Docker在Windows上找到任何可用的端口(比如32768
)并将其映射到9200
容器端口。
你需要这个:
sudo docker run -d -p 9200:9200 elasticsearch:2.3.5
使用-p 9200:9200
Docker将始终使用9200
,可以在您的localhost中使用localhost:9200