cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Running 2 instances of hybris in a single VM

kaukrish
Discoverer
0 Kudos
2,260

Hi Experts,

Would like to know if anyone had tried running 2 instances of Hybris under the same VM. 2 instances should have their individual storefronts and admin nodes . Example : App1 : Admin – 9001,9002,Storefront,JMX - 9005, SOLR - 8983 etc… App2 : Admin – 9003,9004,Storefront,JMX - 9006 SOLR – 8984 etc…

Note : We are trying to achieve this with Hybris 5.6

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

sorry, I'll copy it below.

Disclaimer: this information was created with 5.7 and higher in mind so there might be differences for 5.6.

Problem
I need to run multiple instances of SAP Hybris Commerce. How can I modify port number properly so I can avoid port conflict?

Solution
Manual local.properties modification
Follow steps below

I. Edit $HYBRIS_HOME/config/local.properties
II. Configure following parameters as you want to modify. Note the configuration below is using various default port numbers.

 # App server default ports bin/platform/project.properties
 tomcat.http.port=9001
 tomcat.ssl.port=9002
 tomcat.ajp.port=8009
 tomcat.jmx.port=9003
 tomcat.jmx.server.port=9004
 
 # debug option
 tomcat.debugjavaoptions=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
 
 # VJDBC PORTS FOR REPORT
 cockpit.reports.vjdbc.port=9001
  
 # MEDIA PORTS
 media.apparel-de.http=http://apparel-de.local:9001
 media.apparel-de.https=https://apparel-de.local:9002
 media.apparel-uk.http=http://apparel-uk.local:9001
 media.apparel-uk.https=https://apparel-uk.local:9002
 media.electronics.http=http://electronics.local:9001
 media.electronics.https=https://electronics.local:9002
  
 # COMMERCEWEBSERVICES PORT
 webroot.commercewebservices.http=http://localhost:9001/rest
 webroot.commercewebservices.https=https://localhost:9002/rest
  
 # Website (Add more sites if you have others e.g. Showcase, Telco, Finance)
 website.apparel-uk.http=http://apparel-uk.local:9001/yacceleratorstorefront
 website.apparel-uk.https=https://apparel-uk.local:9002/yacceleratorstorefront
 website.apparel-de.http=http://apparel-de.local:9001/yacceleratorstorefront
 website.apparel-de.https=https://apparel-de.local:9002/yacceleratorstorefront
 website.electronics.http=http://electronics.local:9001/yacceleratorstorefront
 website.electronics.https=https://electronics.local:9002/yacceleratorstorefront
 website.powertools.http=http://powertools.local:9001/yb2bacceleratorstorefront
 website.powertools.https=https://powertools.local:9002/yb2bacceleratorstorefront
 
 # mediaconversion
 os.rmiregistry.port=2198
 
 # Standalone Solr port for 5.7 and 6.x
 solrserver.instances.default.port=8983

III. Say if you want to increment all ports by 10000, configure as follows. You can compare with one above and can find where to modify.

 # App server default ports bin/platform/project.properties
 
 tomcat.http.port=19001
 tomcat.ssl.port=19002
 tomcat.ajp.port=18009
 tomcat.jmx.port=19003
 tomcat.jmx.server.port=19004
 
 # debug option
 tomcat.debugjavaoptions=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=18000,suspend=n
 
 # VJDBC PORTS FOR REPORT
 cockpit.reports.vjdbc.port=19001
  
 # MEDIA PORTS
 media.apparel-de.http=http://apparel-de.local:19001
 media.apparel-de.https=https://apparel-de.local:19002
 media.apparel-de.http=http://apparel-uk.local:19001
 media.apparel-de.https=https://apparel-uk.local:19002
 media.electronics.http=http://electronics.local:19001
 media.electronics.https=https://electronics.local:19002
  
 # COMMERCEWEBSERVICES PORT
 webroot.commercewebservices.http=http://localhost:19001/rest
 webroot.commercewebservices.https=https://localhost:19002/rest
  
 # Website (Add more sites if you have others e.g. Showcase, Telco, Finance)
 website.apparel-uk.http=http://apparel-uk.local:19001/yacceleratorstorefront
 website.apparel-uk.https=https://apparel-uk.local:19002/yacceleratorstorefront
 website.apparel-de.http=http://apparel-de.local:19001/yacceleratorstorefront
 website.apparel-de.https=https://apparel-de.local:19002/yacceleratorstorefront
 website.electronics.http=http://electronics.local:19001/yacceleratorstorefront
 website.electronics.https=https://electronics.local:19002/yacceleratorstorefront
 website.powertools.http=http://powertools.local:19001/yb2bacceleratorstorefront
 website.powertools.https=https://powertools.local:19002/yb2bacceleratorstorefront
 
 # mediaconversion
 os.rmiregistry.port=12198
 
 # Standalone Solr port for 5.7 and 6.x
 solrserver.instances.default.port=18983

IV. Build with ant
V. Start server VI. Import ImpEx to fix SolrServerConfig. Below sample is for electronicsSolrServerConfig, apparel-ukSolrServerConfig, apparel-deSolrServerConfig and powertoolsSolrServerConfig. If you are working on other type of instance, e.g. Telco, Financial or Travel, please find Solr Server Config name and update using the impex below.

 #############################################
 # Modify parameter and set prefix of incremented
 # port number
 #############################################
 $portIncrement=1
 
 #############################################
 # Configure NAME OF YOUR SolrServerConfig #
 # Electronics #
 #############################################
 $solrServerConfig=electronicsSolrServerConfig
 
 # REMOVE EXISTING 8983 PORT CONFIG
 REMOVE SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:8983/solr;true
 
 # INSERT NEW 18982 PORT CONFIG
 INSERT SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:$portIncrement8983/solr;true
 
 
 #############################################
 # Configure NAME OF YOUR SolrServerConfig #
 # Apparel-UK #
 #############################################
 $solrServerConfig=apparel-ukSolrServerConfig
 
 # REMOVE EXISTING 8983 PORT CONFIG
 REMOVE SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:8983/solr;true
 
 # INSERT NEW 18982 PORT CONFIG
 INSERT SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:$portIncrement8983/solr;true
 
 
 #############################################
 # Configure NAME OF YOUR SolrServerConfig #
 # Apparel-DE #
 #############################################
 $solrServerConfig=apparel-deSolrServerConfig
 
 # REMOVE EXISTING 8983 PORT CONFIG
 REMOVE SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:8983/solr;true
 
 # INSERT NEW 18982 PORT CONFIG
 INSERT SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:$portIncrement8983/solr;true
 
 
 #############################################
 # Configure NAME OF YOUR SolrServerConfig #
 # Powertools #
 #############################################
 $solrServerConfig=powertoolsSolrServerConfig
 
 # REMOVE EXISTING 8983 PORT CONFIG
 REMOVE SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:8983/solr;true
 
 # INSERT NEW 18982 PORT CONFIG
 INSERT SolrEndpointUrl;solrServerConfig(name)[unique=true];url[unique=true];master[unique=true,default=false]
 ;$solrServerConfig;http://localhost:$portIncrement8983/solr;true

VII. Use port number 19001 (http) or 19002 (https) for this instance.

pradyumna608309
Discoverer
0 Kudos

Thank you.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kaushik,

Please take a look at this document: https://wiki.hybris.com/display/~/Changing+hybrisserver+port+number

Hope this helps and Best Regards,

kaukrish
Discoverer
0 Kudos

Hi Jakub,

Thanks for your reply but I get a page not found.

Regards, kaushik