Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan Su committed Apr 25, 2024
1 parent 803f297 commit 25fc1a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
13 changes: 0 additions & 13 deletions docs/en/user-guide/appendix-database-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Some users' database Security Groups have restrictions that only allow fixed IP

Next, we will create an EC2 instance as a database proxy, install Nginx software, and set up port forwarding. When making a data source connection, SDPS connects to EC2 and makes a JDBC connection to the database through this EC2.

<<<<<<< HEAD
##### Step 1: Create an EC2 Instance
- In the EC2 console. Create an EC2 in the VPC where SDP is located, to be used as a proxy server.
- Configure the EC2 Security Group: Add an Inbound Rule, allowing all TCP entries from the following two security groups: SDPS-CustomDB, Stack Name-RDSRDSClient
Expand All @@ -24,18 +23,6 @@ Next, we will create an EC2 instance as a database proxy, install Nginx software
- Edit the configuration file:
```python
# Replace the default nginx.conf file content with code. You need to make necessary adjustments.
=======
### Step 1:Install
`sudo yum install nginx nginx-mod-stream`
### Step 2:Start
`sudo systemctl start nginx`
### Step 3:View status
`systemctl status nginx`
### Step 4:Edit /etc/nginx/nginx.conf
`sudo vim /etc/nginx/nginx.conf`
Add content similar to the following at the end of the file
```
>>>>>>> parent of 1ae0db0e (docs for batch proxy data source creation)
stream {
upstream backend1 {
server 10.0.34.171:3306 max_fails=3 fail_timeout=30s;
Expand Down
31 changes: 1 addition & 30 deletions docs/zh/user-guide/appendix-database-proxy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## 使用EC2配置数据库代理

<<<<<<< HEAD
g
### 创建并登录到代理EC2机器,配置转发端口
有一些用户的数据库Security Group设置了限制,只允许固定IP访问。这个时候,用户需要一个EC2作为Proxy来提供固定的IP。

Expand All @@ -23,21 +22,6 @@
- 编辑配置文件:
```python
# 用代码替换默认的nginx.conf文件内容。您需要进行必要的调整。
=======
创建1EC2实例作为数据库代理。安装Nginx 设置端口转发。例如:


### Step 1:安装
`sudo yum install nginx nginx-mod-stream`
### Step 2:启动
`sudo systemctl start nginx`
### Step 3:查看状态
`systemctl status nginx`
### Step 4:编辑/etc/nginx/nginx.conf文件
`sudo vim /etc/nginx/nginx.conf`
在文件末尾添加类似以下内容
```
>>>>>>> parent of 1ae0db0e (docs for batch proxy data source creation)
stream {
upstream backend1 {
server 10.0.34.171:3306 max_fails=3 fail_timeout=30s; # server地址可以使用域名
Expand All @@ -49,7 +33,6 @@ stream {
}
}
```
<<<<<<< HEAD
!!! Info 数据库太多时,如何编辑配置文件?
如果您需要配置多个端口转发,可以使用SDP **批量创建数据源**功能,并通过模版来创建Nginx配置文件。见下面附录。

Expand Down Expand Up @@ -82,7 +65,6 @@ stream {
| test-instance-7002 | 1 | xxxx2.sql.db.com:3306 | jdbc:mysql://172.31.48.6:7002 | | | root | Temp123456! | 123456789 | ap-guangzhou-1 | 4 |



##### Step 3: 生成Nginx软件的config文件
(在本地)打开excel软件,菜单栏点击 Tools → Marco → Visual Basic Editor 功能。

Expand Down Expand Up @@ -112,14 +94,3 @@ stream {
}
}
```
=======
### Step 5: 重新加载配置文件
`sudo nginx -s reload`
### Step 6: 为实例添加安全组
Proxy安全组添加Rule,允许以下2个安全组的所有TCP进入:`SDPS-CustomDB``堆栈名-RDSRDSClient`
### Step 7: (可选)本地测试代理是否生效
```
sudo yum install telnet
telnet 127.0.0.1 7001
```
>>>>>>> parent of 1ae0db0e (docs for batch proxy data source creation)

0 comments on commit 25fc1a4

Please sign in to comment.