neo4j REST API sysinfo - neo4j

Is there REST API for getting aggregated sysinfo about neo4j cluster?
Like querying ":sysinfo" in cypher.
I tried http://neo4j_db_host:7474/db/manage but there isn't enough information.

You can do this with the following query:
curl -u neo4j -v http://neohost:7474/db/manage/server/jmx/domain/org.neo4j > sysinfo.json

Related

Trying to connect to Neo4j Desktop using py2neo and receiving ``ServiceUnavailable: Cannot connect to any known routers`" when I run a query

I renamed the existing example database from Movies RDBM to Movies and changed the password to pwd.
from py2neo import Graph
db=Graph("neo4j://neo4j:pwd#localhost:7687", name="Movies" )
No errors for the above
db.run("MATCH (n:Movie) RETURN n").to_table()
The above fails with
ServiceUnavailable: Cannot connect to any known routers
what am I doing wrong ?
I was using WSL and Jupyter Notebooks but Neo4j was running in Windows so 127.0.0.1 was pointing to the WSL loopback and there was nothing there to receive the API calls

gerrit query REST API vs. gerrit query API

I found we can use gerrit query api to query as below:
ssh -p 29418 gerrit.review.com gerrit query --format JSON --current-patch-set status:open MY-JIRA
But I found another python module pygerrit2 as well, I guess this module is using REST API, which one is more better for user? How can I translate above command to REST API if possible!
I try below but doesn't work:
mylst = rest.get("/changes/?q=status:open%20current-patch-set%20{}".format(jira))

NEO4J | Causal Cluster - How to change user password (across all instances)

Problem: Change the user password of account neo4j
Attempted Flow:
curl -H 'Content-Type: application/json' -X POST \
-d '{"password": "newPwd"}' \
-u neo4j:"oldPwd" \
http://IP-ADDR:7474/user/neo4j/password
Observation:
Only one instance has reflecting with the changed user password.
Expected:
All instances of the Causal Cluster should be applied with the password changes.
Version: Neo4j 3.5.1
Database type: Causal Cluster (3 instances)
Update: NEO4J Team Replied in their chat
Neo4j 4.x no longer has this limitation and users/roles are auto
propagated amongst members
Ref:
https://community.neo4j.com/t/causal-cluster-how-to-change-user-password-across-all-instances/31449
In 3.5 after changing the password in one member, you need to copy the neo4j_directory/data/dbms/auth file manually to all other cluster members , there is no need to shutdown the members, the file will be re-read autimatically in few minutes after you copy. ( The issue is fixed in neo4j 4.X )

How to log all queries made to elasticsearch container?

I'm trying to debug my app. When I hit the production elasticsearch host through my python app, the results are returned. When I change it to localhost, it works when I hit it manually through the browser, but not through the app.
I'd like to log all queries that are hitting my elasticsearch container, I've tried env variables such as "DEBUG=TRUE" or "DEBUG=*", and no requests are being logged (even when hitting it manually and results are returned).
Any idea how I'd do this?
Thanks
You can use the slow queries log with a really reduced treshold. See https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html for more details on this feature. For example:
index.search.slowlog.threshold.query.debug: 0s
Using cluster or index settings api you're able to change this settings while running the cluster.
curl -XPUT "http://localhost:9200/_all/_settings" -H "content-type: application/json" -d'
{
"index.search.slowlog.threshold.query.debug": "0s"
}'
There are even more settings you can use to log and monitor index, fetch or search duration.

Neo4J - Run dbinfo command from REST API

I want to run the
dbinfo -g "High Availability"
command over the Neo4J API. Does such an endpoint exist?
The neo4j doesn't provide endpoint for dbinfo -g.
for High Availability (HA), Its provides three REST endpoint
/db/manage/server/ha/master
/db/manage/server/ha/slave
/db/manage/server/ha/available
To check more on this read their official docs on HA.

Resources