简体   繁体   English

在亚马逊托管Jboss Web应用程序时如何解决数据库的连接拒绝问题

[英]How to resolve connection refuse issue of database when hosting jboss web application in amazon

I have created amazon ec2 instance and rds instance correctly. 我已经正确创建了Amazon ec2实例和rds实例。 I deployed my war file to the ec2 correctly and it deployed when I run the jboss server using Putty. 我将我的war文件正确地部署到了ec2上,并在使用Putty运行jboss服务器时将其部署了。 But the mysql data tables does not created and it says connection refuse error. 但是没有创建mysql数据表,它说连接拒绝错误。 What are the changes that should include in standalone.xml? standalone.xml应包含哪些更改? I will attach my datasource in standalne.xml below. 我将在下面的standalne.xml中附加我的数据源。

<datasource jndi-name="java:/iasDs" pool-name="iasDs_pool" enabled="true">
                <connection-url>
                    jdbc:mysql://localhost.com:3306/ias_db
                </connection-url>
                <driver>
                   mysql
                </driver>
                <pool>
                    <max-pool-size>
                        30
                    </max-pool-size>
                </pool>
                <security>
                    <user-name>
                        ****
                    </user-name>
                    <password>
                        ******
                    </password>
                </security>
            </datasource>               
            <drivers>               
                <driver name="mysql" module="com.mysql"/>   
            <drivers>

End point of the rds is my-db-instance.cty4r97dlgx0.ap-southeast-1.rds.amazonaws.com:3306.Help me with this. rds的终点是my-db-instance.cty4r97dlgx0.ap-southeast-1.rds.amazonaws.com:3306。为此提供帮助。

change your <connection-url> to use the RDS end point instead of localhost 更改您的<connection-url>以使用RDS端点而不是localhost

I assume localhost is the default but you have the database on RDS on a different address 我假设localhost是默认设置,但您在RDS上的数据库位于其他地址上

The username and password will also need setting correctly for the RDS instance 用户名和密码也需要正确设置RDS实例

If that doesn't work you need to check 如果这样不起作用,则需要检查

1) security groups on the RDS and network ACLs for your VPC 1)您的VPC的RDS和网络ACL上的安全组

2) basic connectivity on port 3306 between RDS and EC2. 2)RDS和EC2之间的端口3306上的基本连接。 For example on the EC2 run the command nc -vz my-db-instance.cty4r97dlgx0.ap-southeast-1.rds.amazonaws.com 3306 例如,在EC2上,运行命令nc -vz my-db-instance.cty4r97dlgx0.ap-southeast-1.rds.amazonaws.com 3306

3) try connecting to the RDS from the EC2 with a command line client mysql 3)尝试使用命令行客户端mysql从EC2连接到RDS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM