janhoy commented on PR #2712:
URL: https://github.com/apache/solr/pull/2712#issuecomment-2422212816
Did another pass at cleaning up some convoluted code, and remove some
duplicate printout. Here I have copied the command response from some local
tests. Will probably commit soon if you think it looks good:
```
bin/solr status -h
usage: bin/solr status [-h] [-p <PORT>] [-s <HOST>] [--short] [--verbose]
List of options:
-h,--help Print this message.
-p,--port <PORT> Port on localhost to check status for
-s,--solr-url <HOST> Base Solr URL, which can be used to determine the
zk-host if that's not known; defaults to:
http://localhost:8983.
--short Short format. Prints one URL per line for running
instances
--verbose Enable verbose command output.
Please see the Reference Guide for more tools documentation:
https://solr.apache.org/guide/solr/latest/deployment-guide/solr-control-script-reference.html
```
```
bin/solr status --short
http://localhost:9999/solr
http://localhost:8888/solr
```
```
bin/solr status
Looking for running processes...
Found 2 Solr nodes:
Solr process 16318 running on port 9999
{
"solr_home":"/Users/janhoy/git/solr/solr/packaging/build/dev/server/solr",
"version":"10.0.0-SNAPSHOT 58f7d877726a0274665c13ea5c89bf57f14c0f2b
[snapshot build, details omitted]",
"startTime":"Fri Oct 18 12:38:37 CEST 2024",
"uptime":"0 days, 0 hours, 20 minutes, 27 seconds",
"memory":"209.9 MB (%41) of 512 MB",
"cloud":{
"ZooKeeper":"127.0.0.1:10999",
"liveNodes":"1",
"collections":"0"}}
Solr process 16472 running on port 8888
{
"solr_home":"/Users/janhoy/git/solr/solr/packaging/build/dev/server/solr",
"version":"10.0.0-SNAPSHOT 58f7d877726a0274665c13ea5c89bf57f14c0f2b
[snapshot build, details omitted]",
"startTime":"Fri Oct 18 12:38:45 CEST 2024",
"uptime":"0 days, 0 hours, 20 minutes, 20 seconds",
"memory":"82.7 MB (%16.1) of 512 MB",
"cloud":{
"ZooKeeper":"127.0.0.1:9888",
"liveNodes":"1",
"collections":"0"}}
```
```
bin/solr status -p 8888
Solr process 16472 running on port 8888
{
"solr_home":"/Users/janhoy/git/solr/solr/packaging/build/dev/server/solr",
"version":"10.0.0-SNAPSHOT 58f7d877726a0274665c13ea5c89bf57f14c0f2b
[snapshot build, details omitted]",
"startTime":"Fri Oct 18 12:38:45 CEST 2024",
"uptime":"0 days, 0 hours, 20 minutes, 37 seconds",
"memory":"83.2 MB (%16.2) of 512 MB",
"cloud":{
"ZooKeeper":"127.0.0.1:9888",
"liveNodes":"1",
"collections":"0"}}
```
```
bin/solr status -p 1111
Could not find a running Solr on port 1111
```
```
bin/solr status --solr-url http://localhost:8888/solr
{
"solr_home":"/Users/janhoy/git/solr/solr/packaging/build/dev/server/solr",
"version":"10.0.0-SNAPSHOT 58f7d877726a0274665c13ea5c89bf57f14c0f2b
[snapshot build, details omitted]",
"startTime":"Fri Oct 18 12:38:45 CEST 2024",
"uptime":"0 days, 0 hours, 21 minutes, 6 seconds",
"memory":"84.2 MB (%16.4) of 512 MB",
"cloud":{
"ZooKeeper":"127.0.0.1:9888",
"liveNodes":"1",
"collections":"0"}}
```
```
bin/solr status --solr-url http://localhost:1111/solr
Solr at http://localhost:1111/solr not online.
```
```
bin/solr status --solr-url http://localhost:8888/solr --max-wait-secs 1
Waiting up to 1 seconds to see Solr running on port 8888
Started Solr server on port 8888. Happy searching!
```
```
bin/solr status --solr-url http://localhost:1111/solr --max-wait-secs 1
Waiting up to 1 seconds to see Solr running on port 1111
Solr at http://localhost:1111/solr did not come online within 1 seconds!
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]