This post aims to provide systematic
instructions to set up publishing target. It comprises of a target database
(where the content will be published) and publishing target definition item in
master database that points to that target database.
Post
creation of publishing target need to take care of Solr configuration. This
post cove master slave Solr configuration and onPublishEndAsync strategy. We
are using 1 Solr Master instance and 6 Slave instance (2-EU, 2-Ap, 2- NA).
a.
OS – Window 7/ Windows Server 2008 R2 Enterprise
b. CMS
– Sitecore 8.0 (Update 1)
c. Solr
( Master and Slave )
d.
SQL Server
Create target database
(where the content will be published) and do entry
in /App_Config/Include/ConnectionString.config file.
<add name="web_us"
connectionString="Trusted_Connection=Yes;Data
Source=T-SC_SQL\SITECORE;Database=PublishSCDBUSSitecore_Web" />
Open /App_Config/Include/Sitecore.config
file and search for <databases> node.
Copy and paste existing
<database> node “web” and change the database id with the
connection string name (web_us).
<!-- web _us-->
<database id="web_us"
singleInstance="true" type="Sitecore.Data.Database,
Sitecore.Kernel">
<param desc="name">$(id)</param>
<icon>Images/database_web.png</icon>
<securityEnabled>true</securityEnabled>
<dataProviders hint="list:AddDataProvider">
<dataProvider ref="dataProviders/main"
param1="$(id)">
<disableGroup>publishing</disableGroup>
<prefetch hint="raw:AddPrefetch">
<sc.include file="/App_Config/Prefetch/Common.config"/>
<sc.include file="/App_Config/Prefetch/Webdb.config"/>
</prefetch>
</dataProvider>
</dataProviders>
<proxiesEnabled>false</proxiesEnabled>
<proxyDataProvider ref="proxyDataProviders/main"
param1="$(id)"/>
<archives hint="raw:AddArchive">
<archive name="archive"/>
<archive name="recyclebin"/>
</archives>
<Engines.HistoryEngine.Storage>
<obj type="Sitecore.Data.$(database).$(database)HistoryStorage,
Sitecore.Kernel">
<param connectionStringName="$(id)" />
<EntryLifeTime>30.00:00:00</EntryLifeTime>
</obj>
</Engines.HistoryEngine.Storage>
<Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>
<cacheSizes hint="setting">
<data>500MB</data>
<items>300MB</items>
<paths>500KB</paths>
<itempaths>10MB</itempaths>
<standardValues>5MB</standardValues>
</cacheSizes>
</database>
Follow below steps to
add publishing target in Sitecore master DB.
A) Navigate to /sitecore/system/Publishing targets.
Right click and add insert new publishing target.
B) Give any significant name to publishing target
definition item. Enter database id (web_us) in the Target database
Field.
C) Open Sitecore publishing dialog and you can see
newly created publishing target.
3.1 Create publishing strategy : we need to
push the content from newly created DB to respective solr core.
·
Open file App_Config/Include/Sitecore.ContentSearch.DefaultConfigurations.config
·
Copy already existing
respective strategy and paste it.
·
Change the name of
strategy and provide the correct DB name as specified in connection string.
<onPublishEndAsyncWebUS type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy,
Sitecore.ContentSearch">
<param desc="database">web_us</param>
<!-- Whether or not a full index rebuild should be triggered when the number
of items in the EventQueue exceeds the number specified
in ContentSearch.FullRebuildItemCountThreshold. -->
<CheckForThreshold>true</CheckForThreshold>
</onPublishEndAsyncWebUS>
3.2 Create another solr index related to current
target database and set the newly created strategy.
·
Create new file inside path:
App_Config/Include and copy the data from another solr web index.
New File Name : Sitecore.ContentSearch.Solr.Index.NA.Web.config
·
Enter the meaningful
index name ex : na_web_us_index
·
Enter newly created
strategy Ex: onPublishEndAsyncWebUS
·
Enter newly created
database for each crawler. Ex : Web_US
<indexes
hint="list:AddIndex">
<index id="na_web_us_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/ onPublishEndAsyncWebUS" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler,
Sitecore.ContentSearch">
<Database>web_us</Database>
<Root>/sitecore/content/NA</Root>
</crawler>
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler,
Sitecore.ContentSearch">
<Database> web_us</Database>
<Root>/sitecore/content/Shared Data</Root>
</crawler>
<crawler
type="Sitecore.ContentSearch.SitecoreItemCrawler,
Sitecore.ContentSearch">
<Database>web_us</Database>
<Root>/sitecore/media library/NA</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
3.3 Create another solr core inside CMS solr setup (Master)
with current target database.
Note: Master solr URL is : http://10.1.16.13:8983/solr
EX: Core Name - na_web_us_index
3.4 Create another solr core inside CD solr setup (Slave)
with current target database.
Note: Create core for each slave with current database ID and modify
master Url in solrconfig.xml file accordingly.
EX: Core Name - na_web_us_index
<requestHandler
name="/replication" class="solr.ReplicationHandler" >
<lst name="slave">
<!--fully qualified url for the replication handler of master. It is
possible
to pass on this as
a request param for the fetchindex command-->
<str name="masterUrl">http://10.1.16.13:8983/solr/na_web_us_index/replication</str>
<!--Interval in which the slave should poll master .Format is HH:mm:ss . If
this is absent slave does not
poll automatically.
But a fetchindex can be triggered from the admin or the http API -->
<str name="pollInterval">00:00:20</str>
</lst>
</requestHandler>
Happy configuration :)
Feel free if you face any issue with same.
Very nice! Helpful article..
ReplyDeleteThanks Mohan.
DeleteVery good and detailed article.
ReplyDeleteThanks Varun.
DeleteVery helpful
ReplyDeleteThanks Amol.
Delete