- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我已经阅读了所有关于 cygnus 工作原理的文档,我专门测试了 this one成功地。我也看完了this教程,但我确信我没有正确配置某些东西。
在我创建的 cygnus_instance_1.conf 中:
CYGNUS_USER=root
CONFIG_FOLDER=/usr/cygnus/conf
CONFIG_FILE=/usr/cygnus/conf/agent_1.conf
AGENT_NAME=cygnusagent
LOGFILE_NAME=cygnus.log
ADMIN_PORT=8081
在 agent_1.conf 中我创建了:
#=============================================
# To be put in APACHE_FLUME_HOME/conf/cygnus.conf
#
# General configuration template explaining how to setup a sink of each of the available types (HDFS, CKAN, MySQL).
#=============================================
# The next tree fields set the sources, sinks and channels used by Cygnus. You could use different names than the
# ones suggested below, but in that case make sure you keep coherence in properties names along the configuration file.
# Regarding sinks, you can use multiple types at the same time; the only requirement is to provide a channel for each
# one of them (this example shows how to configure 3 sink types at the same time). Even, you can define more than one
# sink of the same type and sharing the channel in order to improve the performance (this is like having
# multi-threading).
cygnusagent.sources = http-source
cygnusagent.sinks = hdfs-sink mysql-sink ckan-sink
cygnusagent.channels = hdfs-channel mysql-channel ckan-channel
#=============================================
# source configuration
# channel name where to write the notification events
cygnusagent.sources.http-source.channels = hdfs-channel mysql-channel ckan-channel
# source class, must not be changed
cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnusagent.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnusagent.sources.http-source.handler = es.tid.fiware.fiwareconnectors.cygnus.handlers.OrionRestHandler
# URL target
cygnusagent.sources.http-source.handler.notification_target = /notify
# Default service (service semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service = def_serv
# Default service path (service path semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service_path = def_servpath
# Number of channel re-injection retries before a Flume event is definitely discarded (-1 means infinite retries)
cygnusagent.sources.http-source.handler.events_ttl = 10
# Source interceptors, do not change
cygnusagent.sources.http-source.interceptors = ts de
# Interceptor type, do not change
cygnusagent.sources.http-source.interceptors.ts.type = timestamp
# Destination extractor interceptor, do not change
cygnusagent.sources.http-source.interceptors.de.type = es.tid.fiware.fiwareconnectors.cygnus.interceptors.DestinationExtractor$Builder
# Matching table for the destination extractor interceptor, put the right absolute path to the file if necessary
# See the doc/design/interceptors document for more details
cygnusagent.sources.http-source.interceptors.de.matching_table = /usr/cygnus/conf/matching_table.conf
# ============================================
# OrionHDFSSink configuration
# channel name from where to read notification events
cygnusagent.sinks.hdfs-sink.channel = hdfs-channel
# sink class, must not be changed
cygnusagent.sinks.hdfs-sink.type = es.tid.fiware.fiwareconnectors.cygnus.sinks.OrionHDFSSink
# Comma-separated list of FQDN/IP address regarding the Cosmos Namenode endpoints
# If you are using Kerberos authentication, then the usage of FQDNs instead of IP addresses is mandatory
cygnusagent.sinks.hdfs-sink.cosmos_host = x1.y1.z1.w1,x2.y2.z2.w2
# port of the Cosmos service listening for persistence operations; 14000 for httpfs, 50070 for webhdfs and free choice for inifinty
cygnusagent.sinks.hdfs-sink.cosmos_port = 14000
# default username allowed to write in HDFS
cygnusagent.sinks.hdfs-sink.cosmos_default_username = cosmos_username
# default password for the default username
cygnusagent.sinks.hdfs-sink.cosmos_default_password = xxxxxxxxxxxxx
# HDFS backend type (webhdfs, httpfs or infinity)
cygnusagent.sinks.hdfs-sink.hdfs_api = httpfs
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.hdfs-sink.attr_persistence = column
# Hive FQDN/IP address of the Hive server
cygnusagent.sinks.hdfs-sink.hive_host = x.y.z.w
# Hive port for Hive external table provisioning
cygnusagent.sinks.hdfs-sink.hive_port = 10000
# Kerberos-based authentication enabling
cygnusagent.sinks.hdfs-sink.krb5_auth = false
# Kerberos username
cygnusagent.sinks.hdfs-sink.krb5_auth.krb5_user = krb5_username
# Kerberos password
cygnusagent.sinks.hdfs-sink.krb5_auth.krb5_password = xxxxxxxxxxxxx
# Kerberos login file
cygnusagent.sinks.hdfs-sink.krb5_auth.krb5_login_conf_file = /usr/cygnus/conf/krb5_login.conf
# Kerberos configuration file
cygnusagent.sinks.hdfs-sink.krb5_auth.krb5_conf_file = /usr/cygnus/conf/krb5.conf
# ============================================
# OrionCKANSink configuration
# channel name from where to read notification events
cygnusagent.sinks.ckan-sink.channel = ckan-channel
# sink class, must not be changed
cygnusagent.sinks.ckan-sink.type = es.tid.fiware.fiwareconnectors.cygnus.sinks.OrionCKANSink
# the CKAN API key to use
cygnusagent.sinks.ckan-sink.api_key = ckanapikey
# the FQDN/IP address for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_host = x.y.z.w
# the port for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_port = 80
# Orion URL used to compose the resource URL with the convenience operation URL to query it
cygnusagent.sinks.ckan-sink.orion_url = http://localhost:1026
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.ckan-sink.attr_persistence = row
# enable SSL for secure Http transportation; 'true' or 'false'
cygnusagent.sinks.ckan-sink.ssl = false
# ============================================
# OrionMySQLSink configuration
# channel name from where to read notification events
cygnusagent.sinks.mysql-sink.channel = mysql-channel
# sink class, must not be changed
cygnusagent.sinks.mysql-sink.type = es.tid.fiware.fiwareconnectors.cygnus.sinks.OrionMySQLSink
# the FQDN/IP address where the MySQL server runs
cygnusagent.sinks.mysql-sink.mysql_host = localhost
# the port where the MySQL server listes for incomming connections
cygnusagent.sinks.mysql-sink.mysql_port = 3306
# a valid user in the MySQL server
cygnusagent.sinks.mysql-sink.mysql_username = root
# password for the user above
cygnusagent.sinks.mysql-sink.mysql_password = klasika
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.mysql-sink.attr_persistence = column
#=============================================
# hdfs-channel configuration
# channel type (must not be changed)
cygnusagent.channels.hdfs-channel.type = memory
# capacity of the channel
cygnusagent.channels.hdfs-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnusagent.channels.hdfs-channel.transactionCapacity = 100
#=============================================
# ckan-channel configuration
# channel type (must not be changed)
cygnusagent.channels.ckan-channel.type = memory
# capacity of the channel
cygnusagent.channels.ckan-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnusagent.channels.ckan-channel.transactionCapacity = 100
#=============================================
# mysql-channel configuration
# channel type (must not be changed)
cygnusagent.channels.mysql-channel.type = memory
# capacity of the channel
cygnusagent.channels.mysql-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnusagent.channels.mysql-channel.transactionCapacity = 100
虽然我没有使用 OrionHDFSSink 和 OrionCKANSink,但我没有接触这些配置,因为我真的不确定我应该做什么。
当我最终 subscribeContext 和 target cygnus @ default port 5050 时,我得到了正常响应,但我的数据库中没有创建任何内容
我在这里做错了什么?
最佳答案
首先,随意删除 HDFS 和 CKAN 配置部分。在运行 Cygnus 时,您将避免与这些组件相关的不必要的日志。当然,记得删除所有对接收器和 channel 的引用;具体来说:
cygnusagent.sources = http-source
cygnusagent.sinks = mysql-sink
cygnusagent.channels = mysql-channel
...
cygnusagent.sources.http-source.channels = mysql-channel
其次,您的问题的答案可以在文档中找到:
<我>在表格中,我们可以找到两个选项:
关于数据内部表示的连接器行为由配置参数 attr_persistence 控制,其值可以是行或列。
可能是写的有问题,我觉得最后一段一定要enda "...整个值可以是行或列,其行为分别对应于上面描述的选项".
即如果您使用的是列模式,则必须提前配置数据库和表。
有一个similar question我在这里更详细地解释了这种行为。
喂!
关于mysql - 如何使用cygnus在MySql中存储数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29776890/
我们在 cygnus 中遇到了问题。日志中出现此错误。 java.lang.OutOfMemoryError:Java 堆空间 我们已经更改了分配给 cygnus 的内存,但我们不知道它是否正确。 修
我想使用 Fiware cygnus 将数据从上下文代理保存到 CKAN 实例中。我已经在 Fiware 云上创建了一个 orion-psb-image-R5.4 版本 1.7.0 的 orion 上
我已经安装了cygnus在我的 CentOS 7.0 上使用 RPM,但我无法作为服务启动: [centos@cygnus-mongo ~]$ sudo service cygnus start St
我正在使用一些 FIWARE 组件(Orion 2.4.0-bext 和 Cygnus 2.3.0)。此外,我使用 mongoDB(版本 3.6)获取当前上下文信息,使用 MySQL(版本 5.7)使
已编辑 我先尝试安装 cgynus-ngsi ,然后先安装现成的镜像并测试其是否可以正常工作, 但是当尝试重新配置 agent.conf 时,我编辑了文件并尝试从头开始安装cgynus-ngsi时发现
我让 cygnus 在行模式下自动工作得很好。但是我想切换到列模式,这意味着我现在必须使用适当的列类型手动设置我的表(对吗?)。 我认为属性的列类型应该与我在上下文代理中指定的类型相对应(即温度:浮点
我在固件镜像 CentOS-7-x64 上使用 RPM 安装了 cygnus,但无法将其作为服务启动,这是我的日志: [centos@cygnus-mongo conf]$ sudo service
当尝试将实体从 Cygnus 持久保存到 Cosmos 全局实例时,它失败了。 查看日志文件,我看到类似的内容: 2015 15:31:50,006 DEBUG [SinkRunner-Polling
我正在尝试设置和理解 Cygnus。但是我在安装过程中遇到了问题。 我按照下面给出的步骤。 使用 Docker 安装 Cygnus (docker run -d -p 5050:5050 -p 808
我在 Cygnus 模块上遇到了一个奇怪的行为。我正在使用 Context Broker 0.28 版和 Cygnus 0.13 版。假设我在 CB(上下文代理)上加载了一些与此类似的实体: (cur
我已经在 CentOS 6.9 机器上干净安装了 Fiware(Orion ContextBroker、MongoDB、Java JDK 和 Cygnus)。但是我遇到了 Cygnus 的问题,我无法
所以我已经阅读了所有文档并遵循了 MySQL persistence 上的教程但我仍然无法在 MySQL 数据库中保存任何类型的数据。 即使我设置了 presistence mode = row,它也
我想以 Parquet 格式存储事件数据(例如,在 HDFS 上)。我需要修改相应接收器的代码,还是有办法解决?例如,使用 Flume 拦截器。谢谢。 最佳答案 一方面,有一个 issue关于 Cyg
我目前有一个工作流程: Fiware Orion -> Fiware Cygnus -> Kafka -> Logstash -> Elasticsearch -> Kibana 我想直接将数据从 C
如何配置Cygnus将数据保存在SQL数据库上?安装 Orion 和 Cosmos 后,我尝试配置 cygnus 并将数据保存在 mysql 数据库上。可能吗? 最佳答案 使用 Cygnus,您可以通
当尝试从源代码构建fiware / cygnus docker镜像时,其最后一部分,即使用以下命令从jar中构建镜像: docker build -f ./docker/Dockerfile -t f
我在 cygnus instance in Docker 上遇到此错误: java.lang.OutOfMemoryError: GC overhead limit exceeded 如何修复它? 最
我已经在固件镜像 CentOS-7-x64 上安装了 cygnus 0.8.2,我使用以下方式订阅了 orion 上下文代理: (curl 193.48.247.246:1026/v1/subscri
我正在使用 cygnus 在 MySQL 数据库和 Cosmos 中存储数据。将数据存储在 cosmos 中可以正常工作,但是当存储在 MySQL 中时,特别是使用属性“cygnusagent.sin
现在我正在尝试为我的猎户座数据创建一个包含所有实体信息的数据集。 我设置正确,当一些数据发生变化时,orion 会向 cygnus 发送通知,然后,cygnus 会将数据添加到 ckan。 如图所示。
我是一名优秀的程序员,十分优秀!