Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No data saved in the database with devicehive-cassandra plugin #28

Open
tomyc opened this issue Aug 26, 2018 · 0 comments
Open

No data saved in the database with devicehive-cassandra plugin #28

tomyc opened this issue Aug 26, 2018 · 0 comments

Comments

@tomyc
Copy link

tomyc commented Aug 26, 2018

I have two instances, one is used for devicehive-docker with plugin management enabled and the second instance is used for the Cassandra database. The communication between machines is working, the firewall is set. Running devicehive-cassandra plugin with docker produce the output as follows:

Creating devicehive-plugin-cassandra-node_schema_1 ... done
Creating devicehive-plugin-cassandra-node_plugin_1 ... done
Attaching to devicehive-plugin-cassandra-node_schema_1, devicehive-plugin-cassandra-node_plugin_1
schema_1  |
schema_1  | > [email protected] schema /usr/src/app
schema_1  | > node ./plugin/cassandraSchema/index.js
schema_1  |
schema_1  | 2018-08-26T19:07:13.316Z cassandrastoragemodule Will try to drop 4 table schemas
schema_1  | 2018-08-26T19:07:13.317Z cassandrastoragemodule Will try to drop 1 user defined type schema
schema_1  | 2018-08-26T19:07:13.317Z cassandrastoragemodule Comparing table schemas
schema_1  | 2018-08-26T19:07:13.347Z cassandrastoragemodule Creating 1 user defined type
schema_1  | 2018-08-26T19:07:13.348Z cassandrastoragemodule Executing CREATE TYPE IF NOT EXISTS params(name text,id int,address inet)
schema_1  | 2018-08-26T19:07:13.546Z cassandrastoragemodule Executed successfully: CREATE TYPE IF NOT EXISTS params(name text,id int,address inet)
schema_1  | 2018-08-26T19:07:13.546Z cassandrastoragemodule Creating 4 tables
schema_1  | 2018-08-26T19:07:13.548Z cassandrastoragemodule Executing CREATE TABLE IF NOT EXISTS commands(command text,deviceId text,timestamp timestamp,id int,parameters frozen<params>,PRIMARY KEY((command,deviceId),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC) AND bloom_filter_fp_chance = 0.05 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = 'text' AND compaction = {'class':'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy','max_threshold':128,'min_threshold':12} AND compression = {'chunk_length_in_kb':128,'class':'org.apache.cassandra.io.compress.SnappyCompressor'} AND crc_check_chance = 0.8 AND dclocal_read_repair_chance = 0.2 AND default_time_to_live = 60000 AND gc_grace_seconds = 432000 AND max_index_interval = 4096 AND memtable_flush_period_in_ms = 10000 AND min_index_interval = 256 AND read_repair_chance = 0.5 AND speculative_retry = '228ms'
schema_1  | 2018-08-26T19:07:13.548Z cassandrastoragemodule Executing CREATE TABLE IF NOT EXISTS notifications_by_timestamp(notification text,timestamp timestamp,parameters text,PRIMARY KEY((notification),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC)
schema_1  | 2018-08-26T19:07:13.548Z cassandrastoragemodule Executing CREATE TABLE IF NOT EXISTS notifications_by_deviceid(notification text,deviceId text,PRIMARY KEY((notification),deviceId))
schema_1  | 2018-08-26T19:07:13.548Z cassandrastoragemodule Executing CREATE TABLE IF NOT EXISTS command_updates(command text,deviceId text,timestamp timestamp,PRIMARY KEY((command,deviceId),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC)
schema_1  | 2018-08-26T19:07:13.783Z cassandrastoragemodule Executed successfully: CREATE TABLE IF NOT EXISTS commands(command text,deviceId text,timestamp timestamp,id int,parameters frozen<params>,PRIMARY KEY((command,deviceId),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC) AND bloom_filter_fp_chance = 0.05 AND caching = {'keys':'ALL','rows_per_partition':'NONE'} AND comment = 'text' AND compaction = {'class':'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy','max_threshold':128,'min_threshold':12} AND compression = {'chunk_length_in_kb':128,'class':'org.apache.cassandra.io.compress.SnappyCompressor'} AND crc_check_chance = 0.8 AND dclocal_read_repair_chance = 0.2 AND default_time_to_live = 60000 AND gc_grace_seconds = 432000 AND max_index_interval = 4096 AND memtable_flush_period_in_ms = 10000 AND min_index_interval = 256 AND read_repair_chance = 0.5 AND speculative_retry = '228ms'
plugin_1  |
plugin_1  | > [email protected] start /usr/src/app
plugin_1  | > node ./plugin/index.js
plugin_1  |
schema_1  | 2018-08-26T19:07:14.013Z cassandrastoragemodule Executed successfully: CREATE TABLE IF NOT EXISTS notifications_by_timestamp(notification text,timestamp timestamp,parameters text,PRIMARY KEY((notification),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC)
schema_1  | 2018-08-26T19:07:14.449Z cassandrastoragemodule Executed successfully: CREATE TABLE IF NOT EXISTS notifications_by_deviceid(notification text,deviceId text,PRIMARY KEY((notification),deviceId))
plugin_1  | Plugin is starting
plugin_1  | Plugin has been started. Subscribed: true. Topic: plugin_topic_f31f5a44-0ba3-4798-ba77-c4054d5b6e16
plugin_1  | NEW HEALTH CHECK TYPE MESSAGE. Payload: {"prx":"Available","mb":"Available","mbfp":"-0.00","comm":"Available"}
plugin_1  | 2018-08-26T19:07:14.758Z cassandrastoragemodule Comparing table schemas
schema_1  | Cassandra schemas have been created
schema_1  | 2018-08-26T19:07:14.900Z cassandrastoragemodule Executed successfully: CREATE TABLE IF NOT EXISTS command_updates(command text,deviceId text,timestamp timestamp,PRIMARY KEY((command,deviceId),timestamp)) WITH CLUSTERING ORDER BY(timestamp DESC)
devicehive-plugin-cassandra-node_schema_1 exited with code 0
plugin_1  | info: Cassandra connection initialized
plugin_1  | 2018-08-26T19:07:15.863Z cassandrastoragemodule Checking schema existence

I use devicehive simulator to produce notifications. I'm able to receive those notifications with the devicehive admin panel as well with Grafana and my customs applications. Unfortunately, there is nothing written inside the database. I was checking the communication between plugin and database, yet the schema service produces tables and UDT properly but the plugin doesn't send any data to the database. My .env file as well plugin-config.js are set as depicted below:
.env

ENVSEPARATOR=_
DEBUG=cassandrastoragemodule
plugin_user_access_token="long_string_token"
plugin_user_refresh_token="long_string_token"
plugin_user_login=
plugin_user_password=
plugin_plugin_topic="plugin_topic_f31f5a44-0ba3-4798-ba77-c4054d5b6e16"
plugin_device_hive_plugin_ws_point=ws://192.168.1.1/plugin/proxy
plugin_device_hive_auth_service_api_url=http://192.168.1.1/auth/rest
plugin_subscription_group="cassandra_plugin"
cassandra_connection_keyspace=devicehive
cassandra_connection_username="cassandra"
cassandra_connection_password="cassandra"
cassandra_connection_contactPoints=192.168.1.2

plugin-config.js

{
  "DEVICE_HIVE_PLUGIN_WS_ENDPOINT": "ws://192.168.1.1/plugin/proxy",
  "DEVICE_HIVE_AUTH_SERVICE_API_URL": "http://192.168.1.1/auth/rest",
  "PLUGIN_TOPIC": "plugin_topic_f31f5a44-0ba3-4798-ba77-c4054d5b6e16",
  "PLUGIN_TOKEN_LIFE_TIME_MIN": 300,
  "USER_LOGIN": "user_devicehive",
  "USER_PASSWORD": "password",
  "USER_ACCESS_TOKEN": "",
  "USER_REFRESH_TOKEN": "",
  "PLUGIN_ACCESS_TOKEN": "long_string_token"
  "PLUGIN_REFRESH_TOKEN": "long_string_token"
  "AUTO_SUBSCRIPTION_ON_START": true,
  "SUBSCRIPTION_GROUP": "cassandra_plugin"
}

The plugin is set in the administrative panel.
I have no idea where to look for a solution. Please give me some advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant