Infinispan configuration - infinispan

I am bit confused reading Infinispan guide.
I want to have two clustered caches, propably must have separate jgroups files to have different multicast addresses, but should there be only one cache containter?
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:8.0 http://www.infinispan.org/schemas/infinispan-config-8.0.xsd"
xmlns="urn:infinispan:config:8.0">
<jgroups>
<stack-file name="file1" path="jgroups1.xml" />
<stack-file name="file2" path="jgroups2.xml" />
</jgroups>
<cache-container default-cache="cache1">
<transport stack="file1" node-name="${nodeName}" />
<invalidation-cache name="cache1" configuration="invalidation-template" />
<invalidation-cache name="cache2" configuration="invalidation-template" />
<invalidation-cache-configuration name="invalidation-template" mode="SYNC" >
<locking isolation="READ_COMMITTED" striping="true"/>
<transaction locking="OPTIMISTIC"/>
<eviction max-entries="20500" strategy="LRU"/>
<expiration interval="10500" />
</invalidation-cache-configuration>
</cache-container>
</infinispan>

You don't need to have a separate jgroups file for each clustered cache. Simply configure the transport element of the cache-container, and then you can define any number of caches in that cache-container.

Different multicast addresses are only needed if you want cache containers to form different clusters. I think the confusing thing here is that you can define multiple stack-file elements in JGroups but you can only really specify a single cache-container element. The XSD is not precise enough, but the parser within the code assumes a single global configuration builder instance, hence a single cache container. So, if you want to create two separate cache containers, these should be currently defined in separate XML files.

Related

How to link Sitecore Content Editor to a custom Solr search index configured for a certain Data Template?

I have created a custom Solr search index for a specific Data Template as I expect to maintain tons of items created based on that template. As you would guess I organised my items into Sitecore Item Buckets for better performance and also I could configure my Sitecore front-end to utilise that custom Solr search index. Now I would like to optimise the search across my Item Buckets in Content Editor, but it seems that Sitecore takes the master index over any custom indexes. How can I configure Sitecore to use my custom index?
Once you have created your custom Solr index you should also have created a corresponding config file as per one of the example files provided by Sitecore. For instance, for Master DB you can use Sitecore.ContentSearch.Solr.Index.Master.config.example as a config template and simply add a patch:before="*[1]" attribute to your custom index definition as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index patch:before="*[1]" id="my_sitecore_custom_master_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
Now Sitecore will load my_sitecore_custom_master_index index configuration as first priority and utilise it while processing any search queries for your custom items instead of the default Sitecore one.

Cruise Control .NET Security

