mac下elasticsearch安装日记
2016-07-27 16:18
731 查看
1,安装java运行环境
2,下载elasticsearch
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz
3,启动elas
4,laravel 下安装扩展包,安装elasticsearch-php,添加php api扩展
composer安装报错
[Composer\Downloader\TransportException]
Content-Length mismatch
是因为默认请求的是国外的数据源,解决,在composer.json中添加composer扩展包中国镜像,
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
然后再更新
php composer.phar require "elasticsearch/elasticsearch:~2.0"
使用
use Elasticsearch;
use Elasticsearch\ClientBuilder;
$client = Elasticsearch\ClientBuilder::create()->build();
$params = [
'index' => 'twitter',
'type' => 'tweet',
'id' => '1'
];
$response = $client->get($params);
5,安装marvel监控
进入elastic目录,
cd /Users/xxx/Downloads/elasticsearch/bin/
./plugin -i elasticsearch/marvel/latest
查看监控
http://localhost:9200/_plugin/marvel/kibana/index.html#/dashboard/file/marvel.overview.json
开发者控制台
http://localhost:9200/_plugin/marvel/sense/
2,下载elasticsearch
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz
3,启动elas
./bin/elasticsearch -d
4,laravel 下安装扩展包,安装elasticsearch-php,添加php api扩展
composer安装报错
[Composer\Downloader\TransportException]
Content-Length mismatch
是因为默认请求的是国外的数据源,解决,在composer.json中添加composer扩展包中国镜像,
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
然后再更新
php composer.phar require "elasticsearch/elasticsearch:~2.0"
使用
use Elasticsearch;
use Elasticsearch\ClientBuilder;
$client = Elasticsearch\ClientBuilder::create()->build();
$params = [
'index' => 'twitter',
'type' => 'tweet',
'id' => '1'
];
$response = $client->get($params);
5,安装marvel监控
进入elastic目录,
cd /Users/xxx/Downloads/elasticsearch/bin/
./plugin -i elasticsearch/marvel/latest
查看监控
http://localhost:9200/_plugin/marvel/kibana/index.html#/dashboard/file/marvel.overview.json
开发者控制台
http://localhost:9200/_plugin/marvel/sense/
相关文章推荐
- 一个关于if else容易迷惑的问题
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- 在Kubernetes上搭建EFK(Fluentd+Elasticsearch+Kibana)
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- 什么是设计模式
- PHP数据库长连接mysql_pconnect的细节
- Php Installing An Expansion
- rem : web app适配的秘密武器
- jquery高级应用之Deferred对象
- 关于浮动与清除浮动,你应该知道的
- 数组reduce方法的高级技巧
- php7 读取php.ini[4]
- PHP+Apache在Windows 9x下的安装和配置
- IIS 6 的 PHP 最佳配置方法
- 安装Apache和PHP的一些补充
- Linux Apache+MySQL+PHP