问题
I am using amazon s3 to host my website (so far - very impressed), however, I want to host my hibernate search index files and subdirectories in a manner that will scale.
Could I use the Amazon s3 buckets for this? I already host user uploaded images here?
I have tried simply pointing the hibernate.search.default.indexBase at the appropriate url but it throws a write exception.
Any help appreciated!
回答1:
The indexBase configuration property expects an absolute filesystem path.
S3 "scales" because it replicates, but scaling doesn't mean it's going to be fast. The local fileystem of the server will be several orders of magnitude faster, as it can be memory-mapped rather than needing a webservice invocation for each IO operation.
If you need horizontal scalability on multiple nodes on Amason EC2, you can still use S3 as a storage point when configuring an Infinispan based index: http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#infinispan-directories
(Infinispan will cache the index in local memory, but write through one of it's CacheLoader options, one of which is S3)
来源:https://stackoverflow.com/questions/9946466/what-is-the-best-method-to-access-hiberante-search-lucene-files-on-amazon-s3