是一个自动同步MySQL数据到Elasticsearch服务,它使用mysqldump同步全量数据, 然后通过binlog同步增量数据 项目地址https://github.com/siddontang/go-mysql-elasticsearch Go-mysql-ElasticSearch项目自带个Dockerfile,可以直接用Docker run运行, 只需要简单配置即可. 安装配置MYSQL MYSQL需要配置成主从结构 server-id=1 log-bin=mysql-bin.log binlog-do-db=ultron binlog-do-db=ultron_test expire_logs_days=1 binlog_format=row 安装ELK 参考http://www.heoffice.com/docker/185/ Docker运行Go-mysql-ElasticSearch 可以使用Docker run直接运行, 但我喜欢用Docker-compose运行.docker-compose运行的好处有 * 可以设置配置文件./etc/river.toml路径为相对路径 * 可以方便集成到其它docker-compose中,与其它容器通过容器名相互访问数据 * 运行简单: docker-compose up或docker-compose -f xxx.yml up git clone git@github.com:siddontang/go-mysql-elasticsearch.git cd go-mysql-elasticsearch 创建docker-compose.yml version: ‘3’ services: go-mysql-elasticsearch: build: . restart: always ports: – 12800:12800 volumes: – “./etc/river.toml:/go/etc/river.toml” 配置同步配置文件 etc/river.toml # MySQL…
MySQL数据表同步到ElasticSearch
项目中涉及的数据量比较大. 查询字段比较多, 用MySQL查询有点捉襟见肘, 了解到Elasticsearch 是一个实时的分布式搜索分析引擎, 它被用作全文检索、结构化搜索、分析以及这三个功能的组合, 就没用以前用过的Sphinx.怎么把数据从MySQL数据表同步到ElasticSearch下呢, Follow me. 使用的技术: * Docker (Docker version 18.03.0-ce, build 0520e24) * MySQL5.7 (安装在宿主机) * Docker-elk (Docker for Elasticsearch, Logstash, Kibana) * 想了解 ELK Stack 转 https://github.com/elastic/stack-docker 假设已安装配置好了Docker,Docker-composer,MySQL 创建要同步的MySQL表 CREATE TABLE `advertiser` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(34) DEFAULT NULL, `cap` int(11) DEFAULT ‘0’, `updated_time` int(10)…
一次PHP狂占内存经历
更新系统后, 一经调用PHP接口,PHPFPM一起来就疯狂占用内存. 经查是Monolog启用的info日志, info设置的日志如下: monolog: handlers: … … info: type: stream path: “%kernel.logs_dir%/%kernel.environment%-info.log” level: info channels: [‘!event’, ‘!doctrine’, ‘!console’ 删除该配置后系统恢复正常.
Kubernete command
kubectl exec -it nginx-65899c769f-gf2lb — /bin/bash
Kubernete install TICK-charts on mac
参考 https://github.com/influxdata/tick-charts Step 1: Install helm & check tilller installed brew install kubernetes-helm helm init kubectl get pods –namespace kube-system 显示 $ kubectl get pods –namespace kube-system NAME READY STATUS RESTARTS AGE etcd-minikube 1/1 Running 0 4d kube-addon-manager-minikube 1/1 Running 5 5d kube-apiserver-minikube 1/1 Running 0 4d kube-controller-manager-minikube 1/1 Running 0 4d kube-dns-86f4d74b45-4zzs2 3/3 Running…
Kubernete Resources
Platform kubermatic https://stackpoint.io/ Mindmap Kubernete Kubernete TICK Charts https://github.com/influxdata/tick-charts
How to activation PHPStorm 2017 — 2018 License Server
http://nodde.ru:1027 https://roothat.ru/how-to-activation-phpstorm-2017-2018-license-server/
Angular 2.0
Angular2.0 http://angular.io https://angular.cn Installation npm install -g @angular/cli Create Project ng new my-app Start project cd my-app ng serve –open Open in browser open http://localhost:4200 Angular Cli WIKI https://github.com/angular/angular-cli/wiki Angular Cli ng new ng serve ng generate ng lint ng test ng e2e ng build ng get/ng set ng doc ng eject ng xi18n Angular…
phpstorm setup
Download https://www.jetbrains.com/phpstorm/ PhpStorm 2017.3.4 License Server http://license.topnguyen.net Install Symfony Plugin in PhpStorm Open PhpStorm Menu Perferences -> Plugins -> Browser Repositories Search “Symfony Plugin” Install -> OK Install phpunit6 & Setup wget -O phpunit https://phar.phpunit.de/phpunit-6.phar chmod +x phpunit ./phpunit –version Perferences -> Languages & Framworks -> PHP -> Test Frameworks Click “+” -> “PHPUnit Local”…