Skip to content

Latest commit

 

History

History
342 lines (317 loc) · 13.4 KB

TODOs.md

File metadata and controls

342 lines (317 loc) · 13.4 KB

MORE FUN with Akka.NET

It is you. Actor Model!


Documents


Contents



TODO

  1. '확인 사항' ->
  2. akka.cluster.allow-weakly-up-members = on 예제(랜덤 폴트일 때), akkadotnet/akka.net#3887
    1. Join the nodes to the cluster -> 05. Join the nodes to the cluster
  3. '04. Cluster > 0. Warming up' 폴더 추가
    • Log
    • Petabridge.Cmd
    • Console Title
  4. Leader 데모를 추가한다.
  5. Best Practices을 README.md 파일에 정리한다.
  6. Gossip을 정리한다.
    • Lifecycle: Leader Action, 명시적 Action
  7. 클러스터 합류
    • seed-nodes 목록
    • akka.cluster.seed-node-timeout
    • 같은 프로세스 2번 실행
  8. 클러스터 이탈
    • Graceful Leave
    • Petabridge.Cmd
    • akka.cluster.auto-down-unreachable-after
    • Split Brain
  9. 클러스터 합류/이탈
    • 합류 > 합류?
    • 합류 > 이탈(정상), 인지 전 > 합류
    • 합류 > 이탈(정상), 인지 후 > 합류
    • 합류 > 이탈(비정상), 인지 전 > 합류
    • 합류 > 이탈(비정상), 인지 후 > 합류
  10. Gossip
    • 알고리즘 이해
    • 옵션 이해
    • First Heatbeat ?

  • GossipMembership 상태Reachability 상태를 동기화 시켜는 역할을 수행한다.

    • Membership 상태: 이 노드가 클러스터의 현재 멤버인가?
      Joining, WeaklyUp, Up, Leaving, Exiting, Down, Removed
    • Reachability 상태: 이 노드를 지금 연결할 수 있는가?
      Reachable, Unreachable
      • Unreachable일 때 해당 Node을 클러스터에서 탈퇴(Removed) 시키지 않는 이유는 일시적인 네트워크 장애(Network Partition Tolerance)와 같이 자동으로 해결될 수 있는 일시적인 문제들이기 때문이다.
      • 노드와 연결할 수 없다고 해서 프로세스가 종료었다고 가정하면 안된다. 연결안된 노드가 여전히 활발하게 작업을 수행하다가 일시적 네트워크 장애가 해결되면 다시 정상적으로 작업을 수행할 수 있다.
  • Reachability 상태는 akka.cluster.failure-detector가 결정합니다.

  • Unreachable 현상

    1. Unreachable 노드가 1개 이상 존재하면 새 Node가 합류하지 못한다.
      • 새 Process로 처음 진입하는 Node일 때(새 Port)는 "Joining" 상태로 대기한다.
      • 새 Process로 재진입하는 Node일 때는(기존 Port) 기존 Node 상태를 "Up Unreachable"에서 "Down Unreachable"로 변경한다. 새 Process가 이전 Port을 사용하고 있기 때문에 기존 Node는 종료되었다고 명확히 판단할 수 있기 때문에 "Up Unreachable"을
akka.tcp://ClusterLab@localhost:8081 | [] | up |
akka.tcp://ClusterLab@localhost:8082 | [] | up | unreachable
akka.tcp://ClusterLab@localhost:8083 | [] | up | unreachable
akka.tcp://ClusterLab@localhost:8081 | [] | up |
akka.tcp://ClusterLab@localhost:8082 | [] | down | unreachable
akka.tcp://ClusterLab@localhost:8083 | [] | up | unreachable
akka.tcp://ClusterLab@localhost:8081 | [] | up |
akka.tcp://ClusterLab@localhost:8082 | [] | down | unreachable
akka.tcp://ClusterLab@localhost:8083 | [] | up | unreachable
akka.tcp://ClusterLab@localhost:8084 | [] | joining | 
  • Unreachable 상태를 제거하는 방법
    • 수동 > Petabridge.Cmd 도구: cluster down -a 주소, clsuter down-unreachable
    • 자동 > akka.cluster.auto-down-unreachable-after
    • 자동 > Split Brain Resolver
    • 자동 > IDowningProvider
    • 자동 > IReachability 이벤트 처리: ClusterEvent.ReachableMember, ClusterEvent.UnreachableMember

