SiteWhere is an industrial strength, open source IoT Application Enablement Platformwhich facilitates the ingestion, storage, processing, and integration of IoT device dataat massive scale. The platform leverages a microservices architecture which runs on top ofcutting-edge technologies such as Kubernetes, Istio,and Kafka in order to scale efficientlyto the loads expected in large IoT projects.
SiteWhere embraces a distributed architecture which runs on Kubernetes and providesboth infrastructure such as highly-available databases and MQTT brokers as well asmicroservices to facilitate various aspects of IoT project development. The platform isbuilt with a framework approach using clearly defined APIs so that new technologies may easilybe integrated as the IoT ecosystem evolves.
SiteWhere is composed of Java-based microservices which are built asDocker images and deployed to Kubernetes fororchestration. To simplify installation and configuration, Helmis used to provide standard templates for various deployment scenarios. Helmchartsare provided to supply both the microservices and the dependencies needed torun a complete SiteWhere deployment. Infrastructure components includetechnologies such as Apache Zookeeper and Kafka, highly available databases suchas MongoDB, InfluxDB, and Cassandra, and other supporting technologiessuch as MQTT brokers.
Rather than using a monolithic approach, SiteWhere is based on many microservicesrunning as a distributed system. Each microservice is a completely self-containedentity that has its own configuration schema, internal components, data persistence,and interactions with the event processing pipeline. SiteWhere microservicesare built on top of a custom microservice framework and run as separateSpring Boot processes, eachcontained in its own Docker image.
Separating the system logic into microservices allows the interactionsbetween various areas of the system to be more clearly defined. It also allowsparts of the pipeline to be shutdown or fail gracefully without preventing otherparts of the system from functioning. The event processing pipeline, which spansmany of the microservices, is buffered by Kafka so that data processing hasstrong delivery guarantees while maintaining high throughput.
The microservice architecture allows individual functional areas of the system to be scaledindependently or left out completely. In use cases where REST processing tends tobe a bottleneck, multiple REST microservices can be run concurrently to handle the load.Conversely, services such as presence management that may not be required can be leftout so that processing power can be dedicated to other aspects of the system.
SiteWhere supports the concept of an instance, which allows the distributed systemto act as a cohesive unit with some aspects addressed at the global level. All of themicroservices for a single SiteWhere instance must be running on the same Kubernetesinfrastucture, though the system may be spread across tens or hundreds of machinesto distribute the processing load.
SiteWhere leverages Istio to provide a service mesh forthe system microservices, allowing the platform to be scaled dynamically whilealso providing a great deal of control over how data is routed. Istio allowsmodern methods such as canary testing and fault injection to be used toprovide a more robust and fault-tolerant system. It also allows for detailedmonitoring and tracing of the data flowing through the components.
SiteWhere configuration is stored in Apache ZooKeeperto allow for a scalable, externalized approach to configuration management. ZooKeepercontains a hierarchical structure which represents the configuration for one or moreSiteWhere instances and all of the microservices that are used to realize them. Theconfiguration is replicated for high availabilty.
Each microservice has a direct connection to ZooKeeper and uses the hierarchy todetermine its configuration at runtime. Microservices listen for changes to theconfiguration data and react dynamically to updates. No configurationis stored locally within the microservice, which prevents problems withkeeping services in sync as system configuration is updated.
Since many of the system components such as Zookeeper, Kafka, and variousdatabases require access to persistent storage, SiteWhere usesRook.io within Kubernetes to supply distributed,replicated block storage that is resilient to hardware failures whilestill offering good performance characteristics. As storage and throughputneeds increase over time, new storage devices can be made availabledynamically. The underlying Ceph architectureused by Rook.io can handle exobytes of data while allowing datato be resilient to failures at the node, rack, or even datacenter level.
The event processing pipeline in SiteWhere uses Apache Kafkato provide a resilient, high-performance mechanism for progressively processing deviceevent data. Microservices can plug in to key points in the event processing pipeline,reading data from well-known inbound topics, processing data, then sending data to well-knownoutbound topics. External entites that are interested in data at any point in the pipelinecan act as consumers of the SiteWhere topics to use the data as it moves through the system.
The SiteWhere event processing pipeline leverages Kafka's messaging constructs to allowdevice event data to be processed asynchronously. If a microservice shuts down and no otherreplicas are available to process the load. The data will be queued until a replica startsand begins processing again. This acts as a guarantee against data loss as data is alwaysbacked by Kafka's high-performance storage. SiteWhere microservices leverage Kafka's consumergroups concept to distribute load across multiple consumers and scale processing accordingly.
Using Kafka also has other advantages that are leveraged by SiteWhere. Since all data inthe distributed log is stored on disk, it is possible to "replay" the event stream basedon previously gathered data. This is extremely valuable for aspects such as debuggingprocessing logic or load testing the system.
While device event data generally flows in a pipeline from microservice to microservice onKafka topics, there are also API operations that need to occur in real time between themicroservices. For instance, device management and event management functions are contained intheir own microservices, but are required by many other components of the system. Many of theSiteWhere microservices offer APIs which may be accessed by other microservices tosupport aspects such as storing persistent data or initiating microservice-specificservices.
Rather than solely using REST services based on HTTP 1.x, which tend to have significantconnection overhead, SiteWhere uses gRPC to establish a long-livedconnection between microservices that need to communicate with each other. Since gRPC usespersistent HTTP2 connections, the overhead for interactions is greatly reduced, allowingfor decoupling without a significant performance penalty. Istio also allows the gRPCconnections to be multiplexed across multiple replicas of a microservice to scaleprocessing and offer redundancy.
The entire SiteWhere data model has been captured inGoogle Protocol Buffers format so thatit can be used within GRPC services. All of the SiteWhere APIs are exposed directly asgRPC services as well, allowing for high-performance, low-latency access to all APIfunctions. The REST APIs are still made available via the Web/REST microservice (actingas an API gateway), but they use the gRPC APIs underneath to provide a consistent approachto accessing data.
SiteWhere is designed for large-scale IoT projects which may involve many system tenantssharing a single SiteWhere instance. A key differentiator for SiteWhere compared to mostIoT platforms is that each tenant runs in isolation from other tenants. By default, tenantsdo not share database resources or pipeline processing and have a completely separateconfiguration lifecycles. With this approach, each tenant may use its own databasetechnologies, external integrations, and other configuration options. Parts of the tenant'sprocessing pipeline may be reconfigured/restarted without causing an interruption toother tenants.
An important consequence of the way SiteWhere handles multitenancy is that each tenant'sdata is separated from the data of other tenants. Most platforms that offer multitenancystore data for all tenants in shared tables, differentiated only by a tenant id. The sharedapproach opens up the possibility of one tenant's data corrupting another, which is notan acceptable risk in many IoT deployments. In addition, each tenant has its own processingpipelines, so in-flight data is never co-mingled either.
Having dedicated resources for tenants can be expensive in terms of memory and processingresources, so SiteWhere also offers the concept of customers within each tenant. Customersallow data to be differentiated within a tenant, but without having a separate dedicateddatabase and pipelines. In cases where colocated data is acceptable, the tenant can haveany number of customers, which shared the same database and processing pipeline. This allowsthe best of both worlds in terms of security and scalability.
Copyright (c) 2009-2019 SiteWhere LLC. All rights reserved.
1. 关于持久化数据问题 SiteWhere 2.0内部微服务需要持久化数据,官方部署文档要求使用helm安装sitewhere 2.0 之前先安装rook.io(提供数据卷功能)。在安装好rook,并确认rook的pod都处于“running”后,继续执行部署文档步骤,最后使用下面命令安装sitewhere 2.0: helm install --name sitewhere sitewhere
发送和接收设备数据 - 将设备和其他代理连接到SiteWhere 将数据发送到SiteWhere SiteWhere旨在灵活地发送和接收来自设备和其他代理的数据。大多数流行的通信协议和编码都支持开箱即用,但系统的设计也很容易扩展。每个系统租户可以配置任意数量的协议,以便与设备进行通信。默认情况下,租户被配置为通过MQTT进行通信,支持多种编码以允许与多种类型的设备进行交互。 使用REST服
首先看一下项目代码的组织结构 ├─gradle │ └─wrapper ├─service-asset-management │ └─src │ └─main │ ├─java │ │ └─com │ │ └─sitewhere │ │ └─asset │ │
这篇简短的文章描述了一个基于 SiteWhere 开源物联网平台的智慧城市用例。 SiteWhere总部位于佐治亚州亚特兰大,是一个开源物联网应用程序支持平台 (AEP),提供两种解决方案。首先,SiteWhere 的社区版 (CE) 是在 CPAL 许可下提供的。对于此解决方案,SiteWhere 的战略是成为流行的开源物联网平台。SiteWhere 支持内部部署和云部署模型以及使用可插入和可扩
站点:站点是代表部署设备的物理区域的顶级实体。 租户:SiteWhere租户允许多个客户在单个SiteWhere实例上并排运行。每个租户都有自己的数据存储和处理管道,因此不会混淆数据。每个租户都有自己的配置,可以扩展全局配置,从而可以按租户定制各个方面。SiteWhere实例中至少需要一个租户。如果使用从全局用户模型初始值设定项填充的样本数据,则会自动添加id为default的租户。 用户:Sit
核心平台技术 SiteWhere使用以下开源组件: Apache Tomcat 7 Tomcat提供SiteWhere运行的核心服务器。SiteWhere被部署为在Tomcat服务器启动时运行的Web档案(WAR文件)。 Spring框架 Spring提供了引导SiteWhere并允许对其进行配置和扩展的核心配置框架。SiteWhere没有使用硬编码组件,而是有一组核心的服务提供者接口和接口的默认
What is SiteWhere? SiteWhere is an open source M2M/IoT integration platform. It provides system that choreographs the gathering, storage, processing, and routing of device data. SiteWhere provides the
潜在用例 SiteWhere的可能用途是无穷无尽的。几乎任何行业都可以受益于某种程度的监控,自动化和分析。以下是SiteWhere实际使用的几个示例: 车辆跟踪 无论是监控租赁车队还是一些非常昂贵的重型设备,追踪车辆的位置并随时监测其状况都是有意义的。基于SiteWhere的自动化系统可以帮助防盗,监控服务间隔或根据车型指出维护成本的趋势。 家庭自动化 家庭自动化是物联网发展最快的领域之一。曾经被
什么是SiteWhere? SiteWhere是一个具有工业强度的开源IoT应用程序支持平台,可以大规模地帮助获取,存储,处理和集成设备数据。该平台基于现代微服务体系结构,并且从可靠,高吞吐量,低延迟处理和动态可扩展性开始设计。SiteWhere充分利用Apache Kafka和Docker等经过验证的技术,以便有效扩展到大型IoT项目预期的负载。SiteWhere不采用单一体系结构,而是采用完全
sitewhere-deploy sitewhere自动部署脚本(Ubuntu 16.04) [关于我们] email:18829897162@163.com [使用方法] 部署: $ sudo bash deploy.sh 启动: $ sudo bash run.sh [组成] jdk + MongoDB + hi
assets : Operations related to SiteWhere assets. 资产:资产的相关操作来SiteWhere。 assignments : Operations related to SiteWhere device assignments. 任务:去SiteWhere装置作业的相关操作。 authorities : Operations related to S