1

I have 2 HLF networks. The first one has let's say Kafka ordering service and some peers, chaincodes and their ledgers. Second network is null right now (let's say we will derive this network from network A). In network B, I want RAFT based ordering service, different number of peers (could be same too if hard-mandatory) and same transaction history. In short, I need to migrate network A data to network B (has RAFT orderers).

  1. What all changes are needed in network A? Should I convert this Kafka OSN to RAFT OSN first and then do a network migration?
  2. Followed by these changes, how can I migrate this network A (possibly modified) to network B?
Chintan Rajvir
  • 689
  • 6
  • 20

1 Answers1

0

First of all, reproduce the network exactly as it is (Kafka-based). Transfer your configuration files, your required persistent volumes (/var/hyperledger/production, etc.) and adapt your docker configuration.

You'll need to replace TLS certificates, as IPs/domains have changed.

You'll need also to "play" with configtxlator to reconfigure your Kafka brokers', orderers' and anchor peers' IPs/domains. While you are performing this changes, you'll need to tweak iptables in your nodes (or your DNS) so that nodes can see each other (otherwise they will try to connect to the nodes in the old network).

After that, migrate from Kafka to Raft: https://hyperledger-fabric.readthedocs.io/en/release-2.0/kafka_raft_migration.html.

That's the logical way to do it, if you want to keep the ledger. It is a huge mess, nobody said it is not.

Later you can add more peers. It requires no major changes, while they are not anchor peers.

kekomal
  • 2,179
  • 11
  • 12
  • Let's say I have network B running on a different host. This thing works if that host B would support Kafka. But let's say I have a scenario where that host B does not have Kafka facility. In that case, should I first convert kafka to raft "in-place" at host A and then perform a migration? If so, what should be the changes in your proposed answer? – Chintan Rajvir Apr 14 '20 at 07:50
  • That's it. But I did not propose it as I did not know from your question if the first network must remain as it is. Then, run the migration from the link in first place, and then the other steps. – kekomal Apr 14 '20 at 07:58
  • I find strange that you are talking about "host" in singular. Is a development network running in one only host? If that (and if you are using addresses inner to your docker network), then you may experience less issues with the other changes. – kekomal Apr 14 '20 at 08:02
  • Cool, understood! Thanks for the help. I will test it out practically. What if while migrating peers, they are anchor peers? – Chintan Rajvir Apr 14 '20 at 08:10
  • 1
    You refer to extend the Fabric Raft network to host B in first place and then remove nodes from host A. I find its difficulty similar. Every orderer add or removal requires changes both in the system and the application channel. Every anchor add or removal requires changes in the application channel. But it works if you perform it suitably. Proceed as you want. – kekomal Apr 14 '20 at 08:11
  • When you say "play with configtxlator", when should I edit the channel configuration with new orderer endpoints and new TLS certificates? After taking a backup on host A right? And when the orderers start again on host B should they use the first genesis block of system channel or the latest system channel config block? – Chintan Rajvir Apr 15 '20 at 04:59
  • 1
    I refer to build the transactions to: update orderer addresses in the system channel, update raft consenter addresses in the system channel, update raft consenter certs in the system channel, update orderer addresses in the application channel, update raft consenter addresses in the application channel, update raft consenter certs in the application channel and update anchor peers in application channel. And execute the transactions. – kekomal Apr 15 '20 at 05:59
  • Use the genesis block (`ORDERER_GENERAL_GENESISFILE` refers to the genesis, not to a config block). – kekomal Apr 15 '20 at 06:03