Using Janusgraph with AWSKeyspaces. While adding a vertex from the gremlin console I get an error saying `Lock write retry count exceeded` - gremlin

Gremlin Console:
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> graph
==>standardjanusgraph[cql:[cassandra.us-east-2.amazonaws.com]]
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[cql:[cassandra.us-east-2.amazonaws.com]], standard]
gremlin> g.addV('student').property('name', 'Jeffery').property('GPA', 'A+');
Lock write retry count exceeded
My settings are like below
janusgraph.storage.cql.ssl.enabled: "true"
janusgraph.index.search.hostname: jce-elastic
janusgraph.storage.cql.local-datacenter: "us-east-2"
janusgraph.storage.cql.partitioner-name: DefaultPartitioner
janusgraph.storage.cql.metadata-schema-enabled: "false"
janusgraph.storage.cql.metadata-token-map-enabled: "false"
janusgraph.storage.cql.only-use-local-consistency-for-system-operations: "true"
janusgraph.log.janusgraph.key-consistent: "true"
janusgraph.log.tx.key-consistent: "true"
janusgraph.storage.cql.read-consistency-level: "LOCAL_QUORUM"
janusgraph.storage.cql.write-consistency-level: "LOCAL_QUORUM"
janusgraph.graph.assign-timestamp: "false"
Following are the server logs
jce-janusgraph | 232996 [gremlin-server-exec-4] WARN org.janusgraph.diskstorage.locking.consistentkey.ConsistentKeyLocker - Lock write succeeded but took too long: duration PT0.248S exceeded limit PT0.1S
jce-janusgraph | 233251 [gremlin-server-exec-4] WARN org.janusgraph.diskstorage.locking.consistentkey.ConsistentKeyLocker - Lock write succeeded but took too long: duration PT0.255S exceeded limit PT0.1S
jce-janusgraph | 233499 [gremlin-server-exec-4] WARN org.janusgraph.diskstorage.locking.consistentkey.ConsistentKeyLocker - Lock write succeeded but took too long: duration PT0.248S exceeded limit PT0.1S
jce-janusgraph | 233747 [gremlin-server-exec-4] ERROR org.janusgraph.graphdb.database.StandardJanusGraph - Could not commit transaction [1] due to exception
jce-janusgraph | org.janusgraph.diskstorage.locking.TemporaryLockingException: Temporary locking failure
jce-janusgraph | at org.janusgraph.diskstorage.locking.AbstractLocker.writeLock(AbstractLocker.java:306)
jce-janusgraph | at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStore.acquireLock(ExpectedValueCheckingStore.java:102)
jce-janusgraph | at org.janusgraph.diskstorage.keycolumnvalue.KCVSProxy.acquireLock(KCVSProxy.java:52)
jce-janusgraph | at org.janusgraph.diskstorage.BackendTransaction.acquireIndexLock(BackendTransaction.java:258)
jce-janusgraph | at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:634)
jce-janusgraph | at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:755)
jce-janusgraph | at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1525)
jce-janusgraph | at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.doCommit(JanusGraphBlueprintsGraph.java:322)
jce-janusgraph | at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.commit(AbstractTransaction.java:104)
jce-janusgraph | at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.commit(JanusGraphBlueprintsGraph.java:300)

The configuration below should work, but it requires that the RandomPartitoner is enabled (tested using JanusGraph 0.6.1)
https://docs.aws.amazon.com/keyspaces/latest/devguide/working-with-partitioners.html
storage.hostname=cassandra.us-east-1.amazonaws.com
storage.port=9142
storage.cql.ssl.enabled=true
storage.cql.ssl.truststore.location=cassandra_truststore.jks
storage.cql.ssl.truststore.password=mySecret
graph.assign-timestamp=false
storage.cql.only-use-local-consistency-for-system-operations=true
storage.cql.read-consistency-level=LOCAL_QUORUM
storage.cql.write-consistency-level=LOCAL_QUORUM
log.janusgraph.key-consistent=true
log.tx.key-consistent=true
storage.cql.metadata-schema-enabled=true
storage.cql.metadata-token-map-enabled=true
storage.cql.partitioner-name=RandomPartitioner

Related

Can't validate keystone endpoint when I trying to define an OpenStack cloud for juju

