forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
68 lines
6.7 KiB
HTML
68 lines
6.7 KiB
HTML
<a name="cce_bestpractice_0005"></a><a name="cce_bestpractice_0005"></a>
|
|
|
|
<h1 class="topictitle1">Analyzing the Application</h1>
|
|
<div id="body1513917418808"><p id="cce_bestpractice_0005__p8060118">Before <span class="keyword" id="cce_bestpractice_0005__keyword132451812102113">containerizing an application</span>, you need to analyze the running environment and dependencies of the application, and get familiar with the application deployment mode. For details, see <a href="#cce_bestpractice_0005__table1893834493714">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="cce_bestpractice_0005__table1893834493714"></a><a name="table1893834493714"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_bestpractice_0005__table1893834493714" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Application environment</caption><thead align="left"><tr id="cce_bestpractice_0005__row593904483713"><th align="left" class="cellrowborder" valign="top" width="11%" id="mcps1.3.2.2.4.1.1"><p id="cce_bestpractice_0005__p2074218527373">Item</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.2.2.4.1.2"><p id="cce_bestpractice_0005__p189447258171">Sub-category</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="76%" id="mcps1.3.2.2.4.1.3"><p id="cce_bestpractice_0005__p4939194410377">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="cce_bestpractice_0005__row179391644203716"><td class="cellrowborder" rowspan="3" valign="top" width="11%" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p8869141912385">Runtime environment</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.2.2.4.1.2 "><p id="cce_bestpractice_0005__p7939154419371">OS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76%" headers="mcps1.3.2.2.4.1.3 "><p id="cce_bestpractice_0005__p5939044133715">OS that the application runs on, such as CentOS or Ubuntu.</p>
|
|
<p id="cce_bestpractice_0005__p211952911413">In this example, the application runs on CentOS 7.1.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="cce_bestpractice_0005__row18939244183713"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p13939154415374">Runtime environment</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.2 "><p id="cce_bestpractice_0005__p10939174483714">The Java application requires Java Development Kit (JDK), the Go language requires GoLang, the web application requires Tomcat environment, and the corresponding version number needs to be confirmed.</p>
|
|
<p id="cce_bestpractice_0005__p14948450164115">In this example, the web application of the Tomcat type is used. This application requires the runtime environment of Tomcat 7.0, and Tomcat requires JDK 1.8.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="cce_bestpractice_0005__row1093944413377"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p109391444173713">Dependency package</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.2 "><p id="cce_bestpractice_0005__p99391844133710">Understand required dependency packages, such as OpenSSL and other system software, and their version numbers.</p>
|
|
<p id="cce_bestpractice_0005__p56992919427">In this example, no dependency package is required.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="cce_bestpractice_0005__row11939134412377"><td class="cellrowborder" rowspan="3" valign="top" width="11%" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p16309414123819">Deployment mode</p>
|
|
</td>
|
|
<td class="cellrowborder" rowspan="2" valign="top" width="13%" headers="mcps1.3.2.2.4.1.2 "><p id="cce_bestpractice_0005__p139421428234">Peripheral configurations</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76%" headers="mcps1.3.2.2.4.1.3 "><p id="cce_bestpractice_0005__p39418289320">MongoDB database: In this example, the MongoDB database and Tomcat application are deployed on the same server. Therefore, their configurations can be fixed and there is no need to extract their configurations.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="cce_bestpractice_0005__row11397617131"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p11940144183717">External services with which the application needs to interconnect, such as databases and file systems.</p>
|
|
<p id="cce_bestpractice_0005__p15834112174617">These configurations need to be manually configured each time you deploy an application on a VM. However, through containerized deployment, environment variables can be injected into a container, facilitating deployment.</p>
|
|
<p id="cce_bestpractice_0005__p17414165124510">In this example, the application needs to interconnect with the MySQL database. You need to obtain the database configuration file. The server address, database name, database login username, and database login password are injected through environment variables.</p>
|
|
<pre class="screen" id="cce_bestpractice_0005__screen1332672212474">url=jdbc:mysql://<em id="cce_bestpractice_0005__i842352697151740">Server address</em>/<em id="cce_bestpractice_0005__i842352697151746">Database name</em> #Database connection URL
|
|
username=**** #Username for logging in to the database
|
|
password=**** #Password for logging in to the database</pre>
|
|
</td>
|
|
</tr>
|
|
<tr id="cce_bestpractice_0005__row694016448378"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.1 "><p id="cce_bestpractice_0005__p994074418375">Application configurations</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.2 "><p id="cce_bestpractice_0005__p10505932155117">You need to sort out the configuration parameters, such as configurations that need to be modified frequently and those remain unchanged during the running of the application.</p>
|
|
<p id="cce_bestpractice_0005__p11626163311515">In this example, no application configurations need to be extracted.</p>
|
|
<div class="note" id="cce_bestpractice_0005__note75161827153918"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="cce_bestpractice_0005__p12307185114018">To avoid frequent image replacement, you are advised to classify configurations of the application.</p>
|
|
<ul id="cce_bestpractice_0005__ul248373719393"><li id="cce_bestpractice_0005__li638716244598">For the configurations (such as peripheral interconnection information and log levels) that are frequently changed, you are advised to configure them as environment variables.</li><li id="cce_bestpractice_0005__li207809531599">For the configurations that remain unchanged, directly write them into images.</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_bestpractice_0340.html">Procedure</a></div>
|
|
</div>
|
|
</div>
|
|
|