mysql 按周分组查询
select date,DATE_FORMAT(date,’%Y%m’) weeks,sum(`install`) install_count,sum(`launches`) launches_count,sum(`active`) active_count from tj_app_day_data where date >=’2017-10-25′ and date<='2017-12-17' group by weeks;
其实我一直在你身边
select date,DATE_FORMAT(date,’%Y%m’) weeks,sum(`install`) install_count,sum(`launches`) launches_count,sum(`active`) active_count from tj_app_day_data where date >=’2017-10-25′ and date<='2017-12-17' group by weeks;
select `date`,DATE_FORMAT(date,’%Y%m’) months,sum(`install`) install_count,sum(`launches`) launches_count,sum(`active`) active_count from tj_app_day_data where appid=’$appid’ and date >=’$start_date’ and date<='$end_date' group by months
新建索引
curl -XPUT ‘http://localhost:9200/dept/employee/1’ -d ‘{ “empname”: “emp1”}’
删除数据
curl -XDELETE ‘http://localhost:9200/dept/employee/3’
IK Analysis for ElasticSearch
The IK Analysis plugin integrates Lucene IK analyzer (http://code.google.com/p/ik-analyzer/) into elasticsearch, support customized dictionary.
Analyzer: ik_smart , ik_max_word , Tokenizer: ik_smart , ik_max_word
$client = Elasticsearch\ClientBuilder::create()
# ->setHosts([“localhost:9200”])
->setHosts([“101.37.85.163:9200”])
->setRetries(1)
->build();
namespace searchapi\controllers;
use Yii;
use yii\web\Controller;
use searchapi\models\CarBrandInfo;
use searchapi\models\CarBrandType;
use searchapi\models\CarBrandTypeInfo;
use searchapi\models\CarBrandSonTypeInfo;
use searchapi\models\CarFactory;
use yii\data\Pagination;
use yii\helpers\BaseJson;
use Elasticsearch;
elasticsearch + logstash + kibana 强大的日志处理分析系统
一、设计流程:
1.数据导入redis队列 key=logstash
2.logstash 获取redis队列logstash里面的数据
3.logstash把收集到数据传入elasticsearch 里面的index = sitelogs
4.kibana 设置 index = sitelogs
5.打开kibana 查询日志
在wp-config.php 最后一行添加
define(‘FS_METHOD’, “direct”);
一般ssh服务的默认端口为22端口,查看监听的端口用netstat
GRANT ALL PRIVILEGES ON *.* TO ‘username’@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION; 所有数据库所有表
GRANT ALL PRIVILEGES ON xinchuanbo.* TO ‘zzs’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION; 开通用户:zzs 密码:123456 数据库 xinchuanbo (远程操作)