|
|
@ -1,10 +1,156 @@ |
|
|
|
# README |
|
|
|
|
|
|
|
项目网址: [106.75.254.215:3389/](106.75.254.215:3389/mypads)[mypads](106.75.254.215:3389/mypads) |
|
|
|
[toc] |
|
|
|
|
|
|
|
码园URL: [http://](http://gitea.shuishan.net.cn/10164810127/DasePad)[gitea.shuishan.net.cn](http://gitea.shuishan.net.cn/10164810127/DasePad)[/10164810127](http://gitea.shuishan.net.cn/10164810127/DasePad)[/DasePad](http://gitea.shuishan.net.cn/10164810127/DasePad) |
|
|
|
## 如何部署 |
|
|
|
|
|
|
|
演示视频:链接: https://pan.baidu.com/s/1LGqm4T1gEGHv9ea9REedlg 密码: 148l |
|
|
|
### 云主机 |
|
|
|
|
|
|
|
云主机镜像ID: uimage-tbzchrze(名称:DasePad镜像) |
|
|
|
从镜像恢复云主机 |
|
|
|
|
|
|
|
镜像ID: uimage-tbzchrze(名称:DasePad镜像) |
|
|
|
|
|
|
|
- IP: 106.75.254.215 |
|
|
|
- 用户名:ubuntu |
|
|
|
- 密码:cloudcomputing1 |
|
|
|
|
|
|
|
### 云数据库 |
|
|
|
|
|
|
|
**方法一:从云数据库备份恢复** |
|
|
|
|
|
|
|
备份链接:https://pan.baidu.com/s/1QMJxZ_4_9uS_9B_SK330sw 密码: 0nlu |
|
|
|
|
|
|
|
**方法二:重新创建MySQL云数据库** |
|
|
|
|
|
|
|
1. 创建数据库 |
|
|
|
|
|
|
|
![1](./images/1.png) |
|
|
|
|
|
|
|
2. 访问:mysql -h[新创建的数据库IP地址] -P[新创建的数据库端口] -uroot -pcloudcomputing1 |
|
|
|
|
|
|
|
以上图数据库为例:mysql -h10.23.238.149 -P3306 -uroot -pcloudcomputing1 |
|
|
|
|
|
|
|
3. 修改:项目的setting.json为以下配置(使用数据库的内网IP) |
|
|
|
|
|
|
|
```json |
|
|
|
"dbType" : "mysql", |
|
|
|
"dbSettings" : { |
|
|
|
"user": "root", |
|
|
|
"host": 【新创建的数据库IP地址】, |
|
|
|
"port": 【新创建的数据库端口】, |
|
|
|
"password": "cloudcomputing1", |
|
|
|
"database": "etherpad_lite_db", |
|
|
|
"charset": "utf8mb4" |
|
|
|
}, |
|
|
|
``` |
|
|
|
|
|
|
|
4. 部署: |
|
|
|
|
|
|
|
- 创建数据库和数据表 |
|
|
|
|
|
|
|
```sql |
|
|
|
create database `etherpad_lite_db`; |
|
|
|
CREATE TABLE `store` ( |
|
|
|
`key` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '', |
|
|
|
`value` longtext COLLATE utf8mb4_bin NOT NULL, |
|
|
|
PRIMARY KEY (`key`) |
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
|
|
|
``` |
|
|
|
|
|
|
|
- 修改MySQL配置: |
|
|
|
|
|
|
|
修改MySQL的charset格式为`utf8mb4`, 因为以下原因: |
|
|
|
|
|
|
|
> MySQL的 `utf8` charset only partially implements proper UTF-8 encodingIt can only store UTF-8-encoded symbols that consist of one to three bytes; encoded symbols that take up four bytes aren’t supported. |
|
|
|
|
|
|
|
修改方法: |
|
|
|
|
|
|
|
```sql |
|
|
|
# For each database: |
|
|
|
ALTER DATABASE etherpad_lite_db CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
|
|
|
``` |
|
|
|
|
|
|
|
修改结果: |
|
|
|
|
|
|
|
![2](images/2.png) |
|
|
|
|
|
|
|
### 负载均衡 |
|
|
|
|
|
|
|
1. 创建负载均衡节点 |
|
|
|
|
|
|
|
2. 负载均衡压测:分别启动1~3个节点后运行如下命令 |
|
|
|
|
|
|
|
```shell |
|
|
|
ab -c 1000 -n 10000 http://106.75.254.215:3389/mypads/index.html |
|
|
|
``` |
|
|
|
|
|
|
|
可以看到如图输出 |
|
|
|
|
|
|
|
![3](images/3.png) |
|
|
|
|
|
|
|
![4](images/4.png) |
|
|
|
|
|
|
|
![5](images/5.png) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 如何运行 |
|
|
|
|
|
|
|
1. 部署好云主机和云数据库,负载均衡不部署也可以 |
|
|
|
|
|
|
|
2. 进入云主机,如下图进入etherpad-lite文件夹 |
|
|
|
|
|
|
|
![Screen Shot 2021-01-16 at 12.02.22 AM](images/6.png) |
|
|
|
|
|
|
|
3. 启动应用,需要约1-2分钟,命令和输出如下图 |
|
|
|
|
|
|
|
![7](images/7.png) |
|
|
|
|
|
|
|
![8](images/8.png) |
|
|
|
|
|
|
|
4. 应用启动后,可以在任意设备访问应用,入口为http://106.75.254.215:3389/mypads |
|
|
|
|
|
|
|
## 应用效果 |
|
|
|
|
|
|
|
### 视频 |
|
|
|
|
|
|
|
演示视频链接: https://pan.baidu.com/s/1LGqm4T1gEGHv9ea9REedlg 密码: 148l |
|
|
|
|
|
|
|
### 截图 |
|
|
|
|
|
|
|
用户登陆界面 |
|
|
|
|
|
|
|
![9](images/9.png) |
|
|
|
|
|
|
|
用户注册界面 |
|
|
|
|
|
|
|
![10](images/10.png) |
|
|
|
|
|
|
|
用户个人主页 |
|
|
|
|
|
|
|
![11](images/11.png) |
|
|
|
|
|
|
|
添加新文件夹(Pad创建在文件夹中、一个Pad即一个文档) |
|
|
|
|
|
|
|
![12](images/12.png) |
|
|
|
|
|
|
|
邀请用户共同编辑Pad(注册用户才能被邀请) |
|
|
|
|
|
|
|
![13](images/13.png) |
|
|
|
|
|
|
|
创建新Pad |
|
|
|
|
|
|
|
![14](images/14.png) |
|
|
|
|
|
|
|
共同编辑一个Pad,不同颜色代表不同用户 |
|
|
|
|
|
|
|
![15](images/15.png) |
|
|
|
|
|
|
|
对某行添加评论 |
|
|
|
|
|
|
|
![16](images/16.png) |
|
|
|
|
|
|
|
添加图片,图片可以放大缩小 |
|
|
|
|
|
|
|
![17](images/17.png) |
|
|
|
|