GithubHelp home page GithubHelp logo

many-portal-containers's Introduction

many-portal-containers

Util to create and deploy many portal containers into your GateIn/JPP

EXAMPLE STEPS FOR CREATE AND DEPLOY 10 SAMPLE CONTAINERS ON SEPARATE DATABASES

  1. Build with "mvn clean install" (You will need maven 3.0.4 or newer)

  2. Configure your GateIn to run with MySQL. It means:

2.a) add GATEIN_HOME/modules/com/mysql module with MySQL JDBC driver

2.b) add something like this into appropriate section of GATEIN_HOME/standalone/configuration/standalone.xml:

                <driver name="mysql" module="com.mysql">
                    <xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
                </driver>

2.c) Configure datasources into standalone.xml like this (Assumption is that your MySQL username and password is "portal/portal" and that you use DB named "portal1" for your main portal):

            <datasource jndi-name="java:/jdbcidm_portal" pool-name="IDMPortalDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:mysql://localhost/portal1</connection-url>
                <driver>mysql</driver>
                <security>
                    <user-name>portal</user-name>
                    <password>portal</password>
                </security>

            <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
     	    <pool>
                  <min-pool-size>10</min-pool-size>
    	          <max-pool-size>100</max-pool-size>
    	          <prefill>true</prefill>
    	    </pool>
            <statement>
                  <prepared-statement-cache-size>100</prepared-statement-cache-size>
    	          <share-prepared-statements>true</share-prepared-statements>
    	    </statement>
        </datasource>
            <datasource jndi-name="java:/jdbcjcr_portal" pool-name="JCRPortalDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:mysql://localhost/portal1</connection-url>
                <driver>mysql</driver>
                <security>
                    <user-name>portal</user-name>
                    <password>portal</password>
                </security>

            <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    	    <pool>
            	  <min-pool-size>10</min-pool-size>
                  <max-pool-size>100</max-pool-size>
    	    	  <prefill>true</prefill>
            </pool>
     	    <statement>
                  <prepared-statement-cache-size>100</prepared-statement-cache-size>
    	          <share-prepared-statements>true</share-prepared-statements>
    	   </statement>
            </datasource>
  1. Run script "scripts/mysql-refresh.sh 10". Then login into MySQL and copy output of the script into MySQL console. That will drop and create all databases needed for sample portals

  2. Run script "scripts/create-ears.sh 1 10". This will create 10 EARS with sampleportal in current directory.

  3. Run command "mv sampleportal*.ear $GATEIN_HOME/gatein/extensions/" . $GATEIN_HOME should point to your GateIn directory.

  4. Run script "scripts/create-xml-from-template.sh datasources-xml 10" Then copy the content of the file datasources-xml-10 into appropriate section of GATEIN_HOME/standalone/configuration/standalone.xml . Then you can delete datasources-xml-10 file.

  5. Run script "scripts/create-xml-from-template.sh security-domains-xml 10" Then copy the content of the file security-domains-xml-10 into appropriate section of GATEIN_HOME/standalone/configuration/standalone.xml . Then you can delete security-domains-xml-10 file.

  6. Delete GATEIN_HOME/standalone/data GATEIN_HOME/standalone/tmp GATEIN_HOME/standalone/log . It may be also good to setup root password in GATEIN_HOME/standalone/configuration/gatein/configuration.properties, otherwise the setup.jsp will be shown to you for each container (In our case with 11 portal containers, you will need to setup root password in UI 11 times). To setup root password "gtn" you just need to add this into configuration.properties: gatein.portal.setup.initialpassword.root=6MSyXIj3kkQ= NOTE: (Just for quick testing. In production, you should use different root password then "gtn")

  7. Then run GATEIN and enjoy containers under: http://localhost:8080/portal http://localhost:8080/sampleportal1 http://localhost:8080/sampleportal2 ... http://localhost:8080/sampleportal10

Note: We have one portal container and 10 sampleportal containers. So 11 portal containers totally.

EXAMPLE STEPS FOR CREATE AND DEPLOY 10 SAMPLE CONTAINERS ON SINGLE DATABASES

  1. Look at document https://github.com/mposolda/many-portal-containers/blob/master/SHARED-DS-SETUP.md and setup your portal according to this PS:
  • Make sure that you have sample portals like "sampleportal" without special characters in name.
  • Make sure that you are not using Oracle due to DB Tables/Indexes name restriction to 30 characters. It's recommended to check what's the max length for tables and indexes for your DB. Usually the limitation of 30 characters for table name is ok, but limitation of 30 characters for index length is not ok because with added _sampleportal suffix, the name exceeds the limit. You can try to limit length of the name of your portal container to workaround.

NOTE: See https://jira.exoplatform.org/browse/JCR-2252 for more details

  1. Follow the steps from previous part about "separate databases" setup. Only exception is that you can avoid step 6 (you need just 2 datasources in standalone.xml without need to define all others) and step 3 is also much simpler as you just need to create one database, which you configured for datasources.

many-portal-containers's People

Contributors

mposolda avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.