04. Cluster

  1. Overview
    • Create a new cluster(Joining itself)
      akka.cluster.seed-nodes = [ 
         "akka.tcp://..."   // The seed-node's URL must be itself.  
      ]
    • Shut down a new cluster(Exiting itself gracefully)
      var cluster = Akka.Cluster.Cluster.Get(system);
      cluster.RegisterOnMemberRemoved(() => system.Terminate());
      cluster.Leave(cluster.SelfAddress);
      
      // Waits for the Terminate to complete execution within a specified time interval.
      system.WhenTerminated.Wait();
    • Join multiple seed nodes
      akka.cluster.seed-nodes = [ 
         "akka.tcp://...",  // The first seed-node's URL must be itself.
         "akka.tcp://..." 
      ]
    • Integrate with Petabridge.Cmd
      • Leader?
      • Join
      • Exit
      • Petabridge.Cmd Exit/Join/...
    • Join the nodes to the cluster
      • 새 Join(성공 됨), 기존 Join(실패 됨)
      • Exit 정상, Exit 비정상
      • Exit(정상)일 때 Rejoin, Exit(비정상)일 때 Rejoin
    • Retry Joining Time Interval : akka.cluster.seed-node-timeout
    • Automatically Mark Unreachable Nodes : akka.cluster.auto-down-unreachable-after

Cluster Lab

  1. Overview
    • Create Cluster : akka.cluster.seed-nodes
    • Integrate with Petabridge.Cmd
    • Automatically Mark Unreachable Nodes : akka.cluster.auto-down-unreachable-after
    • Retry Joining Time Interval : akka.cluster.seed-node-timeout
    • Seed Node N개 일 때
    • Petabridge.Cmd Join, Leave, ...

  2. Roles and Minimum Size
    • Define Roles : akka.cluster.roles
    • Cluster-Wide Minimum Size : akka.cluster.min-nr-of-members
    • Per-Role Minimum Size : akka.cluster.role..min-nr-of-members
    • Mix Minimum Size
  3. Gossip Events
    • Subscribe to Gossip Events : Cluster _cluster = Cluster.Get(Context.System); _cluster.Subscribe(Self, ...);
    • Discover Actor by Tag
    • Discover Actor by Role and Path : cluster.State.Members.Where(member => ...);
  4. Warm-up for Cluster Routing
    • Pool - Create Routees Automatically : round-robin-pool
    • Pool - Hanlde Exceptions from Routees
    • Group - Create routees yourself : round-robin-group, path
    • Group - Hanlde Exceptions from Routees
    • Deploy - Create Actor Remotely : akka.actor.deployment..remote
    • Deploy - Hanlde Exceptions from Deployed Actors
    • Remote Deploy - 자동으로 Deathwatch 되는지?

  5. Cluster Routing
    • Pool - Deploy Routees Remotely
    • Pool - Hanlde Exceptions from Routees
    • Pool - Handle Routees Lifecycle

    • Group - Create Routees Yourself
    • Group - Handle Exceptions from Routees
    • Group - Handle Routees Lifecycle

  6. Cluster Singleton
    • Create Singleton
    • Send Message To Singleton

    • Manage Singleton???

    • Buffer Size

  7. Distributed PubSub
    • Publish - Communicate by Topic : DistributedPubSub.Get, Subscribe/SubscribeAck, Publish
    • Publish - Communicate by Topic with Same GroupId : sendOneMessageToEachGroup: true, (Send)
    • Publish - Communicate by Topic with Different GroupId : sendOneMessageToEachGroup: true, (Publish)
    • Publish - Get Topics
    • Send - Communicate by Path : Put, Remove, Send
    • Send - Communicate by Path with localAffinity : localAffinity: true
    • SendToAll - Communicate by Path
    • SendToAll - Communicate by Path with ExcludeSelf : excludeSelf: true
    • 사용자 정의 메시지(모든 Node에 참고해야 하나?, 메시지를 받지 않는 Node도?)

  8. Cluster Client
    • Communicate with Cluster by Path
    • Communicate with Cluster by Topic
    • Subscribe to SubscribeContactPoints Events
    • Subscribe to SubscribeClusterClients Events
    • Send Custom Messages
    • Sample - PingPong
    • akka.cluster.client.receptionist, akka.cluster.client HOCON

  9. Sharding
  10. Distributed Data
  11. Split Brain Resolver

