我已经用docker compose设置了elasticsearch和kibana。 elasticsearch部署在 private void doPhotoPrint() {
if (imageLoader == null) {
imageLoader = new GlideImageLoader(this);
}
if (!IMG_PATH.isEmpty()) {
imageLoader.bindImageAsBitmap(null,FileUtils.validateFileUrl(IMG_PATH),new RequestListener<Bitmap>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e,Object model,Target<Bitmap> target,boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(Bitmap resource,DataSource dataSource,boolean isFirstResource) {
return false;
}
},new Simpletarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource,@Nullable Transition<? super Bitmap> transition) {
activity activity = ShareImgactivity.this;
if (resource != null && AppUtils.isValidContext(activity)) {
PrintHelper photoPrinter = new PrintHelper(activity);
photoPrinter.setScaleMode(PrintHelper.SCALE_MODE_FIT);
photoPrinter.printBitmap(getString(R.string.app_name) + "_Print",resource);
}
}
},Priority.IMMEDIATE);
}
}
上,而kibana部署在localhost:9200
当尝试通过docker run部署metricbeat时,出现以下错误:
localhost:5601
我的docker-compose.yml:
$ docker run docker.elastic.co/beats/metricbeat:6.3.2 setup -E setup.kibana.host=kibana:5601 -E output.elasticsearch.hosts=["localhost:9200"]
Exiting: Couldn't connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch http://localhost:9200: Get http://localhost:9200: dial tcp [::1]:9200: connect: cannot assign requested address]
Exiting: Couldn't connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch http://elasticsearch:9200: Get http://elasticsearch:9200: lookup elasticsearch on 192.168.65.1:53: no such host]