I am attempting to implement LDAP authentication, along with the required permissions.
<internalSecurity>
<cache type="inMemoryCache" duration="60" mode="sliding" />
<audit>
<xmlFileAudit location="D:\Logs\CCNet_Audit.xml"/>
</audit>
<auditReader type="xmlFileAuditReader" location="D:\Logs\CCNet_Audit.xml"/>
<users>
<ldapUser name="*username*" domain="*localdomain*"/>
</users>
<permissions>
<rolePermission name="Admin" forceBuild="Allow" sendMessage="Allow" startProject="Allow" changeProject="Allow" viewSecurity="Allow" modifySecurity="Allow" viewProject="Allow" viewConfiguration="Allow" >
<users>
<userName name="*username*"/>
</users>
</rolePermission>
</permissions>
Inside my project I have the following XML:
<project name="TestProject" description="TestProject" queue="Q7">
<security type="defaultProjectSecurity" defaultRight="Deny">
<permissions>
<rolePermission name="Admin" ref="Admin"/>
</permissions>
</security>
My log at (D:\Logs\CCNet_Audit.xml) is saying that I am "Denied"
<event><dateTime>2015-08-17T09:30:41.7973762-04:00</dateTime><user>*username*</user><type>Login</type><outcome>Deny</outcome></event>
and the project is unavailable within CC Tray.
My username is correct and I have the domain correct within the configuration (I just don't want to share it).
One thing I have noticed is that There seems to be a case issue within the username that Cruise Control is getting c-Joe.smith versus the english "normalization" of c-Joe.Smith . . . and yes I have tried it both ways.
Any help?
Try setting defaultRight="Allow" for your admin group.
<rolePermission name="Admin" defaultRight="Allow" forceBuild="Allow" sendMessage="Allow" startProject="Allow" changeProject="Allow" viewSecurity="Allow" modifySecurity="Allow" viewProject="Allow" viewConfiguration="Allow" >
<users>
<userName name="*username*"/>
</users>
</rolePermission>

Can the order in which broker's plugins execute be defined?

I need to implement 2 filters that fit in the amq:discardingDLQBrokerPlugin category, and I need one to be executed before the other.
I can implement the two filter's logic in one class, but since the business logic is very different, I would prefer two.
I add the filters using two different plugins: com.filter.FilterAPlugin and com.filter.FilterBPlugin. The filter execution order follows a "last defined first executed" logic.
Example: In this broker configuration
<amq:broker useJmx="false" persistent="false" schedulerSupport="true">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>
<amq:plugins>
<amq:discardingDLQBrokerPlugin dropAll="true" dropTemporaryTopics="true" dropTemporaryQueues="true" />
<bean xmlns="http://www.springframework.org/schema/beans" class="com.filter.FilterAPlugin" />
<bean xmlns="http://www.springframework.org/schema/beans" class="com.filter.FilterBPlugin" />
</amq:plugins>
</amq:broker>
Filter added in com.filter.FilterBPlugin is executed first.
Does the order in which the beans are declared defines the order of execution of the filters? I can't find documentation about this in the apache MQ web
BrokerService uses Chain of Responsibility pattern, so execution order is defined by the object initialization order.

Upgrading sitecore 6.6 index configuration to sitecore 7 (using ComputedFields)

Sitecore CMS+DMS 6.6.0 rev.130404 => 7.0 rev.130424
In our project we have been using AdvancedDatabaseCrawler (ADC) for our indexes (specially because of it's dynamic fields feature). Here's a sample index configuration:
<index id="GeoIndex" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<analyzer ref="search/analyzer" />
<locations hint="list:AddCrawler">
<web type="scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler, scSearchContrib.Crawler">
<database>web</database>
<root>/sitecore/content/Globals/Locations</root>
<IndexAllFields>true</IndexAllFields>
<include hint="list:IncludeTemplate">
<!--Suburb Template-->
<suburb>{FF0D64AA-DCB4-467A-A310-FF905F9393C0}</suburb>
</include>
<dynamicFields hint="raw:AddDynamicFields">
<dynamicField type="OurApp.CustomSearchFields.SearchTextField,OurApp" name="search text" storageType="NO" indexType="TOKENIZED" vectorType="NO" />
<dynamicField type="OurApp.CustomSearchFields.LongNameField,OurApp" name="display name" storageType="YES" indexType="UN_TOKENIZED" vectorType="NO" />
</dynamicFields>
</web>
</locations>
</index>
As you can see, we use scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler as the crawler and it uses the fields defined inside <dynamicFields hint="raw:AddDynamicFields"> section to inject custom fields into the index.
Now we are upgrading our project to sitecore 7. In Sitecore 7, they have ported the DynamicFields functionality from ADC into sitecore. I found out some articles on this and converted our custom search field classes to implement sitecore 7 IComputedIndexField interface instead of inheriting from BaseDynamicField class in ADC. Now my problem is how to change the index configuration to match with new sitecore 7 APIs. There were bits and pieces on the web but couldn't find all the examples I needed to convert my configuration. Can anybody help me on this?
While I'm doing this I'm under the impression that we won't have to rebuild our indexes since it still uses Lucene internally. I don't want to change the index structure. Just want to upgrade the code and configuration from AdvancedDatabaseCrawler to Sitecore 7. Should I be worried about breaking our existing indexes? Please shed some light on this as well.
Thanks
A few quick clarifications :)
We have not merged ADC into Sitecore 7, the ContentSearch layer is a complete rewrite of the old search layer for Sitecore. We have taken some of the core concepts from ADC, such as dynamic fields, and put them in the new implementation (as ComputedFields). They are not 1:1 compatible and you will have to do some work on your indexes.
The version of Lucene has also been upgraded from 2.* to 3.0.3 so all indexes will need to be re-created anyway as they are a very different version of Lucene.
There are two options here, the old Lucene search (Sitecore.Search namespace) (which ADC was built upon) has not been touched and will still work in the same way, although I am not sure about ADC compatibility with SItecore 7 as in theory this has now been superseded.
The next option is to update your index to take advantage of the new search features of Sitecore 7. The configuration you have will not be directly compatible but, while you will need to rework your index into the new configuration, the basic concepts should be familiar to you. The dynamic fields you have should map logically to ComputedFields (fields that are calculated when an item is indexed) and everything else is straightforward.
While it looks like a lot of extra config for ContentSearch a lot of it is default config that you will not need to touch, you will just need to override the configuration parts for the computed fields you want to add and the template you want to include.
An example of creating your own configuration override can be found here : http://www.mikkelhm.dk/post/2013/10/12/Defining-a-custom-index-in-Sitecore-7-and-utilizing-it.aspx
I would also recommend making sure you upgrade to 7.0 rev. 131127 (7.0 Update-3) as this fixes a bug in the IncludeTemplates logic in the version you currently have.
I managed to convert the index configuration for sitecore ContentSearch API. Looking at Sitecore default index configurations was a great help for this.
Note: As also mentioned by Stephen, <include hint="list:IncludeTemplate"> does not work in Sitecore 7.0 initial release. It's fixed in Sitecore 7.0 rev. 131127 (7.0 Update-3) and I'm planning to upgrade to it.
Here's a good article on sitecore 7 index update strategies by John West. It'll help you in configuration your indexes the way you want.
Converted configuration:
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
<DefaultIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
<IndexAllFields>true</IndexAllFields>
<include hint="list:IncludeTemplate">
<!--Suburb Template-->
<suburb>{FF0D64AA-DCB4-467A-A310-FF905F9393C0}</suburb>
</include>
<fields hint="raw:AddComputedIndexField">
<field fieldName="search text" storageType="NO" indexType="TOKENIZED" vectorType="NO">OurApp.CustomSearchFields.SearchTextField,OurApp</field>
<field fieldName="display name" storageType="YES" indexType="UN_TOKENIZED" vectorType="NO">OurApp.CustomSearchFields.LongNameField,OurApp</field>
</fields>
</DefaultIndexConfiguration>
<indexes hint="list:AddIndex">
<index id="GeoIndex" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<!-- This initializes index property store. Id has to be set to the index id -->
<param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
<strategies hint="list:AddStrategy">
<!-- NOTE: order of these is controls the execution order -->
<strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
<commitPolicy hint="raw:SetCommitPolicy">
<policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
</commitPolicy>
<commitPolicyExecutor hint="raw:SetCommitPolicyExecutor">
<policyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch" />
</commitPolicyExecutor>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.LuceneProvider.Crawlers.DefaultCrawler, Sitecore.ContentSearch.LuceneProvider">
<Database>web</Database>
<Root>/sitecore/content/Globals/Countries</Root>
</crawler>
</locations>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>

Logback: One file with maximum file size

my system support team needs one simple log-file, with a maximum size of 10MB. Older log-lines can be deleted when the file reaches 10MB. So roll out the oldest lines.
What is a good appender for this?
I have one appender, but this still created a second file, and then starts again with an empty new file. This is not what my support team wants.
Help is appreciated.
<configuration>
<appender name="TEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/test.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${LOG_HOME}/test.%i.log</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>1</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%date %-5level [%thread] - %mdc{loginName} - [%logger]- %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="FILE" />
</root>
</configuration>
Keeping everything in a single file and constantly adding the most recent while deleting the oldest lines is going to perform really really poorly. I suspect that logback can't be made to do this.
What I suggest is you use the regular size based policy, configure it to stay inside your 10MB limit overall, then just concatenate the files when you grab them.