• TIPC Getting Started6


    • Installation and Configuration

      The TIPC kernel module is available by default in the major Linux distros. Just do ‘modprobe tipc’
      and you are ready to run in single node mode.

      If you want to run in cluster mode you must also give each node a unique identity and
      attach the interface you want to use:$ tipc node set addr 1.1.2 (e.g.) (This step can be omitted from Linux 4.17)

      $ tipc bearer enable media eth dev eth0
      
      • 1

      If you want better redundancy and performance you can attach a second interface:

      	$ tipc bearer enable media eth dev eth1
      	If you want to run on UDP instead of directly on Ethernet use the following commands:$ tipc link list
      	$ tipc bearer enable media udp name UDP1 localip 192.168.123.102 (e.g.)
      	$ tipc bearer enable media udp name UDP2 localip 192.168.124.102 (e.g.)
      
      • 1
      • 2
      • 3
      • 4

      Provided you have set up another node the same way you can now list the links to it:

      $ tipc link list
      	broadcast-link: up
      	1001002:eth0-1001001:eth0: up
      	1001002:eth1-1001001:eth1: up
      
      • 1
      • 2
      • 3
      • 4

      At this stage you can also have a look at the service binding table:

      	$ tipc nametable show
      	Type     Lower       Upper     Scope    Port       Node
      	0        16781313    16781313  cluster  0          1001001
      	0        16781314    16781314  cluster  0          1001002
      	1        1           1         node     2535696389 1001002
      	2        16781313    16781313  node     0          1001002
      	2        16781313    16781313  node     65537      1001002
      
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7

      The two entries with service type 0 show that we have two nodes in the cluster, 1001001 and
      1001002 (i.e., the own node).
      The entry with service type 1 represents the built-in topology (service tracking) service.
      The two entries with service type 2 show the two links, as seen from the issuing (own) node 1001002.
      The range limits 16781313 represent the the peer endpoint’s address (1001001) in decimal format.

    • Running a Program

      Download and unpack the tipcutils package from the project page. The package comes ready with binaries,
      but is easy to rebuild if needed.

      In one shell, do:

      	$ ./tipcutils/demos/hello_world/hello_server
      	****** TIPC hello world server started *****
      
      • 1
      • 2

      You can now take another look at the address binding table:

      	$ tipc nametable show
      	Type     Lower       Upper     Scope    Port       Node
      	0        16781313    16781313  cluster  0          1001001
      	0        16781314    16781314  cluster  0          1001002
      	1        1           1         node     2535696389 1001002
      	2        16781313    16781313  node     0          1001002
      	2        16781313    16781313  node     65537      1001002
      	18888    17          17        cluster  1697554572 1001002
      
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8

      The server has bound itself to the service type 18888 and instance 17, and made itself visible
      in the whole cluster.

      In another shell, on the same node or on the peer node, you can now do:

      	$ ./tipcutils/demos/hello_world/hello_client
      	****** TIPC hello world client started ******
      	Client: sent message: Hello World!!
      	Client: received response: Uh ?
      	****** TIPC hello client finished ******
      
      • 1
      • 2
      • 3
      • 4
      • 5

      If you now redo this exercise, but start the client before the server, you will see a simple
      example of start synchronization by leveraging the service tracking feature.

    • Downloading the Code

      The kernel source code can be checked out from:

      $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
      
      • 1

      The ‘tipc’ tool for configuring and managing TIPC is available as a standard part of the iproute2 package,
      which is also available in all distros. The source code can be checked out from:

      $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
      
      • 1

      The ‘tipcutils’ package contains a set of demos and test programs. The downloadable .zip file comes complete
      with binaries, but is only a snapshot, so it may not always be up to date with the latest version in the git repository.
      This can can be checked out from:

      $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
      
      • 1
  • 相关阅读:
    字符串中strcmp和strncmp的比较
    学C语言的第一节课
    SpringCloud之Feign
    每日一练 | 华为认证真题练习Day114
    C#S7.NET实现西门子PLCDB块数据采集的完整步骤
    Debezium系列之:采集数据库数据实现对表指定的字段进行加密,下游实现对表加密后的字段进行解密
    CG-34 浊度传感器 简单说明
    C++ 智能指针总结
    深度学习系列48:超分模型Real-ESRGAN
    Delphi11.3FMX微信支付到个人账户源代码(手机POS机安卓源代码、手机APP收款机苹果源代码、PC源代码)
  • 原文地址:https://blog.csdn.net/a777122/article/details/125473491