You can always add the appropriate env variables to your "myadmin"
deployment config using the "oc env" command, and then redeploy it.


On Thu, Feb 11, 2016 at 2:52 PM, Andres <[email protected]> wrote:

> Hello,
>
> In this template you can create at the same time a MySQL server and a
> Tomcat7. The Tomcat7 DataSource is configured with the environment
> variables at the creation time.
>
> But my case is that i have already deployed and configured the MySQL
> server with:
>
> oc new-app --name mydb mysql-persistent -p DATABASE_SERVICE_NAME=xxx -p
> MYSQL_USER=xxx -p MYSQL_PASSWORD=xxx -p MYSQL_DATABASE=xxx
>
> And i want to deploy some separate build just with a Tomcat7, for exaple
> with:
>
> oc new-app --name myadmin jboss-webserver30-tomcat7-openshift~http://
> <...>/MYADMIN.git
>
> Or other posible situation could be to need several datasources defined in
> context.xml pointing to diferent DDBB.
>
> Thanks,
>
> Andrés.
>
>
> El 09/02/2016 a las 18:59, Ben Parees escribió:
>
> This template illustrates it:
>
> https://github.com/jboss-openshift/application-templates/blob/master/webserver/jws30-tomcat7-mysql-persistent-s2i.json
>
> Specifically this section defines the env variables that will be used to
> define the datasource:
>
> https://github.com/jboss-openshift/application-templates/blob/master/webserver/jws30-tomcat7-mysql-persistent-s2i.json#L454-L485
>
> That should result in a datasource named ${APPLICATION_NAME}-mysql being
> constructed using the various DB_XXX env variable content, where "DB" comes
> from the "=DB" portion of the DB_SERVICE_PREFIX_MAPPING.
>
> Kevin, is this behavior documented somewhere?  I didn't see it in the
> openshift image docs.
>
>
>
> On Tue, Feb 9, 2016 at 10:55 AM, <[email protected]>[email protected]
> <[email protected]> wrote:
>
>> Hi,
>>
>> In Openshift2, you could reference a MySQL DB from a Tomcat cartridge
>> just defining some environment variables, that were replaced automatically
>> in the JNDI definition at the context.xml.
>>
>> <Resource name="jdbc/piadmin"
>> url="jdbc:mysql://*${OPENSHIFT_MYSQL_DB_HOST}*:
>> *${OPENSHIFT_MYSQL_DB_PORT}*/*${OPENSHIFT_APP_NAME}*"
>> driverClassName="com.mysql.jdbc.Driver"
>> username="*${OPENSHIFT_MYSQL_DB_USERNAME}*"
>> password="*${OPENSHIFT_MYSQL_DB_PASSWORD}*"
>> auth="Container"
>> type="javax.sql.DataSource"
>> maxActive="20"
>> maxIdle="5"
>> maxWait="10000"
>> />
>>
>> In OpenShift3, this doesnt work. The tokens in context.xml are not
>> replaced by their corresponding environment variable values. What is then
>> the correct way to connect a JNDI datasource in a Tomcat S2I like
>> jboss-webserver30-tomcat7-openshift?
>>
>> Thanks,
>>
>> Andrés.
>>
>>
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>
>>
>
>
> --
> Ben Parees | OpenShift
>
>
>
> Este correo electrónico se ha enviado desde un equipo libre de virus y
> protegido por Avast.
> www.avast.com <https://www.avast.com/sig-email>
>



-- 
Ben Parees | OpenShift
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to