安装 Elasticsearch 之前,你需要先安装一个较新的版本的 Java,最好的选择是,你可以从 www.java.com获得官方提供的最新版本的 Java。
创建一个新用户
useradd elastic
cd /home/elastic
elastic.co/downloads/elasticsearch 获取最新版本的 Elasticsearch
bin/elasticsearch -d #deamon模式启动
bin/elasticsearch #普通模式启动
localhost:9200端口访问
利用 nginx反向代理外网访问
upstream es.com{
server 127.0.0.1:9200;
}
server{
listen 8083;
server_name es.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
proxy_pass http://es.com;
}
}
yii elasticseach 扩展
"elasticsearch/elasticsearch":"~2.0"
一、修改config/web.php文件,引入Elasticsearch配置####
二、创建数据####
1、建立model
2、建立controller
三、查询Es数据###
查询所有数据
          












网友评论