首页 文章

在谷歌应用引擎flex上进行Elasticsearch部署

提问于
浏览
4

是否可以使用docker镜像在App engine flex环境中部署Elasticsearch .

我在本地计算机上尝试了以下My文件

文件夹:elasticsearch

app.yaml
Dockerfile
docker-entrypoint.sh
config folder(containing elasticsearch.yml)file

app.yaml的内容

runtime: custom 
env: flex

https://github.com/GoogleCloudPlatform/elasticsearch-docker/tree/master/5/5.2.0复制Dockerfile和docker-entrypoint.sh

对Dockerfile的修改

replaced EXPOSE 9200 9300 to EXPOSE 8080

对elasticsearch.yml的修改

cluster.name: "beaconinside-docker-cluster"
path.data: /usr/share/elasticsearch/data
http.host: 0.0.0.0
http.port: 8080
discovery.zen.minimum_master_nodes: 1

我使用本地计算机上的docker文件构建容器

docker build -t elasticdemo .

然后,我运行容器

docker run -p 8080:8080 elasticdemo

我可以在0.0.0.0:8080上访问elasticsearch

问题:

我正在尝试将elasticsearch作为应用部署到Google应用引擎灵活环境

gcloud app deploy app.yaml --version elasticdocker --project myproject

部署失败,并出现以下错误

Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]

我原本期望有弹性搜索作为应用进行部署,并且可以在已部署的网址上使用 . 你能用这种方法提供指示/帮助/建议吗?

1 回答

  • 1

    虽然您可以将ES部署到App Engine Flexible环境,但是's not particularly useful. The VMs hosting GAE Flexible containers are restarted regularly as part of maintenance and whatever data is stored on the local disk will be lost on restart. If you want to use local disk for long term storage, I'建议部署GCE VM(或者使用GCP Marketplace中的解决方案)或部署到GKE supports persistent disks

    至于实际问题:您可能没有运行状况检查处理程序,因此App Engine Flexible环境在部署应用程序后不会认为您的应用程序运行正常 . 我同意错误信息是无用的 .

    来自GAE Flexible docs for building custom images

    “运行状况检查是对URL / _ah / health的HTTP请求 . Health 的应用程序应响应状态代码200.”

    或者,您可以通过添加到app.yaml enable_health_check: False 来关闭运行状况检查

相关问题