Prohlížíte obsah nápovědy pro verzi:

Introduction

This tutorial describes how to setup MSRP for one author instance and one publish instance.

With this setup, the community content is accessible from both author and publish environments without needing to forward or reverse replicate user generated content (UGC).

This configuration is suitable for non-production environments such as for development and/or demonstration.

A production environment should :

  • run MongoDB with a replica set
  • use SolrCloud
  • contain multiple publisher instances

MongoDB

Install MongoDB

  • Download MongoDB from http://www.mongodb.org/
    • choice of OS :
      • Linux
      • Mac 10.8
      • Windows 7
    • choice of version :
      • at a minimum, use version 2.6
  • Basic configuration
    • follow the MongoDB install instructions
    • configure for mongod
      • no need to configure mongos or sharding
    • the installed MongoDB folder will be referred to as <mongo-install>
    • the defined data directory path will be referred to as <mongo-dbpath>
  • MongoDB may run on same host as AEM or run remotely

Start MongoDB

  • <mongo-install>/bin/mongod --dbpath <mongo-dbpath>

This will start a MongoDB server using default port 27017.

  • For Mac, increase ulimit with start arg 'ulimit -n 2048'

Poznámka:

If MongoDB is started after AEM, restart all AEM instances so they properly connect to MongoDB.

Demo Production Option : Setup MongoDB Replica Set

The following commands are an example of setting up a replica set with 3 nodes on localhost:

  • bin/mongod --port 27017 --dbpath data --replSet rs0&
  • bin/mongo
    • cfg = {"_id" : "rs0","version" : 1,"members" : [{"_id" : 0,"host" : "127.0.0.1:27017"}]}
    • rs.initiate(cfg)
  • bin/mongod --port 27018 --dbpath data1 --replSet rs0&
  • bin/mongod --port 27019 --dbpath data2 --replSet rs0&
  • bin/mongo
    • rs.add("127.0.0.1:27018")
    • rs.add("127.0.0.1:27019")
    • rs.status()

Solr

Install Solr

  • Download Solr from Apache Lucene
    • suitable for any OS
    • use version 4.10 or version 5
    • Solr requires Java 1.7 or greater
  • Basic configuration
    • follow 'example' Solr setup
    • no service is needed
    • the installed Solr folder will be referred to as <solr-install>

Configure Solr for AEM Communities

To configure a Solr collection for MSRP for demo, there are two decisions to be made (select the links to main documentation for details) :

  1. run Solr in standalone or SolrCloud mode
  2. install standard or advanced multilingual search (MLS)

Standalone Solr

The method for running Solr may differ depending on the version and manner of installation. The Solr reference guide is the authoritative documentation.

For simplicity, using version 4.10 as an example, start Solr in standalone mode :

  • cd to <solrinstall>/example
  • java -jar start.jar

This will start a Solr HTTP server using default port 8983. You can browse to the Solr Console to get a Solr console for testing.

Poznámka:

If Solr Console is not available, check the logs under <solrinstall>/example/logs.  Look to see if SOLR is trying to bind to a specific hostname that cannot be resolved (e.g. "user-macbook-pro").

If so, update etc/hosts file with a new entry for this hostname (e.g 127.0.0.1 user-macbook-pro) and Solr will start properly. 

SolrCloud

To run a very basic (not production) solrCloud setup, start solr with :

  • java -Dbootstrap_confdir=./solr/collection1/conf -Dbootstrap_conf=true -DzkRun -jar start.jar

Identify MongoDB as Common Store

Launch the author and publish AEM instances, if necessary.  

If AEM was running before MongoDB was started, then the AEM instances will need to be restarted.

Follow the instructions on the main documentation page : MSRP - MongoDB Common Store

Test

To test and verify the MongoDB common store, post a comment on the publish instance and view it on the author instance, as well as view the UGC in MongoDB and Solr :

  1. on the publish instance, browse to the Community Components Guide page and select the Comments component.

  2. sign in to post a comment :

  3. enter text in the comment text entry box and click Post

    chlImage_1
  4. Simply view the comment on the author instance (likely still signed in as admin / admin).

    chlImage_1

    Note : while there are JCR nodes under the asipath on author, these are for the SCF framework.  The actual UGC is not in JCR, it is in the MongoDB.

  5. view the UGC in mongodb (communities > Collections > content)

    chlImage_1
  6. view the UGC in Solr :

    • browse to Solr dashboard : http://localhost:8983/solr/
    • user 'core selector' to select 'collection1'
    • select Query
    • select Execute Query
    chlImage_1

Troubleshooting

No UGC Appears

1) Make sure MongoDB is installed and running properly.

2) Make sure MSRP has been configured to be the default provider :

  • On all author and publish AEM instances, revisit the Storage Configuration console
    or check the AEM repository :
    • in JCR, if /etc/socialconfig
      • does not contain an srpc node, it means the storage provider is JSRP
      • if the srpc node exists and contains node defaultconfiguration, the defaultconfiguration's properties should define MSRP to be the default provider

3) Make sure AEM was restarted after MSRP selected.

Tato práce podléhá licenci Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.  Na příspěvky ze služeb Twitter™ a Facebook se nevztahují podmínky licence Creative Commons.

Právní upozornění   |   Zásady ochrany osobních údajů online