Author Archives: Raghavendar T S

Docker RabbitMQ – Default Username/Password Environment Variable Not Working – Solved

I was playing around with the official Docker image of RabbitMQ and I was trying to use RABBITMQ_DEFAULT_USER/RABBITMQ_DEFAULT_PASS environment variable to override the default username/password (guest/guest). I noticed that the username/password provided via the environment variables were set in the rabbitmq.conf file. Still I was neither able to access the queues using the API nor the management console. But I was able to login to the management console using the guest username.

Solution: Deleting the data directory and recreating the container solved the issue
Docker DataStax DSE Volume Mount Not Working – Solved

I was playing around with DataStax DSE Docker image using Docker Compose and noticed that the Docker volumes were not mounted. I was able to solve the issue by using named volume mounts (Docker Compose v3).

Not Working Docker Compose YAML

version: "2"
services:
  dse01:
    volumes:
      - /mnt/dse/data/cassandra:/var/lib/cassandra
      - /mnt/dse/data/spark:/var/lib/spark

Working Docker Compose YAML

version: "3.2"
services:
  dse01:
    volumes:
      - type: bind
        source: /mnt/dse/data/cassandra
        target: /var/lib/cassandra
      - type: bind
        source: /mnt/dse/data/spark
        target: /var/lib/spark

If  you are using Docker run command refer the following syntax

docker run ....
 --mount source=/mnt/dse/data/cassandra,target=/var/lib/cassandra 
.... datastax/dse-server
Remove/Delete/Drop a Property Value from a List/Array – Gremlin Query

Remove/Delete/Drop a Property Value from a List/Array – Gremlin Query

//Create Vertex
graph.addVertex(label, 'TEST_LABEL', 'id', '12345');

//Add value1, value2, value3 in the property 'test_property'
g.V().hasLabel('TEST_LABEL').has('id','12345').property('test_property', 'value1');
g.V().hasLabel('TEST_LABEL').has('id','12345').property('test_property', 'value2');
g.V().hasLabel('TEST_LABEL').has('id','12345').property('test_property', 'value3');

//Drop the value 'value2' alone from the property 'test_field'
 g.V().hasLabel('TEST_LABEL').has('id','12345')
.properties('test_property').hasValue('value2').drop();

Note that the property test_property is a multiple cardinality string data type.

Related Links

  1. Gremlin Query Language - Create Vertex/Node and Edge/Relationship
  2. Check If Vertex/Edge Exist - Gremlin Query - Titan
  3. Update Properties of Multiple Edges - Gremlin Query - Titan
  4. Update Properties of Multiple Vertices - Gremlin Query - Titan
  5. Create Vertex If Does Not Exist - Gremlin Query - Titan
  6. Query/Access Root Level Properties and Nested Properties of Vertex in Single Query - Gremlin Query - Titan
  7. Update Vertex If Exist - Gremlin Query - Titan
  8. Update Multiple Properties of Vertex - Gremlin Query - Titan
  9. Remove/Delete/Drop a Property Value from a List/Array – Gremlin Query
Read More...
Elasticsearch Geo-Shape Slow Indexing Performance – Solved

           We were using Hosted Elasticsearch 1.4.4 to index geo-shape data with the following field mapping.

{
    "geoShapeField": {
        "type": "geo_shape",
        "tree": "quadtree",
        "tree_levels": 26 //Or use precision: "1m",
        "distance_error_pct": 0.025 // Optional, 0.025 is default
    }
}

           Then we planned to move the cluster to AWS ES 6.2 and applied the same mapping except distance_error_pct. We noticed that indexing geo-shapes were very slow in AWS ES 6.2 due to a missing distance_error_pct configuration. In Elasticsearch 1.4.4, the distance_error_pct value is set to 0.025 by default. If we explicitly set the tree value, distance_error_pct  is set to 0 in Elasticsearch 6.2 by default.

           Set distance_error_pct  to 0 to gain maximum spatial precision with reduced indexing performance. The maximum value for distance_error_pct is 0.5. If you see any indexing issues after Elasticsearch upgrade for geo-shapes, set the distance_error_pct to 0.025 which is the default value in earlier versions of Elasticsearch.

References:
  1. https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-geo-shape-type.html
  2. https://www.elastic.co/guide/en/elasticsearch/reference/6.2/geo-shape.html
  3. https://github.com/elastic/elasticsearch/issues/25833
  4. https://github.com/elastic/elasticsearch/issues/22087
  5. https://github.com/elastic/elasticsearch/issues/16444
  6. http://elasticsearch-users.115913.n3.nabble.com/Geo-shape-questions-td4028334.html

 

Moto E/Moto G/Moto X – Bluetooth not working/switching on – Solved

           I personally own Moto G4 Plus and all of a sudden I was not able to enable Bluetooth. If I switch on, the switch button will be enabled and nothing happens. If I go back and navigate the to the Bluetooth screen again, the switch will be still disabled. So how to solve it??? Here are the simple steps which will reset the app preferences.

Steps:

  1. Go to Settings -> Apps
  2. In the top right corner, click the 3 dotted menu button
  3. Click Reset app preferences
  4. Enjoy !!!