| title: | Manage an Application on Deis |
|---|---|
| description: | First steps for developers using Deis to deploy and scale applications. |
| keywords: | tutorial, guide, walkthrough, howto, deis, developer, dev |
Deis includes many tools that help you configure, scale, adminster and troubleshoot your deployed :ref:`Application`.
Use deis config to set a DATABASE_URL that attaches
the application to an external PostgreSQL database.
$ deis config:set DATABASE_URL=postgres://user:pass@example.com:5432/db
=== peachy-waxworks
JAVA_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops
PATH: /app/.jdk/bin:/usr/local/bin:/usr/bin:/bin
MAVEN_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops
DATABASE_URL: postgres://user:pass@example.com:5432/dbApplications deployed on Deis store config in environment variables. Backing services like databases, caches and queues are decoupled from the application and attached with environment variables.
Use deis scale to control the number of :ref:`Containers <container>`
that power your app.
$ deis scale web=8
Scaling containers... but first, coffee!
done in 20s
=== peachy-waxworks Containers
--- web: `java -cp target/classes:target/dependency/* HelloWorld`
web.1 up 2013-12-03T00:00:25.836Z (dev-runtime-1)
web.2 up 2013-12-03T00:30:10.934Z (dev-runtime-1)
web.3 up 2013-12-03T00:30:10.950Z (dev-runtime-1)
web.4 up 2013-12-03T00:30:10.963Z (dev-runtime-1)
web.5 up 2013-12-03T00:30:10.978Z (dev-runtime-1)
web.6 up 2013-12-03T00:30:10.993Z (dev-runtime-1)
web.7 up 2013-12-03T00:30:11.010Z (dev-runtime-1)
web.8 up 2013-12-03T00:30:11.027Z (dev-runtime-1)Applications deployed on Deis scale out via the process model.
Web requests are automatically routed to the web processes
defined by your application.
You must define process types like web or worker in a
Procfile in the root of your application repository.
Use deis run to execute commands against the deployed version of your application.
$ deis run ls -l
total 28
-rw-r--r-- 1 root root 553 Dec 2 23:59 LICENSE
-rw-r--r-- 1 root root 60 Dec 2 23:59 Procfile
-rw-r--r-- 1 root root 33 Dec 2 23:59 README.md
-rw-r--r-- 1 root root 1622 Dec 2 23:59 pom.xml
drwxr-xr-x 3 root root 4096 Dec 2 23:59 src
-rw-r--r-- 1 root root 25 Dec 2 23:59 system.properties
drwxr-xr-x 6 root root 4096 Dec 3 00:00 targetApplications deployed on Deis use one-off processes for admin tasks like database migrations and other tasks that must run against the live application.
Use deis logs to view the log output from your deployed application.
$ deis logs | tail
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.5]: INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.8]: INFO:oejs.Server:jetty-7.6.0.v20120127
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.5]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10005
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.6]: INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.7]: INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.6]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10006
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.8]: INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.7]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10007
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.8]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10008Applications deployed on Deis treat logs as event streams.
Deis aggregates stdout and stderr from every :ref:`Container`
making it easy to troubleshoot problems with your application.