I am trying to define an OpenStack cloud for juju. To do this, I have first deployed Devstack using the following configuration in the local.conf file:
$ cat local.conf | grep -v "#" | grep -v "^$"
[[local|localrc]]
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=172.29.21.181
FLOATING_RANGE=172.29.20.1/22
Q_FLOATING_ALLOCATION_POOL=start=172.29.21.182,end=172.29.21.184
PUBLIC_NETWORK_GATEWAY=172.29.21.181
ENABLED_SERVICES+=,tls-proxy
ENABLED_SERVICES+=,g-api,g-reg
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data
After a successful deployment, these are the endpoints:
$ openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
| 0b489b8a683d4be489448230437e39ca | RegionOne | cinder | block-storage | True | public | https://172.29.21.181/volume/v3/$(project_id)s |
| 0b9e96cfe0b440b781171ac0b082de3a | RegionOne | keystone | identity | True | admin | https://172.29.21.181/identity |
| 29ce5b2061dd474492f3aebda164acd0 | RegionOne | cinderv2 | volumev2 | True | public | https://172.29.21.181/volume/v2/$(project_id)s |
| 45e10e75eb6848f5a934674373962e11 | RegionOne | glance | image | True | public | https://172.29.21.181/image |
| 8c35460b8c0d4c21ac9b7dd27bc92c48 | RegionOne | keystone | identity | True | public | https://172.29.21.181/identity |
| af451150c3094497936fd6877380d877 | RegionOne | placement | placement | True | public | https://172.29.21.181/placement |
| b3907f627f684ada8526b89c2c9683f9 | RegionOne | neutron | network | True | public | https://172.29.21.181:9696/ |
| c642b07700b54be39e1dd537e8c0f8be | RegionOne | nova | compute | True | public | https://172.29.21.181/compute/v2.1 |
| dbb94215bc89457383a390a0490a89f6 | RegionOne | nova_legacy | compute_legacy | True | public | https://172.29.21.181/compute/v2/$(project_id)s |
| e1037ed336d541b080e365caa0020e78 | RegionOne | cinderv3 | volumev3 | True | public | https://172.29.21.181/volume/v3/$(project_id)s |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
But when I try to add the cloud to juju using the "juju add-cloud" command (I am following the indications of this link: https://juju.is/docs/olm/openstack) I get the following error:
$ juju add-cloud openstack
This operation can be applied to both a copy on this client and to the one on a controller.
No current controller was detected and there are no registered controllers on this client: either bootstrap one or register one.
Cloud Types
lxd
maas
manual
openstack
vsphere
Select cloud type: openstack
Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181/identity
Can't validate endpoint: No Openstack server running at https://172.29.21.181/identity
Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181/identity/v3
Can't validate endpoint: No Openstack server running at https://172.29.21.181/identity/v3
Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: http://172.29.21.181/identity
Can't validate endpoint: No Openstack server running at http://172.29.21.181/identity
Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181:5000/v3
Can't validate endpoint: No Openstack server running at https://172.29.21.181:5000/v3
I can curl the url:
$ curl https://172.29.21.181/identity
{"versions": {"values": [{"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://172.29.21.181/identity/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}]}}
And I can connect to the port where Keystone is listening:
$ nc -vz 172.29.21.181 5000
Connection to 172.29.21.181 5000 port [tcp/*] succeeded!
I set no_proxy=127.0.0.1,localhost,172.29.21.181 and NO_PROXY=127.0.0.1,localhost,172.29.21.181
as environment variables, because searching for solutions on the Internet I understood that maybe it could solve my problem. But it didn't work.
Apart from this cloud I have another one deployed through Openstack-Ansible. In this cloud I have not encountered this error, the only difference I see is that the url is https://{HOST_IP}:5000/v3.
If anyone has any ideas it would be very helpful, thank you.
I have found a way to bypass this error, but I don’t know exactly why. I have modified the OS_AUTH_URL environment variable to end in “/v3”:
$ unset OS_AUTH_URL
$ export OS_AUTH_URL=https://172.29.21.181/identity/v3
Now, after using it as suggested value when running “juju add-cloud”, I don’t get the error when running “juju bootstrap”. I guess when you enter the url manually, juju checks the validity of it and fails for some code reason maybe. Having skipped that check, I guess the “juju bootstrap” command will directly use the url ending in “/v3” which is correct and works.
Now I get the following error:
$ juju bootstrap openstack --verbose
Adding contents of "/opt/stack/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
Creating Juju controller "openstack-regionone" on openstack/RegionOne
Loading image metadata
ERROR failed to bootstrap model: no image metadata found
But I guess I just have to add Swift to my deployment and follow the instructions in this link: https://juju.is/docs/olm/cloud-image-metadata

How can I define local dependencies between roles in a collection in ansible?

I have a question about dependencies between roles in a collection.
In general, I am concerned if it is possible to define dependencies between roles in a collection - local dependencies like a relative path.
I would like to implement scenarios:
roleB depends on roleA
default scenario of roleC should use roleA in prepare.yml to set up the environment
or
default scenario of roleC should use roleA in converge.yml
I would like to get these dependencies as local dependencies.
For case 2, I tried to use the requriments.yml file
with the appropriate entry in molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
.. ...
provisioner:
name: ansible
# env:
# ANSIBLE_ROLES_PATH: "../../roles"
playbooks:
prepare: prepare.yml
config_options:
defaults:
remote_user: ansible
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
requirements-file: requirements.yml
verifier:
name: ansible
But unfortunately I can't solve the error:
ERROR [1m[0;34mUsing /etc/ansible/ansible.cfg as config file[1m[0m
Starting galaxy role install process
- downloading role from file://../../tool-box
[1m[0;31m [ERROR]: failed to download the file: <urlopen error [Errno 2] No such file or[1m[0m
[1m[0;31mdirectory: '/../tool-box'>[1m[0m
[1m[1;35m[WARNING]: - tool-box was NOT installed successfully.[1m[0m
[1m[0;31mERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.[1m[0m
Structure of collection with roles:
mynamespace
|
|-- mycollection
|
| --roles
|
| -- roleA --
| |--molecule
| |
| |--default
|
| -- roleB --
| |--molecule
| |
| |--default
|
| -- roleC --
| |--molecule
| |
| |--default
Thank you.
Update:
See request issue in ansible/galaxy:
https://github.com/ansible/galaxy/issues/2719
I added this because I don't think there is such functionality.

kusto function to parse json which is number

i could not able to parse the below json value , I tried with parse_json() and todynamic() ,I m getting the result column values to be empty
]1
the issue is that your payload includes an internal invalid JSON payload.
it is possible to "fix" it using the query language (see usages of replace() in the example below), however it'd be best if you can write a valid JSON payload to begin with.
try running this:
print s = #'{"pipelineId":"63dfc1f6-5a43-5bca-bffe-6a36a435e19d","vmId":"9252382a-814f-4d02-9b1b-305db4caa208/usl-exepipe-dev/westus/usl-exepipe-lab-dev/asuvp306563","artifactResult":{"Id":"execution-job-2","SourceName":"USL Repository","ArtifactName":"install-lcu","Status":"Succeeded","Parameters":null,"Log":"[{\"code\":\"ComponentStatus/StdOut/succeeded\",\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\":\"2020-06-02T14:33:04.711Z | I | Starting artifact ''install-lcu''\r\n2020-06-02T14:33:04.867Z | I | Starting Installation\r\n2020-06-02T14:33:04.899Z | I | C:\\USL\\LCU\\4556803.msu Exists.\r\n2020-06-02T14:33:04.914Z | I | Starting installation process ''C:\\USL\\LCU\\4556803.msu /quiet /norestart''\r\n2020-06-02T14:43:14.169Z | I | Process completed with exit code ''3010''\r\n2020-06-02T14:43:14.200Z | I | Need to restart computer after hotfix 4556803 installation\r\n2020-06-02T14:43:14.200Z | I | Finished Installation\r\n2020-06-02T14:43:14.200Z | I | Artifact ''install-lcu'' succeeded\r\n\",\"time\":null},{\"code\":\"ComponentStatus/StdErr/succeeded\",\"level\":\"Info\",\"displayStatus\":\"Provisioning succeeded\",\"message\":\"\",\"time\":null}]","DeploymentLog":null,"StartTime":"2020-06-02T14:32:40.9882134Z","ExecutionTime":"00:11:21.2468597","BSODCount":0},"attempt":1,"instanceId":"a301aaa0c2394e76832867bfeec04b5d:0","parentInstanceId":"78d0b036a5c548ecaafc5e47dcc76ee4:2","eventName":"Artifact Result"}'
| mv-expand log = parse_json(replace("\r\n", " ", replace(#"\\", #"\\\\", tostring(parse_json(tostring(parse_json(s).artifactResult)).Log))))
| project log.code, log.level, log.displayStatus, log.message

Cannot start container in JBoss Fuse 6.0.0

I try to running old JBoss Fuse (6.0.0.redhat-024) server which installed some containers inside
JBossFuse:karaf#myapps> fabric:container-list
[id] [version] [alive] [profiles] [provision status]
myapps* 1.1 true fmc, fabric, fabric-ensemble-0000-1, jboss-fuse-full success
managed1 1.1 false default, myprofile success
managed2 1.1 false default, myprofile success
I tried to start managed1 and managed2 but they seems cannot started and also the log tells nothing.
JBossFuse:karaf#myapps> fabric:container-start managed1
JBossFuse:karaf#myapps> fabric:container-start managed2
JBossFuse:karaf#myapps> fabric:container-list
[id] [version] [alive] [profiles] [provision status]
myapps* 1.1 true fmc, fabric, fabric-ensemble-0000-1, jboss-fuse-full success
managed1 1.1 false default, myprofile success
managed2 1.1 false default, myprofile success
JBossFuse:karaf#myapps> log:tail
.........
2016-10-20 22:23:51,148 | INFO | l Console Thread | FabricServiceImpl | ? ? | 57 - org.fusesource.fabric.fabric-core - 7.2.0.redhat-024 | Starting container managed1
2016-10-20 22:23:56,221 | INFO | l Console Thread | FabricServiceImpl | ? ? | 57 - org.fusesource.fabric.fabric-core - 7.2.0.redhat-024 | Starting container managed2
After read the logs, i found an error during starting fuse:
20:17:09,542 | ERROR | guration Watcher | NIOServerCnxnFactory | 53 - org.fusesource.fabric.fabric-linkedin-zookeeper - 7.2.0.redhat-024 | Thread Thread[ActiveMQ Configuration Watcher,5,org.jboss.amq.mq-fabric-6.0.0.redhat-024] died
java.lang.NullPointerException
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ConfigThread$$anonfun$run$3.apply(ActiveMQServiceFactory.scala:400)[128:org.jboss.amq.mq-fabric:6.0.0.redhat-024]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ConfigThread$$anonfun$run$3.apply(ActiveMQServiceFactory.scala:399)[128:org.jboss.amq.mq-fabric:6.0.0.redhat-024]
at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:102)[56:scala-library:2.9.1]
at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:102)[56:scala-library:2.9.1]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)[56:scala-library:2.9.1]
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)[56:scala-library:2.9.1]
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)[56:scala-library:2.9.1]
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:43)[56:scala-library:2.9.1]
at scala.collection.mutable.HashMap$$anon$2.foreach(HashMap.scala:102)[56:scala-library:2.9.1]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ConfigThread.run(ActiveMQServiceFactory.scala:399)[128:org.jboss.amq.mq-fabric:6.0.0.redhat-024]
What is happening and how to start the containers?

Error!: SQLSTATE[42000] [1226] ‘max_user_connections’ resource (current value: 30), but max_user_connections is configured to 1000

Visitors get a Mysql error when a mysql user has exceeded the max_user_connections, returning the current value as 30, but max_connections and max_user_connections are set to 1000. When the problem occurs, the CPU reaches almost 98 %.
On mysql error logs we received a lot of access denied errors from another user, around 5000 denied connections. My problem is not why the PHP script takes all these connections, but to know why the configured variables, max_user_connections and max_connections are not applied. Those are configured to 1000, but the error message returns 30. How it is possible ?
I activated log_warnings=2, to get more information, but we don't get an extra information. Any idea why this behavior ? or How to audit mysql to find the source of this problem ?
The error message received is :
Error!: SQLSTATE[42000] [1226] User ‘some_user’ has exceeded the ‘max_user_connections’ resource (current value: 30)
select ##session.max_user_connections, ##global.max_connections;
+--------------------------------+--------------------------+
| ##session.max_user_connections | ##global.max_connections |
+--------------------------------+--------------------------+
| 1000 | 1000 |
+--------------------------------+--------------------------+`
show global variables like '%connections%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| extra_max_connections | 1 |
| max_connections | 1000 |
| max_user_connections | 1000 |
+-----------------------+-------+
show status like '%connected%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_connected | 4 |
+-------------------+-------+
select user,max_user_connections from mysql.user where host='localhost'\G
user: some_user
max_user_connections: 0
user: another_user
max_user_connections: 0`
The error seems to be :
Error: 1226 SQLSTATE: 42000 (ER_USER_LIMIT_REACHED)
Message: User '%s' has exceeded the '%s' resource (current value: %ld)
and not :
Error: 1203 SQLSTATE: 42000 (ER_TOO_MANY_USER_CONNECTIONS)
Message: User %s already has more than 'max_user_connections' active connections
We are using MariaDB, version :
select version();
+------------------------+
| version() |
+------------------------+
| 5.5.44-MariaDB-cll-lve |
+------------------------+
Solution :
You can reproduce the error with the following command :
mysqlslap -a --concurrency=500 --number-of-queries 5000 --iterations=500 --engine=innodb --debug-info -utest -p
The problem was caused by Governor, we have Cloudlinux installaed on the server, but this option was set OFF by default, but in this server was set to abusers. If the CPU is higher that 400 Gobernor set the max_user_connections for the user at 30.
You can check the logs on /var/log/dbgovernor-restrict.log
The solution si to set correctly this value or set off
dbctl --lve-mode off
/etc/container/mysql-governor.xml
<lve use="abuser"></lve>
<restrict level1="60s" level2="15m" level3="1h" level4="1d"
timeout="1h" log="/var/log/dbgovernor-restrict.log"
user_max_connections="30"></restrict>
<statistic mode="on"></statistic>
<default>
<limit name="cpu" current="400" short="380" mid="350" long="300">
</limit>

Resources