2019-07-03

Why I don't use Nifi

Why I don't use NIFI

First, I would like to be clear Nifi is a good tool. It meet it design initiative. It simplify development of what it designed for. But it is not a silver pullet.

In current software development, logic development is not the only thing. Finishing a business logic development does not means the project is finished. You must take testing, publishing, deploying, collaboration between different unit, security, change tracking etc into consideration. Unless the project is a one shot, and you will never touch it again.

So, here is the point that I cannot use Nifi in my production project.

  • Testing I need all changes and all business logic and pipeline connection to be testable and also in the automatic way in flexible environment. So far Nifi does not have a good solution in this area. Someone (https://touk.pl/blog/2019/01/10/testing-nifi-flow-the-good-the-bad-and-the-ugly/) has put a great effort in it, but it is still not in the level that I expected.

  • Security and access control

    Nifi having some basic access control feature, but as a multi-tenant platform it does not meet enterprise level requirement.

  • Scalability and Domain isolation

    (Maybe not). Nifi support cluster, but how to prevent some user mis-use it and drained most of the resources. Probably multiple cluster and running NIFI in docker in the future. In our production nifi setup, once you opened a gate, and ppls stated to put their flow in, after a while, you will see hundred of squares laying around. To clearly isolate pipeline, dockernize is the best solution so far. Then goes to the operation problem.

  • Operation

    In the Dev/Ops scenarios, I don't want to deploy things a based docker image which are 2GB large. In addition it also need additional effort to load pipeline login into NIFI. Template, variable, registry...

  • Collaboration

    This area is not clear for my yet. What going to happen if different users need to modified the same components? Is it using a exclusive lock, or it trying to merge in the commit step?

  • Change Tracking

    We have requirement to audit all changes. As I know it is impossible to easily and clearly see what have been changed between two environment.

2015-12-26

白巧克力杏仁藏红花圈

主要用料:
    • 2 包藏红花(10g)
      3 dl 牛奶
      50 g 甜点鲜酵母
      1 1/2 dl 砂糖
      1/2 tsk 盐
      150 gr 室温的黄油
      1个鸡蛋
      大约 11-12 dl 面粉
  • 涂层用料:
    • 100 g 室温黄油
      2 msk 糖
      200 g 杏仁片
      100 g 白巧克力
      一个鸡蛋刷皮
  • 步骤

    10g藏红花和少许砂糖相拌磨碎(也可加一点点酒).
    将牛奶在小锅中加热到37度,之后加入上一步的藏红花和糖混合物。
    将混合好的牛奶倒在碗里,把酵母放入牛奶中, 依次倒入150克黄油(溶化的),
    1.5dl糖,7ml盐和1个鸡蛋在碗中。
    慢慢加入面粉,揉成面团. 揉好之后在发酵布下放置40分钟。将烤箱预热到200度。

    将面团取出,擀成长方形面饼。将第二部分的糖和黄油混合成糊(用手最方便)。
    用室温黄油,不要彻底溶化。用抹刀均匀的涂在面饼上。

    将杏仁片和几乎全部的白巧克力沫,撒在面团上。面团切成条。两两相落(类似国内的果子)。用刀从中间几乎劈开成裤子形。旋转两个裤腿成麻花,再盘成粑粑形。在烤盘上放30分钟

    刷上一层搅拌好的鸡蛋。放在烤箱中间烤8-12分钟。发现开始出现焦黄色后,取出。将剩下的白巧克力趁热撒在甜饼上。之后用发酵布盖好冷却。

    2015-04-02

    Just runit

    install runit
    - sudo apt-get install runit
    - sudo port install runit

    On mac:
    runsvdir is not started as a service. Use following command to start:
    sudo port load runit 
    Notice that with ps aux | grep runsvdir, there is a error message shows that /opt/local/var/service folder is not existed and runsvdir is failed.
    So need to sudo port unload runit, create service folder and load runit again.

    create folder holding aviable service:
    sudo mkdir /opt/local/var/service_avaible

    create service s1
    sudo mkdir /opt/local/var/service_avaible/s1

    add run script
    cd /opt/local/var/service_avaible/s1
    sudo vim run

    content should be similar like:
    #!/bin/sh
    # only write to stdout
    exec 2>&1
    # run some command

    create log:
    mkdir log
    vim log/run
    #!/bin/sh
    exec chpst -uUSER svlogd -tt /dir/to/log/folder

    make the executable
    sudo chmod 700 /opt/local/var/service_avaible/s1/run
    sudo chmod 700 /opt/local/var/service_avaible/s1/log/run

    enable it by
    sudo ln -s /opt/local/var/service{_avaible,}/s1

    2014-07-24

    automatic kinit

    To automatic renew kerberos ticket by using ktutil:
    ktutil
    ktutil:  addent -password -p foo@dummy.domain -k 1 -e rc4-hmac
    Password for foo@dummy.domain:
    ktutil:  addent -password -p foo@dummy.domain -k 1 -e aes256-cts
    Password for foo@dumy.domain:
    ktutil:  wkt foo.keytab
    ktutil:  quit
    
    Then under shell we can run kinit foo@dummy.domain -k -t /folder/to/key/foo.keytab

    2014-04-14

    Mac after install


    change to ubuntu command line format:

    create .bash_profile under home folder
    export CLICOLOR=1
    export LSCOLORS=GxFxCxDxBxegedabagaced
    export PS1="\[\e[0;36m\]\u@\h\[\e[0;00m\]:\[\e[0;32m\]\w\[\e[0;00m\]$ "

    Java


    Install Java

    Install from Official

    Download Java JDK from Official website, mount and install. Add followking line to bash_profile
    
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/
    
    

    Use Homebrew

    brew update
    brew tap caskroom/versions
    brew cask install java7
    
    # Manage multiple version of Java
    brew install jenv
    jenv add /Library/Java/JavaVirtualMachines/jdk1._79.jdk/Contents/Home/
    
    # Enable JAVA_HOME
    jenv enable-plugin export
    
    

    Install Maven

    Download tar.gz file from http://maven.apache.org/download.cgi unzip it and put them into any folder such like ~/Applications
    create a link to it and add it to PATH
    export M2_HOME=~/Applications/maven
    export PATH=$M2_HOME/bin:$PATH
    Notice that Maven need correct JAVA_HOME to be able to work

    Python

    Install python without root privilege by using virtualenv:
    $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
    $ tar xvfz virtualenv-X.X.tar.gz $ cd virtualenv-X.X
    $ python virtualenv.py myVE

    fabric

    export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install fabric

    2013-02-27

    Install MegaCli on Dell PowerEdge 2950

    Today our database server running out of hard disk space now. As there is no system administrator here any more, we need to fix it our self. The first thing is to figure our what is the current situation. It is very easy to figure it our from system application level, but there is a challenge for us developer to get more hardware level info from our server. We are using Dell, to be more precise we are using PowerEdge 2950 which equipped with Dell PERC 5/i (re-brandedLSI MegaRAID SAS 8408E). So we can find this product and download related software from http://www.lsi.com/support/Pages/download-search.aspx. In my case, I just downloaded the MegaCli.zip from "Management software and tools" section and put it in the home folder. After unzip it, a rpm file thing like MegaCli-8.xx.xx.-x.rpm should be there. I tried to install it with alien, but it MegaCli does not work after installation. So I followed how2forge.info instruction to extract the content of this rpm files by using rpm2cpio. Here is the command:
      rpm2cpio MegaCli-x.xx.xx.xx.rpm | cpio -idmv
    This actually stacked at the end, so I have to ctr-C it to quit. But all files needed are there. Cd to related folder and simply try:
      ./MegaCli64 -AdpAllInfo -aALL 
    
    or
      ./MegaCli -AdpAllInfo -aALL
    
    in case 32bit system is using.

    2013-01-24

    家居绿色植物

    1:滴水观音:有清除空气灰尘的功效。但是,滴水观音茎内的白色汁液有毒,滴下的水也是有毒的,误碰或误食其汁液,就会引起咽部和口部的不适,胃里有灼痛感。应当特别注意防止幼儿误食。但是滴水观音并不属于致癌植物。

    2:君子兰:释放氧气.吸收烟雾的清新剂:一株成年的君子兰,一昼夜能吸收1立升气,释放80%的氧气,在极其微弱的光线下也能发生光合作用。它在夜里不会散发二氧化碳.在十几平方米的室内有两三盆君子兰就可以把室内的烟雾吸收掉.>特别是北方寒冷的冬天,由于门窗 
    紧闭,室内空气不流通,君子兰会起到很好的调节空气的作用.保持室内空气清新.

    3:橡皮树:消除有害物质的多面手
    橡皮树是一个消除有害植物的多面手.对空气中的一氧化碳,二氧化碳,氟化氢等有害气体有一定抗性.橡皮树还能消除可吸入颗粒物污染,对室内灰尘能起到有效的滞尘作用.

    4:文竹:消灭细菌和病毒的防护伞
    文竹含有的植物芳香有抗菌成分,可以清除空气中的细菌和病毒,具有保健功能.所以文竹释放出的气味有杀菌益菌之力.此外,文竹还有很高的药用价值.挖取它的肉质根洗去上面的尘土污垢.晒干备用或新鲜即用.叶状枝随用随采.均有止咳
    润肺凉血解毒之功效.

    5:银皇后:以它独特的空气净化能力著称:空气中污染物的浓度越高,它越能发挥其净化能力!因此它非常适合通风条件不佳的阴暗房间。

    6:铁线蕨:每小时能吸收大约20微克的甲醛,因此被认为是最有效的生物"净化器"。成天与油漆、涂料打交道者,或者身边有喜好吸烟的人,应该在工作场所放至少一盆蕨类植物。另外,它还可以抑制电脑显示器和打印机中释放
    的二甲苯和甲苯

    7:吊兰:能吸收空气中95%的一氧化碳和85%的甲醛.
    吊兰能在微弱的光线下进行光合作用,吊兰能吸收空气中的有毒有害气体,一盆吊兰在8~10平米的房间就相当于一个空气净化器.一般在房间内养1~2盆吊兰,能在24小时释放出氧气,同时吸收空气中的甲醛,苯乙烯,一氧化碳,二氧化碳等致癌
    物质.吊兰对某些有害物质的吸收力特别强,比如空气中混合的一氧化碳和甲醛分别能达到95%和85%.吊兰
    还能分解苯,吸收香烟烟雾中的尼古丁等比较稳定的有害物质.所以吊兰又被称为室内空气的绿色净化器.

    8:芦荟:一盆芦荟相当于九台生物空气清洁器
    盆栽芦荟有空气净化专家的美誉.一盆芦荟就等于九台生物空气清洁器,可吸收甲醛,二氧化碳,二氧化硫.一氧化碳等有害物质.尤其对甲醛吸收特别强.在4小时光照条件下..一盆芦荟可消除一平方米空气中90%的甲醛,还能杀灭空气中的有>
    害微生物,并能吸附灰尘,对净化居室环境有很大作用.当室内有害空气过高时芦荟的叶片就会出现斑点.这就是求援信号.只要在室内再增加几盆芦荟.室内空气质量又会趋于正常

    9:棕竹:消除重金属污染和二氧化碳
    棕竹的功能类似龟背竹.同属于大叶观赏植物的棕竹能够吸收80%以上的多种有害气体,净化空气.同时棕竹还能消除重金属污染并对二氧化硫污染有一定的抵抗作用.当然作为叶面硕大的观叶植物,他们最大的特点就是具有一般植物所不能>
    企及的消化二氧化碳并制造氧气的功能.

    10龟背竹:夜间吸收二氧化碳,改善空气质量
    龟背竹净化空气的功能略微弱一些,它不像吊兰.芦荟是净化空气的多面手.但龟背竹对清除空气中的甲醛的效果比较明显.另外,龟背竹有晚间吸收二氧化碳的功效.对改善室内空气质量,提高含氧量有很大帮助.加上龟背竹一般植株较大,造
    型优雅.叶片又比较疏朗美观.所以是一种非常理想的室内植物.龟背竹的果实成熟后可以做菜.香味像凤梨或者香蕉.

    11:常春藤:吸收甲醛的冠军.
    常春藤是目前吸收甲醛最有效的室内植物,每平方米的常春藤的叶片可以吸收甲醛1.48毫克.而2盆成年的常春藤的叶片总面积大约0.78平方米.同时常春藤还可以吸收苯这种有毒有害物质,24小时光照条件下可吸收室内90%的苯.根据推测,10平方米的房间,只需要放上2-3盆常春藤就可以起到净化空气的作用.它还能吸附微粒灰尘. 

    12:富贵竹:适合卧室的健康植物
    富贵竹可以帮助不经常开窗通风的房间改善空气质量,具有消毒功能,尤其是卧室,富贵竹可以有效的吸收废气,使卧室的私密环境得到改善.

    13:发财树:对抗烟草燃烧产生的废气.
    发财树四季长青,能通过光合作用吸收有毒气体释放氧气.能比较有效的吸收一氧化碳和二氧化碳的污染,对抵抗烟草燃烧产生的废气有一定作用.

    14:仙人掌:减少电磁辐射的最佳植物
    仙人掌具有很强的消炎灭菌作用,在对付污染方面,仙人掌是减少电磁辐射的最佳植物.此外仙人掌夜间吸收二氧化碳释放氧气。晚上居室内放有仙人掌,就可以补充氧气,利于睡眠.__+