Persistence Lab

  1. ReceivePersistentActor vs. UntypedPersistentActor
    • PersistenceId
    • OnCommand
    • OnRecover
    • IsRecovering
    • Persist vs. PersistAsync
    • DeferAsync
    • DeleteMessages
  2. AtLeastOnceDeliveryReceiveActor vs. AtLeastOnceDeliveryActor
  3. PersistentView
  4. AsyncWriteJournal
  5. SnapshotStore
    • LoadSnapshot vs. SaveSnapshot
    • DeleteSnapshot vs. DeleteSnapshots
    • OnReplaySuccess vs. OnReplayFailure
    • SnapshotSequenceNr
  6. SQLite
    • 뷰어
    • 데이터 확인하기


DOING

  1. Labs
    • 2019-05-W1 IoT Tutorials
    • 2019-05-W1 Persistence
    • 2019-05-W1 Akka.Persistence.Extras
    • 2019-05-W1 Cluster + Persistence
    • Cluster Singleton
    • Coordinated Shutdown
    • Split Brain Resolver
    • Cluster Sharding
    • Cluster Distributed Data
    • Hocon
  2. Cluster Extensions
    • Messages version-up
    • Node/Role version-up
    • Consul Actor Discovery
    • Transactions: Saga Pattern
  3. FAQ
    • Local
    • Remote
    • 프로젝트 이해
  4. Message Queue 연동
    • RabbitMQ
    • RabbitMQ Docker
    • HAProxy
  5. OSS
  6. Docker
  7. Books
    • Akka 쿡북
    • 아카 코딩 공작소
    • 러닝 아카
    • 아카를 이용한 마이크로서비스 개발
    • Reactive Application with Akka.NET
  8. 추가 Lab
    • Docker Container Lab
    • Visual Studio Extension Lab

Labs


Akka.NET Issues

  • Hocon 다음 행 시작에 ","일 때 예외 발생
  • RegisterOnMemberUp 람다 함수 Self Path가 akka://ClusterLab/system/cluster/$a 이다.
  • .NET Core에서는 "akka.actor.deployment..cluster.allow-local-routess = off"가 동작하지 않는다.
  • Cluster Pool Routing 예외 처리가 Remote Deploy와 다르다(부족하다).
  • ClusterClient "/user/xyz/" ActorPath 마지막에 "/"가 있으면 전달되지 않는다.
  • ClusterClient에세 정의된 사용자 정의 메시지가 Seed Node에도 참조되어 있어야 전송할 수 있다.
  • Hocon 검증 방법?
  • Rolling Update
  • 부하 사전 분산(HAProxy)

Akka.NET FAQ

  • Long running + Cancel: FSM
  • Ask -> FSM
  • Logging Message Info(including Generic).
  • Log 분리(App, Akka, ...)
  • Large Message
  • 환경 설정 이해(akka.cluster.failure-detector/akka.remote.transport-failure-detector/ ...
  • Serialization
    • readonly
    • WPF
  • WPF
    • main-thread Router x
    • Akka Coding Rules
    • MVVM + Akka Router
  • 장애 처리 재시도?
  • DeadLetter 재시도?
  • 장기간 Busy Actor일 때 Heartbeat 처리?
  • 매뉴얼 무중단 Rolling Update(메시지 버전 Up, ...)
  • Actor Hierarchy 출력(/user/..., /system/...)
  • 메시지 전송을 위해서는 메시지 Dll을 Cluster 모듈 모두가 참조해야 하나? SeedNode까지 포함해서?
  • C#에서 C/C++ 예외 처리하기를 기본으로 제공한다.