This tutorial shows you how to increase the allowed file size of configuration files in ZooKeeper for SolrCloud collections.
Apache ZooKeeper, Apache Solr
The maximum allowed size of a file stored in ZooKeeper is 0xfffff which is just under 1 MB. In general this does make sense as ZooKeeper is not designed to hold data that is large as this data needs to be shared between the ZooKeeper instances and the clients that connect to ZooKeeper. When working with Solr it is unusual to have files that exceed this limit. But stemming dictionaries or synonym files can do so if they contain a lot of information.
There is an unsafe option that can be used to increase the maximum size of data stored in ZooKeeper. The option that needs to be set is jute.maxbuffer. You can either set a hexadecimal number or an integer value. The value set is the size in bytes. So if you want to store files in ZooKeeper that are 10 MB of size you need to set a value higher than 10485760. In ZooKeeper you need to create a file called java.env in your configuration directory with the following content:
If you only set this value in ZooKeeper you will run into issues as soon as one of your clients (e.g. Solr) wants to do something with that file. Thus, you need to set jute.maxbuffer for your client as well. When using a recent Solr version you can specify Java options by setting them at client startup:
bin/solr start -c -z localhost:2181 -a "-Djute.maxbuffer=10500000"
Of course, this needs to be set in each (ZooKeeper) server and each (Solr) client.
Side note: If you are running on a windows system you need to set the Java option differently for ZooKeeper. In this case you need to adjust the script zkServer.cmd by adding the option in the start command, e.g.
java "-Djute.maxbuffer=10500000" "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %*