25.2.2.2.2. 非クラスター化 JBoss EAP 6 インスタンスでのアプリケーションのデプロイ
概要
このトピックでは、Red Hat AMI 上の非クラスター JBoss EAP 6 インスタンスへのアプリケーションのデプロイについて説明します。
サンプルアプリケーションのデプロイ
次の行をUser Dataフィールドに追加します。# Deploy the sample application from the local filesystem deploy --force /usr/share/java/jboss-ec2-eap-samples/hello.war例25.2 サンプルアプリケーションの User Data フィールドの例
この例では、Red Hat AMI で提供されたサンプルアプリケーションを使用します。また、非クラスター JBoss EAP 6 インスタンスの基本的な設定も含まれます。ユーザーadminのパスワードがadminpwdに設定されています。JBOSSAS_ADMIN_PASSWORD=adminpwd JBOSS_IP=0.0.0.0 #listen on all IPs and interfaces # In production, access to these ports needs to be restricted for security reasons PORTS_ALLOWED="9990 9443" cat> $USER_SCRIPT << "EOF" # Create a file of CLI commands to be executed after starting the server cat> $USER_CLI_COMMANDS << "EOC" # Deploy the sample application from the local filesystem deploy --force /usr/share/java/jboss-ec2-eap-samples/hello.war EOC EOFカスタムアプリケーションのデプロイ
次の行をUser Dataフィールドに追加し、アプリケーション名と URL を設定します。# Get the application to be deployed from an Internet URL mkdir -p /usr/share/java/jboss-ec2-eap-applications wget https://<your secure storage hostname>/<path>/<app name>.war -O /usr/share/java/jboss-ec2-eap-applications/<app name>.war例25.3 カスタムアプリケーションの User Data フィールドの例
この例では、MyAppと呼ばれるアプリケーションが使用され、非クラスター JBoss EAP 6 インスタンスの基本的な設定が含まれます。ユーザーadminのパスワードがadminpwdに設定されます。JBOSSAS_ADMIN_PASSWORD=adminpwd JBOSS_IP=0.0.0.0 #listen on all IPs and interfaces # In production, access to these ports needs to be restricted for security reasons PORTS_ALLOWED="9990 9443" cat> $USER_SCRIPT << "EOF" # Get the application to be deployed from an Internet URL mkdir -p /usr/share/java/jboss-ec2-eap-applications wget https://PATH_TO_MYAPP/MyApp.war -O /usr/share/java/jboss-ec2-eap-applications/MyApp.war # Create a file of CLI commands to be executed after starting the server cat> $USER_CLI_COMMANDS << "EOC" deploy /usr/share/java/jboss-ec2-eap-applications/MyApp.war EOC EOF
- Red Hat AMI インスタンスを起動します。
結果
アプリケーションが JBoss EAP 6 に正常にデプロイされます。