解決ES查詢報錯的問題

head 連接Elasticsearch6是 【數據瀏覽模塊不能顯示數據了】 
看一下網絡發現406 錯誤

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

 

解決方法:

1、進入head安裝目錄;

2、cd _site/

3、編輯vendor.js  共有兩處

1. 6886行 /contentType: "application/x-www-form-urlencoded

改成

contentType: "application/json;charset=UTF-8"

2. 7574行 var inspectData = s.contentType === "application/x-www-form-urlencoded" &&

改成

var inspectData = s.contentType === "application/json;charset=UTF-8" &&

root@f28ca61a308f:/usr/src/app/_site# ls
app.css  app.js  base  fonts  i18n.js  index.html  lang  vendor.css  vendor.js
root@f28ca61a308f:/usr/src/app/_site# uname -a
Linux f28ca61a308f 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 GNU/Linux
root@f28ca61a308f:/usr/src/app/_site# apt-get update
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [16.3 kB]
Get:3 http://deb.debian.org jessie Release.gpg [1652 B]
Get:4 http://deb.debian.org jessie Release [77.3 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [897 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [20 B]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.1 MB in 40s (253 kB/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
AA8E81B4331F7F50
root@f28ca61a308f:/usr/src/app/_site#  apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libgpm2 vim-common vim-runtime
Suggested packages:
  gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libgpm2 vim vim-common vim-runtime
0 upgraded, 4 newly installed, 0 to remove and 190 not upgraded.
Need to get 6224 kB of archives.
After this operation, 28.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main vim-common amd64 2:7.4.488-7+deb8u4 [185 kB]
Get:2 http://security.debian.org/ jessie/updates/main vim-runtime all 2:7.4.488-7+deb8u4 [5052 kB]
Get:3 http://deb.debian.org/debian/ jessie/main libgpm2 amd64 1.20.4-6.1+b2 [34.0 kB]
Get:4 http://security.debian.org/ jessie/updates/main vim amd64 2:7.4.488-7+deb8u4 [953 kB]
Fetched 6224 kB in 39s (158 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libgpm2:amd64.
(Reading database ... 21217 files and directories currently installed.)
Preparing to unpack .../libgpm2_1.20.4-6.1+b2_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.4-6.1+b2) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a7.4.488-7+deb8u4_amd64.deb ...
Unpacking vim-common (2:7.4.488-7+deb8u4) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a7.4.488-7+deb8u4_all.deb ...
Adding 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:7.4.488-7+deb8u4) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a7.4.488-7+deb8u4_amd64.deb ...
Unpacking vim (2:7.4.488-7+deb8u4) ...
Processing triggers for mime-support (3.58) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Setting up libgpm2:amd64 (1.20.4-6.1+b2) ...
Setting up vim-common (2:7.4.488-7+deb8u4) ...
Setting up vim-runtime (2:7.4.488-7+deb8u4) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.4.488-7+deb8u4) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
Processing triggers for libc-bin (2.19-18+deb8u6) ...
root@f28ca61a308f:/usr/src/app/_site# ls
app.css  app.js  base  fonts  i18n.js  index.html  lang  vendor.css  vendor.js
root@f28ca61a308f:/usr/src/app/_site# vim vendor.js
root@f28ca61a308f:/usr/src/app/_site# ls
app.css  app.js  base  fonts  i18n.js  index.html  lang  vendor.css  vendor.js
root@f28ca61a308f:/usr/src/app/_site# exit
exit
You have new mail in /var/spool/mail/root

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章