Q: adding document to collection failed in Solr cloud mode I need to add all documents in a folder to collection and it failed:
Here is my command:
hostname: mysolr
Solr Admin URL: http://mysolr.net:8983/solr/#/
Collection name: collection_indexer
Collection url: http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1

data folder: 
/tmp/solr_data

Running folder:
bash-4.1$ pwd
/opt/cloudera/parcels/CDH/jars

command: 
java -Dtype=application/json -Drecursive -Durl="http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs" -jar post.jar /tmp/solr_data

Output:

bash-4.1$ java -Dtype=application/json -Drecursive
  -Durl="http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs"
  -jar post.jar /tmp/solr_data SimplePostTool version 1.5 Posting files to base url
  http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
  using content-type application/json.. Entering recursive mode, max
  depth=999, delay=0s Indexing directory /tmp/solr_data (1 files,
  depth=0) POSTing file test.json SimplePostTool: WARNING: Solr returned
  an error #405 (Method Not Allowed) for url:
  http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
  SimplePostTool: WARNING: Response: Apache
  Tomcat/6.0.45 - Error report
  
  525D76;}--> HTTP Status 405 - HTTP method POST is not supported by this URL
noshade="noshade">type Status reportmessage
  HTTP method POST is not supported by this
  URLdescription The specified HTTP method is not
  allowed for the requested resource.Apache Tomcat/6.0.45
  SimplePostTool: WARNING: IOException while reading response:
  java.io.IOException: Server returned HTTP response code: 405 for URL:
  http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs
  1 files indexed. COMMITting Solr index changes to
  http://mysolr.net:8983/solr/#/collection_indexer_shard1_replica1/update/json/docs..
  Time spent: 0:00:00.100

I also tried: http://mysolr.net:8983/solr/#/collection_indexer/update/json/docs as the Durl and got same error message.
Note the end of error message seems to give hint that the error pertains to the url or REST, can you please clarify what is missing here?
Thank you very much.
Update 20180415 7:07am EST:
Following MatsLindh's comment below, I made change to the command and ran again with the new command
java -Dtype=application/json -Drecursive -Durl="http://dsnyr001d01i1d.nam.nsroot.net:8983/solr/collection_indexer_shard1_replica1/update" -jar post.jar /tmp/solr_data


SimplePostTool version 1.5 Posting files to base url
  http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
  using content-type application/json.. Entering recursive mode, max
  depth=999, delay=0s Indexing directory /tmp/solr_data (1 files,
  depth=0) POSTing file test.json SimplePostTool: WARNING: Solr returned
  an error #400 (Bad Request) for url:
  http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
  SimplePostTool: WARNING: Response:
  {"responseHeader":{"status":400,"QTime":0},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"Unknown
  command: region [9]","code":400}} SimplePostTool: WARNING: IOException
  while reading response: java.io.IOException: Server returned HTTP
  response code: 400 for URL:
  http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update
  1 files indexed. COMMITting Solr index changes to
  http://mysolr.net:8983/solr/collection_indexer_shard1_replica1/update..
  Time spent: 0:00:00.100

This time it is 400 error.
From Solr Admin I still do not see the new document is added.
Thank you.

A: Any part after a # in a standard HTTP URL is an anchor, and meant for consumption on the client (usually by scrolling to the element with the anchor as its id). These days it's used more for keeping state for browser applications (in particular before the history state API was introduced).
The important part is that anything behind # is never transmitted to the server - it's only used by the client to either scroll the page or used by javascript in the browser to handle state (in this case - which page you actually were looking at).
Since it's never transmitted to the server you end up making a request to  http://mysolr.net:8983/solr/ - which probably isn't the URL you want to query.
Drop the anchor and use the actual collection update URL: http://mysolr.net:8983/solr/collection_indexer/update/json/docs should work.
You should not have to use the direct core URL (i.e. with the shard/replica parameters) if you're running in cloud mode.

A: Finally sorted it out with the below steps (exceptions showing in the log /var/log/solr):
1. Manually created new schema file specifically for the data format
2. Update the instance and the schema
solrctl instancedir --update
solrctl collection --reload
3. make sure the id for each doc is unique

Thanks lots to MatsLindh for the enlightening. It is much appreciated.
