mysql - Configure a Wildfly 10 MSQL datasource in OpenShift v3 -




i have application working on local dev machine. uses wildfly 10, mysql 5.7 , hibernate. application looks 'appds' datasource within wildfly.

i've created wildfly 10 container , mysql container on openshift v3. typically, log wildfly , configure datasource, configuration lost when container restarts. thought matter of finding connection environment settings, , using pre-configured database connections, can't find variables should set to, , default connections don't work without them.

i downloaded , read openshift developers, side-step issue creating direct database connection, rather going through datasource.

exporting environment variables failed because 'no matches apps.openshift.io/, kind=deploymentconfig'. book out of date? not using deployment config store environment variables?

i appreciate if point me in right direction.

i have project running locally on machine uses wildfly 10, mysql 5.7 , hibernate. found documentation incomplete. after few days of working it, have figured out how deploy simple j2ee project stack.

i updating question step-by-step wish i'd had. hope saves time in future.

  1. create new openshift user
  2. create project dbtest
  3. add mysql dbtest project: following service(s) have been created in project: mysql:

    username: test password: test database name: testdb connection url: mysql://mysql:3306/

  4. add wildfly project:

oc login https://api.starter-us-west-1.openshift.com oc project dbtest oc status

  1. scale current wildfly pod 0. (you won't have enough cpu run 3 pods, , redeploy tries start new 1 , hot swap them)
  2. from left menu: applications->deployments->(dbtest)wildfly10 pod->environment(tab)-> add: mysql_database=testdb mysql_db_enabled=true mysql_user:test mysql_password: test
  3. push wildfly pod 1.
  4. use terminal in wildfly run ./add-user.sh
  5. oc port-forward wildfly10-6-rkr58 :9990 (replace wildfly10-6-rkr58 pod name, found clicking on running pod [circle 1 in it] , noting pod name in upper left corner])
  6. login wildfly 127.0.0.1: , test mysqlds. should connect.




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -