[轉]Elasticsearch 解决 memory_lock 问题

https://sukbeta.github.io/2018/11/21/ES-%E8%A7%A3%E5%86%B3-memory-lock-%E9%97%AE%E9%A2%98/ check http://xxx.xxx.xxx.xxx:9200/_nodes?filter_path=**.mlockall My way services: elasticsearch: build: context: elasticsearch/ volumes: - ./elasticsearch/esdata:/usr/share/elasticsearch/data:rw - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro ports: - "9200:9200" - "9300:9300" environment: - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65536 hard: 65536 networks: - elk

2018-11-29 · 1 min · 40 words · Me

docker iptables part 2

http://sueboy.blogspot.com/2018/11/docker-iptables_12.html sudo iptables -vnL ======NAT===== sudo iptables -t nat -vnL 顯示行數 sudo iptables -t nat -L POSTROUTING -n –line-numbers -D 刪除那行 sudo iptables -t nat -D POSTROUTING x x is which line delete 確認docker網段補上 sudo iptables -t nat -A POSTROUTING -s 172.19.0.0/16 ! -o docker0 -j MASQUERADE

2018-11-23 · 1 min · 47 words · Me

docker volume or create directory, get access deny

https://www.centos.bz/2018/02/%E5%AE%9A%E5%88%B6entrypoint%E8%87%AA%E5%8A%A8%E4%BF%AE%E6%94%B9docker%E4%B8%ADvolume%E7%9A%84%E6%9D%83%E9%99%90/ ………. Other way 1、make shell and run shell, before run docker-compose. mkdir ./data sudo chown docker ./data #sudo chown user01 ./data sudo chmod g+rwx ./data sudo chgrp 994 ./data Directory exist and correct Access. 994 or 50 or 1000 see /etc/passwd or /etc/group 2、But sometime OS install docker by you don’t know way… maybe have user dockerroot、group dockerroot or only group docker you maybe already run sudo usermod -a -G docker $(whoami) 100% in docker group. ...

2018-11-23 · 1 min · 117 words · Me

[轉]Redux状态管理之痛点、分析与改良

https://segmentfault.com/a/1190000009540007 WebApp场景下的隐患 举个我曾经在另一篇博客中提到过的例子,一个业务流程有三个页面A/B/C,用户通常按顺序访问它们,每步都会提交一些信息,如果把信息存在Store中,在不刷新的情况下C页面可以直接访问A/B页面存进Store的数据,而一旦用户刷新C页面,这些数据便不复存在,使用这些数据很可能导致程序异常。 它可以从两方面缓解上述问题: 抽象问题:每个Page独立创建store,解决状态树的一对多问题,一个状态树(store)对应一个组件树(page),page在设计store时不用考虑其它页面,仅服务当前页。当然,由于Reducer仍然需要独立于组件树声明,抽象问题并没有根治,面向领域数据和App state的抽象仍然比UI state更自然。它仅仅带给你更大的自由度:不再担心有限的状态树如何设计才能满足近乎无限的UI state。 刷新、分享隐患:每个Page创建的Store都是完全不同的对象,且只存在于当前Page生命周期内,其它Page不可能访问到,从根本上杜绝跨页面的store访问。这意味着能够从store中访问到的数据,一定是可靠的。 2017.08.27 更新 这个方案在实践中,仍然遇到了一些问题,其中最最重要的,则是替换store后,跨页面action的问题 为了应对这个问题,我考虑了几种方案: 回到应用单一store:pageReducer的特性通过store.replaceReducer完成。当初为每个页面创建store是想让状态彻底隔离,而在replaceReducer后页面之间如果有相同的reducer则状态不会被重置,这是一个担心点。同时一个副作用是牺牲掉每个page定制化middleware的能力 为这类跨页面的action建立一个队列,在上个页面将action推进队列,下个页面取出再执行。此方案属于头痛医头,只能解决当前的case,对于websocket等类似问题比较无力。 定制thunk middleware,通过闭包获取最新的store 在权衡方案的通用性、理解难度等方面后,目前选择了第一种。

2018-11-23 · 1 min · 18 words · Me

kibana geo_point How to Part 3

Now check again…. 1、template_filebeat.json Can only { "index_patterns": ["filebeat*"], "settings": { "number_of_shards": 1 }, "mappings": { "doc": { "properties": { "geoip.location": { "type": "geo_point" }, "geoip.coordinates": { "type": "geo_point" } } } } } Here Import: “location” is Error, Must “geoip.location” But sometime why no use, because my way insert index-pattern, so geoip.location no field, always is geoip.location.lat and geoip.location.lon overwrtie. see 2. 2、index-pattern index-pattern-export.json one way just try to put ...

2018-11-22 · 1 min · 114 words · Me