栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Docker安装ElasticSearch-Head及跨域和406问题

Docker安装ElasticSearch-Head及跨域和406问题

首先

docker基础容器中 bash: vim: command not found 问题解决
apt-get update
apt-get install vim
docker pull mobz/elasticsearch-head:5
docker run --restart=always --name elasticsearch-head -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5

解决跨域
vi config/elasticsearch.yml加入2个参数,并重启

docker exec -it b93fa4e29ba2 /bin/bash
vi config/elasticsearch.yml

http.cors.enabled: true
http.cors.allow-origin: “*”
解决406问题
docker exec -it -u root elasticsearch-head /bin/bash

mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
    echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

cat >/etc/apt/sources.list < # deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster main
> deb http://deb.debian.org/debian buster main
> # deb http://snapshot.debian.org/archive/debian-security/20200607T000000Z buster/updates main
> deb http://security.debian.org/debian-security buster/updates main
> # deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster-updates main
> deb http://deb.debian.org/debian buster-updates main
> EOF
#更新安装源
 apt-get update
 apt-get install -y vim

vim _site/vendor.js

6886行
contentType: "application/x-www-form-urlencoded
改成
contentType: “application/json;charset=UTF-8”
7573行
var inspectData = s.contentType === “application/x-www-form-urlencoded” &&
改成
var inspectData = s.contentType === “application/json;charset=UTF-8” &&
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/773955.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号