dmerkushov / nanoservices

Apache License 2.0
3 stars 0 forks source link

FEATURE: Service lookup and IPC socket usage #9

Open dmerkushov opened 4 years ago

dmerkushov commented 4 years ago

Problem solved by the feature Complexity of nanoservice configuration

Describe the solution you'd like The first nanoservice to start on a host binds to the port 49949 and publishes an IPC socket, /var/nanoservices/lookup.sock, then acts as a lookup server. The neighbour lookup servers are configured. All the others just publish their own UNIX sockets under /var/nanoservices/local/ with their names (with added extension .sock) and register with the lookup server. Whichever service (SVC) cannot find a local UNIX socket for its partner (PRT), it goes to the lookup server (LS). LS goes to other LSs and asks for existing PRTs in their domains. After a working PRT is found, the lookup servers act as proxies to pass data between SVC and PRT. To test if a service is alive, lookup servers use the ping() call, which must be answered in a timeout. Actual socket settings must be configuration options with defaults given here.

Feature optionality The feature must be available to whichever nanoservice needs it, both lookup server and lookup client.

dmerkushov commented 4 years ago

Blocks #8

dmerkushov commented 4 years ago

Bushmin: B Petelin: B Merkushov: B

v-bus commented 4 years ago

Может интерфейс на конфиги повесить? Мы щас CRUD делали, определились с форматом словаря конфигов. А хранить где - зависит от желания.
А логику меша (каждый все знает) добавить, если она включена, так сказать для бедных. Потом monkey тест на это сделать. Чёт мне кажется, когда база отпадает больше понятно, чем когда консистентность списка split brain. Это тогда надо будет блокчейн транзакции вешать на эти списки.