Nebula是一个C++语言开发的事件驱动型的TCP协议网络框架

网友投稿 715 2022-11-04 21:07:04

Nebula是一个C++语言开发的事件驱动型的TCP协议网络框架

English | 中文                 Bwar's blog.

_ __ __ __ / | / /__ / /_ __ __/ /___ _ / |/ / _ \/ __ \/ / / / / __ `/ / /| / __/ /_/ / /_/ / / /_/ //_/ |_/\___/_.___/\__,_/_/\__,_/ one-click installation

Nebula : a powerful framwork for building highly concurrent, distributed, and resilient message-driven applications for C++.

OverviewFeaturesGetting StartDocumentationDepend onMain ProjectsTodo listChange log

Overview

Nebula is a flexible, high-performance business-oriented IoC distributed network framework developed in C++ language, designed for production environments. It supports multiple application layer communication protocols including proto3, http, https, and websocket. Nebula makes it easy to deploy a fast and high-performance distributed service with C++, while keeping the same server architecture and APIs. NebulaBootstrap provides out-of-the-box integration with Nebula service, but can be easily extended to serve other types of application.

Nebula is a production level framework and distributed solution project for instant messaging, data collection, real-time computing, message push and other applications, as well as web api services. There were production applications for instant messaging, data acquisition and real-time analysis on line now, and a recommendation engine application for a large user base will be born soon. By the way, using Nebula for toy-level projects is also good for learning network communication. Bwar welcomes more developers to join the Nebula project. Nebula is a proactor development framework(a framework-implemented proactor, not an operating system support). The IO-intensive application on nebula with be good performance.

Nebula can be used as a single high-performance TCP server, but building a cluster based on Nebula will be truly reflect its value. In order to build distributed service clusters quickly, Nebula Bootstrap cluster solutions including various types of services have been developed.

Features

Protocol communication such as http, protobuf, websocket, etc.Ssl connection encryptionMicroservices frameworkIoC containerDynamic service updateService registration and discoveryService monitoringConfiguration managementRoutingLoad balancingCircuit BreakersLeadership election and cluster state

Getting Start

Nebula was developed with C++11/C++14 standard, requires a compiler capable of the C++11-standard and at least gcc4.8(some C++14 features are replaced by C++11 standard when encountering a lower version of the compiler). We provides NebulaBootstrap, which allows developers to build and deploy Nebula quickly. Nebula will be a framework that be widely used. A distributed solution based on NebulaBootstrap will make it easy to develop micro-service applications in C++. All dependencies will be automatically resolved in the following build steps.

build step:

wget https://github.com/Bwar/NebulaBootstrap/archive/master.zip unzip master.zip; rm master.zip; mv NebulaBootstrap-master NebulaBootstrap; chmod u+x deploy.sh; chmod u+x deploy.sh ./deploy.sh Run deploy.sh, the NebulaBootstrap distributed services were build completed. The reliance of Nebula was also automatically downloaded and compiled by deploy from the Internet before the construction of Nebula. The deploy path as follows:

NebulaBootstrapbin         server bin location。build        build path,created by deploy.sh, if you do not need to build again, just delete it.(optional)。conf        configuration path.data        application data path. e.g. Nebio which is a data collect and real-time analysis application, write it's data to this path (optional).lib         library path.log         program logs path.plugins       plugins path. logic       plugins for logic server(optional). script       script path. deploy.sh, startup.sh and shutdown.sh were depend on this path.temp        temp file path(optional).configure.sh     run configure.sh for a simple configuration when deploy for the first time.deploy.sh      auto build and deploy.shutdown.sh      shutdown one or more server.startup.sh      startup one or more server.README_cn.mdREADME.md build completed, you can start the server:

./configure.sh./startup.s

The server should have started successfully now, startup.sh will print the server that had been started, If not, check logs for reason. Notice that the default configuration file of Nebula limits the number of connections per IP in a period. If you have a large amount of testing, you should check the configuration limit. If the server has been successfully started, testing with postman or curl.

# testing start with NebulaInterface only.curl -H "Content-Type:application/json" -X POST -d '{"name": "Nebula", "address":"https://github.com/Bwar/Nebula"}' http://${your_ip}:16003/hello# testing start with NebulaInterface,NebulaLogic and NebulaBeacon.curl -H "Content-Type:application/json" -X POST -d '{"name": "Nebula", "address":"https://github.com/Bwar/Nebula"}' http://${your_ip}:16003/hello_nebula

A simple testing can be start with a NebulaInterface only, and also can be start with NebulaBootstrap. NebulaBootstrap provided the a cluster HelloWorld, the testing will launch NebulaBeacon, NebulaInterface and NebulaLogic. This is a diagram of the cluster architecture:

Documentation

The complete documentation for Nebula is available: Nebula class reference

Depend on

protobuflibev or libevhirediscrypto++http_parse integrate into Nebula/src/util/httpCJsonObject integrate into Nebula/src/util/json

Main Projects

NebulaBootstrapNebulaBeaconNebulaInterfaceNebulaLogicNebulaMydisNebulaDbAgentNebulaLoggerNebulaAccessNebulaDynamicNebcli

Todo list

Complete writing user guide before September 2019.NebulaMydis Data Agency Service.Developing an IM with the Nebula.

Change log

v1.0

separate the network dispatch and actor management from Labor (Manager and Worker) to Dispatcher and ActorBuilderadd supports of Actor classes to Manager process, and move the manager system management features to Cmd and Stepadd Loaderoptimize Actor dynamic creatoroptimize HTTP connection and HTTP data sending and receivingRedisChannel bug fixedadd bind ipadd load stressadd codec auto switch

v0.10

the plugin version control dynamically unloads and loads the instant validation feature.optimize reflection dynamic creation of Actor.

v0.9

add Modeladd Chainsimplify Contextoptimize Actor

v0.8

compatible with gcc4.8 compiler.add cpu affinity inorder to support cpu binding.add dynamic library unload.

v0.7

add configuration management(check Nebcli for detail).

v0.6

NebulaBeacon adds node status information query, registration center leader-fllower election.NebulaInterface adds hello demo.

v0.5

add node info to worker the worker process terminated unexpectedly and restarted by the Manager.ipv6 support.

v0.4

distributed log service test passing.add https support.add keep alive settings to http channel.replace repeated http headers with proto3 map.provides a symmetric encryption key setup interface for channel.bug fix.

v0.3

rewrite with C++14create actors by reflection (using template)add distributed trace log

v0.2

the first runable version

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Coach是一个python强化学习框架,包含许多最先进算法的实现
下一篇:PlayerBase将播放器的繁杂功能其业务组件化处理的框架方案
相关文章