安装java
elasticsearch 需要 java8 以上;我们到 https://www.oracle.com/technetwork/java/javase/downloads/index.html 下载安装最新版的 java11 jdk,
选中 Accept License Agreement 然后右键点击 jdk-11.0.2_linux-x6 4_bin.rpm 复制链接1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46[root@VM_0_14_centos ~]# wget https://download.oracle.com/otn-pub/java/jdk/11.0.2+7/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x6 4_bin.rpm
--2019-01-16 12:42:46-- https://download.oracle.com/otn-pub/java/jdk/11.0.2+7/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.rpm
Resolving download.oracle.com (download.oracle.com)... 23.56.20.195
Connecting to download.oracle.com (download.oracle.com)|23.56.20.195|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/11.0.2+7/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.rpm [following]
--2019-01-16 12:42:47-- https://edelivery.oracle.com/otn-pub/java/jdk/11.0.2+7/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.rpm
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.10.0.83, 2600:140e:6:39b::366, 2600:140e:6:38b::366
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.10.0.83|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2019-01-16 12:42:48-- http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|23.56.20.195|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.oracle.com/errors/download-fail-1505220.html [following]
--2019-01-16 12:42:48-- https://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|23.56.20.195|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: ‘jdk-11.0.2_linux-x64_bin.rpm’
100%[===============================================================================================>] 5,307 --.-K/s in 0s
2019-01-16 12:42:49 (319 MB/s) - ‘jdk-11.0.2_linux-x64_bin.rpm’ saved [5307/5307]
[root@VM_0_14_centos ~]# rpm -ivh jdk-11.0.2_linux-x6 4_bin.rpm
error: open of <html> failed: No such file or directory
error: open of <head> failed: No such file or directory
#rm -rf jdk-11.0.2_linux-x6 4_bin.rpm
#wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http:%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/otn-pub/java/jdk/11.0.2+7/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x6 4_bin.rpm"
[root@VM_0_14_centos ~]# rpm -ivh jdk-11.0.2_linux-x64_bin.rpm
warning: jdk-11.0.2_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:jdk-11.0.2-2000:11.0.2-ga ########## ( 31%)
################################# [100%]
[root@VM_0_14_centos ~]# java -h
Usage: java [options] <mainclass> [args...]
(to execute a class)
or java [options] -jar <jarfile> [args...]
(to execute a jar file)
or java [options] -m <module>[/<mainclass>] [args...]
java [options] --module <module>[/<mainclass>] [args...]
(to execute the main class in a module)
or java [options] <sourcefile> [args]
(to execute a single source-file program)
安装es
1 | [root@VM_0_14_centos ~]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch |
Elasticsearch 中文分词器 ik-analyzer
1 | /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.2/elasticsearch-analysis-ik-6.4.2.zip |
Laravel 项目中使用 Elasticsearch 做引擎
像使用 Laravel Query 一样的搜索 Elasticsearch
CentOS 7 安装 Elasticsearch 6.4.2 教程
CentOS 7.x 安装 Elasticsearch 6.x
在Laravel5.5中使用搜索 Elasticsearch