cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid storing files on default contentstore when using an alternate contentstore

fmstasi
Champ in-the-making
Champ in-the-making
I am using Alfresco Enterprise 4.2.2, and I have an issue with Content Store Selector. I asked the question to support, and they told me they have no issue with crossposting to the forums, so I am doing it now; to my advantage I may get faster response time, and to public advantage we may get a new issue documented on the Web.

My question is the following. I have to create an Alfresco share site for video files in our production environment, and it needs to use a dedicated storage.

On the test system, I configured a double content store following the instructions at http://docs.alfresco.com/4.2/concepts/store-manage-content.html; then, when I create a document in a site using the second content store, the content is MOVED there, but an orphaned copy remains on the primary store. This is problem in my configuration, since the primary contentstore is currently using 120 GB out of a 150 GB available, and the one dedicated to videos would be 300 GB. Video files can range up to 8 GB or more, so there is a risk that a few of them would fill up the primary content store, and I cannot rely on contentStoreCleaner to purge the orphaned content even in the same night after it is created.

My only idea so far is to invert the stores, making the video store the primary one, but this is far from ideal: on current the primary store file creations, modifications and deletions are very frequent, so that there would be an unnecessary duplication of disk usage.

Does anybody know a way of creating content directly on an alternate content store?
5 REPLIES 5

deepak1987
Star Contributor
Star Contributor
Hi,

To change the default store to your alternate store say storeA.


Change the defaultStoreName property value to StoreA in content-store-selector-context.xml as follows and Restart the server. Now, StoreA has become default store to all contents.


<bean id="storeSelectorContentStore" parent="storeSelectorContentStoreBase">
       <property name="defaultStoreName">
            <value>storeA</value>
       </property>
       <property name="storesByName">
           <map>
               <entry key="default">
                   <ref bean="fileContentStore" />
               </entry>
               <entry key="storeA">
                   <ref bean="firstSharedFileContentStore" />
               </entry>
               <entry key="storeB">
                   <ref bean="secondSharedFileContentStore" />
               </entry>
          </map>
       </property>
   </bean>



Hope this helps.

Cheers..

deepak1987
Star Contributor
Star Contributor
Hi,

To change the default store to your alternate store say storeA.


Change the defaultStoreName property value to StoreA in content-store-selector-context.xml as follows and Restart the server. Now, StoreA has become default store to all contents.


<bean id="storeSelectorContentStore" parent="storeSelectorContentStoreBase">
       <property name="defaultStoreName">
            <value>storeA</value>
       </property>
       <property name="storesByName">
           <map>
               <entry key="default">
                   <ref bean="fileContentStore" />
               </entry>
               <entry key="storeA">
                   <ref bean="firstSharedFileContentStore" />
               </entry>
               <entry key="storeB">
                   <ref bean="secondSharedFileContentStore" />
               </entry>
          </map>
       </property>
   </bean>



Hope this helps.

Cheers..

fmstasi
Champ in-the-making
Champ in-the-making
Thank you Deepak, but I knew that. As I said, inverting the store is the only solution i have so far, but I'd rather not use it, since it would involve a lot of unnecessary I/O; of course, if I have no other solution, I will be forced to use such a configuration.

fmstasi
Champ in-the-making
Champ in-the-making
Ok, we found it.

The problem is that a rule adds the storeSelector aspect and the storeName attribute after the content has been added; it is then correctly moved, but an orphaned content remains on the original store.

The solution is to add a behaviour which adds the aspect and the attribute on node creation; since the content is added after the node has been created, it is then directly written to the correct store.

I hope somebody else will benefit from our experience 🙂

Many thanks to David Ciamberlano, also present on the forum, who worked with me on this issue and after some brainstorming had the idea which solved the problem.

paul_price
Champ in-the-making
Champ in-the-making
I am running out of space on my original store, so I'm trying to add a new default for my new docs. I followed the examples to add a new file share from http://docs.alfresco.com/4.2/concepts/store-manage-content.html. but when I add a new document via Share or Explore the physical location of the .bin file is still on my original file share. Nothing is being added to the new location. Note that I tried with version 4.2.4 and 4.1.8 with the same results.

In the example, <property name="defaultStoreName">  <value>store2</value> is being used. Should the value be quoted? I tried it both ways and neither work, so I'm just guessing at this point.