Category: Life

  • hdfs操作

    显示

    hdfs dfs -ls /user/hdfs/dw/raw/tracking/2017/06/15/tracking_16.gz

    获取文件到当前目录

    hdfs dfs -get /user/hdfs/dw/raw/tracking/2017/06/16/tracking_0.gz

    放置当前目录文件到 hdfs 里

    hdfs dfs -put * /user/hdfs/reporting/thread/2017/06/22/

    查看 gz 文件

    hdfs dfs -cat /user/hdfs/dw/raw/tracking/2017/06/16/tracking_0.gz  | zcat
  • cassandra 操作记录

    查看状态

    bin/nodetool status

    查看所有的 keyspaces

    DESCRIBE KEYSPACES
    

    查看网络状态

    bin/nodetool netstats

    查看 gossipinfo

    bin/nodetool gossipinfo

    修改 replication factor 之后进行 repair

    bin/nodetool repair

    踢除一个活的节点

    bin/nodetool decommision

    导出一个 keyspace 的结构

    cqlsh -e "DESC KEYSPACE test" > db_schema_test.cql;

    导出所有 keyspace 的结构

    cqlsh -e "DESC SCHEMA" > db_schema.cql

    导出表至 csv 文件

    COPY table_name ( column , ... )
    TO  'file_name' | STDOUT 
    WITH option = 'value' AND ...

    当需要维护一个结点时

    cd /opt/platform/cassandra/
    bin/nodetool drain
    # stop
    pgrep -u ops -f cassandra | xargs kill -9

    # start
    nohup ./bin/cassandra &

    变更后 Check
    /opt/platform/cassandra/bin/nodetool status
    关注

    Status – U (up) or D (down)
    Indicates whether the node is functioning or not.

    State – N (normal), L (leaving), J (joining), M (moving)
    The state of the node in relation to the cluster.

  • 《荒野求生》金句

    荒野虽险,身体+头脑依然能够生存,在社会上行走,也是行走在荒野

    Survival can be summed up in three words – never give up. That’s the heart of it really. Just keep trying.
    The line between life or death is determined by what we are willing to do.
    If you risk nothing you gain nothing
    If you can find a path with no obstacles, it probably doesn’t lead anywhere.
    There is little faith involved in setting out on a journey where the destination is certain and every step in between has been mapped in detail. Bravery, trust, is about leaving camp in the dark, when we do not know the route ahead and cannot be certain we will ever return.
    When you find yourself thinking about someone or something in the same old negative way, just stop yourself. Think. Check. Change. Refresh. Job done. Smile. Move on. Do this enough times and you will change. For the better; for the stronger.
    And if you give your heart to a goal, it will repay you. It’s the law of the universe.
    Stick to the fight when you’re hardest hit, It’s when things seem worst that you must not quit.
    There is no education like adversity.
    Tentative is no power.

  • rabbitmq从集群中拆除节点并初始化

    node1,node2,node3 想要拆掉 node3 做为单独和 node1,node2 相同配置的集群

    保存当前 definitions

    GET $host:15672/api/definitions 保存为 json文件

    node3 上执行

    rabbitmqctl stop_app

    node1上执行

    rabbitmqctl forget_cluster_node rabbit@node3

    node3 上删除 /var/lib/rabbitmq/mnesia 数据库下所有文件, 重启

    之后 node3 初始化

    rabbitmqctl add_user admin admin
    rabbitmqctl set_user_tags admin administrator
    rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

    登录到管理台导入json文件

  • 2017读书清单

    目标30本书

    开始时间 技术书 非技术书 教学视频
    2017-03-10 人类简史
    2017-03-27 redis实战
    2017-04-28 Learning ELK stack
    2017-10-10 The go programming language
  • 开车时听的歌list

    1. linda(张学友 粤语)