AWS的CloudFormation和Elastic Beanstalk的简单测试

2023-11-04 05:08

本文主要是介绍AWS的CloudFormation和Elastic Beanstalk的简单测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • CloudFormation
  • Elastic Beanstalk
  • 通过EB CLI操作Elastic Beanstalk
    • EB CLI操作的简单测试
    • EB CLI指令eb init的问题
    • 使用EB CLI发布项目
  • Reference

CloudFormation

CloudFormation归类在Management & Governance下,它有很多模板可以直接使用,模板实际上是包含配置的文本文件,使用模板可以用很简单的操作可以创建,重复创建和设置很复杂的应用。

这里做一个简单的测试,点Create stack,取名: XiongStack,再使用Use a sample template,使用已有的模板,创建一个Wordpress blog,并进行各种设置。在这里可以看到模板的细节,也可以对模板进行编辑。

创建后可以在Events下看到进度。创建完成后,在Resource下查看网址:http://ec2-13-229-131-47.ap-southeast-1.compute.amazonaws.com/wordpress/,输入后有以下提示:

Your server is running PHP version 5.3.29 but WordPress 5.3 requires at least 5.6.20.

这个问题以前碰到过,需要升级PHP版本,参见使用AWS云安装WordPress + RDS MySQL方法进行解决,解决后以下网址可以正常访问:

http://ec2-13-229-131-47.ap-southeast-1.compute.amazonaws.com/wordpress/

测试完成后,删除这个Stack,那么这个Stack下所有的资源全部都被删除。

Elastic Beanstalk

Elastic Beanstalk是在EC2界面里,它主要实现了容器的功能,使你不用担心底层的架构,例如负载均衡,扩展,运行健康检查等,使用者只需关注于应用层的创建和设置。

创建一个Elastic Beanstalk,进入Create a web app,取名为XiongElasticBeanstalk,使用PHP,并使用Sample Application,也就是样例应用,这里是简单起见。当然也可以上传代码(上传ZIP或者WAR),发布成功后,查看以下生成的 DNS网址,成功访问。

http://xiongelasticbeanstalk-env-1.pysmrc6iwc.ap-southeast-1.elasticbeanstalk.com/

可以对样例程序进行下载,修改,再上传,进行发布,出现以下问题:

Forbidden
You don’t have permission to access this resource.

查找原因,参见403 Forbidden error,原因如下:

When zipping up the files Winzip has created a additional folder to contain all files. Therefore the root folder did no have an index file but only the additional folder with the entire website.

也就是在ZIP文件时,自动生成了根目录,因为只有根目录,所以找不到index.html文件,而是在下一级目录。这里要在目录里面去生成ZIP文件,再重新生成php-v3.zip文件。

再重新上传,进行发布,最后通过生成的DNS网址来检查更新的情况。问题解决,网页可以正常访问!

通过EB CLI操作Elastic Beanstalk

我的Windows环境的Python和PIP如下:、

C:\Users\xionghuilin>python --version
Python 2.7.9C:\Users\xionghuilin>pip --version
pip 1.5.6 from C:\Python27\lib\site-packages (python 2.7)C:\Users\xionghuilin>

参见:Github aws/aws-elastic-beanstalk-cli-setup,在Github克隆EB CLI的安装文件,

D:\AWS> git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
Cloning into 'aws-elastic-beanstalk-cli-setup'...
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 286 (delta 23), reused 31 (delta 14), pack-reused 237
Receiving objects: 100% (286/286), 519.17 KiB | 549.00 KiB/s, done.
Resolving deltas: 100% (153/153), done.

出现以下错误,

D:\AWS> python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py***********************************
1. Locating virtualenv installation
***********************************
ERROR: Could not find and "virtualenv" installed. Ensurevirtualenv is installed and that it is in PATH before executingthis script.******************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
'virtualenv' is not recognized as an internal or external command,
operable program or batch file.

解决办法是重新安装virtualenv

D:\AWS> pip uninstall -y virtualenv
Cannot uninstall requirement virtualenv, not installed
Storing debug log for failure in C:\Users\xionghuilin\pip\pip.log
D:\AWS> pip install virtualenv
Downloading/unpacking virtualenv
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...

正确安装 结果如下:

D:\Mywork\blog\2016\AWS\AWS2019> python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py***********************************
1. Locating virtualenv installation
*****************************************************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
Already using interpreter C:\Python27\python.exe
New python executable in C:\Users\xionghuilin\.ebcli-virtual-env\Scripts\python.exe
Installing setuptools, pip, wheel...
done.************************
3. Activating virtualenv
*******************************************
4. Installing EBCLI
*******************
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting awsebcliDownloading https://files.pythonhosted.org/packages/a6/26/e723d628db031a434466597f2310779a46d41e7548a83e04188c55aaa051/awsebcli-3.16.0.tar.gz (242kB)......
Successfully built awsebcli cement future pathspec semantic-version termcolor
Installing collected packages: jmespath, urllib3, six, python-dateutil, docutils, botocore, cement, colorama, future, pathspec, PyYAML, idna, certifi, chardet, requests, semantic-version, termcolor, wcwidth, pypiwin32, awsebcli
Successfully installed PyYAML-3.13 awsebcli-3.16.0 botocore-1.13.28 cement-2.8.2 certifi-2019.9.11 chardet-3.0.4 colorama-0.3.9 docutils-0.15.2 future-0.16.0 idna-2.7 jmespath-0.9.4 pathspec-0.5.9 pypiwin32-219 python-dateutil-2.8.0 requests-2.20.1 semantic-version-2.5.0 six-1.11.0 termcolor-1.1.0 urllib3-1.24.3 wcwidth-0.1.7***********************
5. Creating EB wrappers
**************************************
6. Finishing up
***************
Success!To complete installation, ensure `eb` is in PATH. You can ensure this by executing:1. CMD Prompt:cmd.exe /c "C:\Users\xionghuilin\.ebcli-virtual-env\executables\path_exporter.bat"2. PowerShell:& "C:\Users\xionghuilin\.ebcli-virtual-env\executables\path_exporter.vbs"NOTE: Additionally, you would need to **restart this shell**D:\AWS>
D:\AWS> eb --version
EB CLI 3.16.0 (Python 2.7.9)

EB CLI操作的简单测试

根据以下指导进行测试:

Get Started
$ mkdir HelloWorld
$ cd HelloWorld
$ eb init -p PHP
$ echo "Hello World" > index.html
$ eb create dev-env
$ eb open
To deploy updates to your applications, use ‘eb deploy’.

测试结果如下:

D:\AWS\Beanstalk> mkdir HelloWorldDirectory: D:\AWS\BeanstalkMode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       27/11/2019  12:06 PM                HelloWorldD:\AWS\Beanstalk> cd .\HelloWorld
D:\AWS\Beanstalk\HelloWorld> eb init -p PHP
Application HelloWorld has been created.
D:\AWS\Beanstalk\HelloWorld> echo "Hello World" > index.html
D:\AWS\Beanstalk\HelloWorld> eb create dev-env
Creating application version archive "app-191127_120824".
Uploading HelloWorld/app-191127_120824.zip to S3. This may take a while.
Upload Complete.
Environment details for: dev-envApplication name: HelloWorldRegion: us-west-2Deployed Version: app-191127_120824Environment ID: e-xtuncgmjxqPlatform: arn:aws:elasticbeanstalk:us-west-2::platform/PHP 7.3 running on 64bit Amazon Linux/2.9.1Tier: WebServer-Standard-1.0CNAME: UNKNOWNUpdated: 2019-11-27 04:08:38.632000+00:00
Printing Status:
2019-11-27 04:08:37    INFO    createEnvironment is starting.
2019-11-27 04:08:38    INFO    Using elasticbeanstalk-us-west-2-606255748358 as Amazon S3 storage bucket for environment data.
2019-11-27 04:09:03    INFO    Created security group named: sg-04858e5693e0726c4
2019-11-27 04:09:03    INFO    Created load balancer named: awseb-e-x-AWSEBLoa-142K4TE22ELRA
2019-11-27 04:09:20    INFO    Created security group named: awseb-e-xtuncgmjxq-stack-AWSEBSecurityGroup-1OX45879I5282
2019-11-27 04:09:20    INFO    Created Auto Scaling launch configuration named: awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingLaunchConfiguration-17CVE406BL5Q1
2019-11-27 04:10:22    INFO    Created Auto Scaling group named: awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2
2019-11-27 04:10:22    INFO    Waiting for EC2 instances to launch. This may take a few minutes.
2019-11-27 04:10:22    INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:606255748358:scalingPolicy:03298489-18c9-43c0-87b3-5f7931fefa33:autoScalingGroupName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2:policyName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingScaleDownPolicy-GN2EGUXEO27C
2019-11-27 04:10:22    INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:606255748358:scalingPolicy:e6216fa7-c732-49e1-bcc4-3c1d085596c0:autoScalingGroupName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2:policyName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingScaleUpPolicy-19O2WY5AGMT1K
2019-11-27 04:10:22    INFO    Created CloudWatch alarm named: awseb-e-xtuncgmjxq-stack-AWSEBCloudwatchAlarmLow-1M3O1KQ22U7BP
2019-11-27 04:10:22    INFO    Created CloudWatch alarm named: awseb-e-xtuncgmjxq-stack-AWSEBCloudwatchAlarmHigh-Z4T27E63I8IY
2019-11-27 04:10:45    INFO    Application available at dev-env.xhifdm4xhe.us-west-2.elasticbeanstalk.com.
2019-11-27 04:10:45    INFO    Successfully launched environment: dev-envD:\AWS\Beanstalk\HelloWorld>eb deploy

以上默认选择了US West (Oregon)us-west-2创建了应用。yml在目录HelloWorld\.elasticbeanstalk\config.yml,文件内容如下:

branch-defaults:default:environment: dev-envgroup_suffix: null
global:application_name: HelloWorldbranch: nulldefault_ec2_keyname: nulldefault_platform: PHPdefault_region: us-west-2include_git_submodules: trueinstance_profile: nullplatform_name: nullplatform_version: nullprofile: nullrepository: nullsc: nullworkspace_type: Application

测试生成的网址:http://dev-env.xhifdm4xhe.us-west-2.elasticbeanstalk.com/,成功显示 Hello World

根据Configure the EB CLI, 认证的信息是放在以下目录的:C:\Users\xionghuilin\.aws\credentials,所以在EB CLI操作过程中是不用进行认证操作的。

测试完成后,删除应用使用指令eb terminate

D:\AWS\Beanstalk\HelloWorld> eb terminate
The environment "dev-env" and all associated instances will be terminated.
To confirm, type the environment name: dev-env
2019-11-27 06:22:41    INFO    terminateEnvironment is starting.
2019-11-27 06:22:58    INFO    Deleted CloudWatch alarm named: awseb-e-xtuncgmjxq-stack-AWSEBCloudwatchAlarmHigh-Z4T27E63I8IY
2019-11-27 06:22:58    INFO    Deleted CloudWatch alarm named: awseb-e-xtuncgmjxq-stack-AWSEBCloudwatchAlarmLow-1M3O1KQ22U7BP
2019-11-27 06:22:58    INFO    Deleted Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:606255748358:scalingPolicy:e6216fa7-c732-49e1-bcc4-3c1d085596c0:autoScalingGroupName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2:policyName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingScaleUpPolicy-19O2WY5AGMT1K
2019-11-27 06:22:58    INFO    Deleted Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:606255748358:scalingPolicy:03298489-18c9-43c0-87b3-5f7931fefa33:autoScalingGroupName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2:policyName/awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingScaleDownPolicy-GN2EGUXEO27C
2019-11-27 06:22:58    INFO    Waiting for EC2 instances to terminate. This may take a few minutes.
2019-11-27 06:25:00    INFO    Deleted Auto Scaling group named: awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingGroup-1VAKBZQ2RS6O2
2019-11-27 06:25:00    INFO    Deleted load balancer named: awseb-e-x-AWSEBLoa-142K4TE22ELRA
2019-11-27 06:25:00    INFO    Deleted Auto Scaling launch configuration named: awseb-e-xtuncgmjxq-stack-AWSEBAutoScalingLaunchConfiguration-17CVE406BL5Q1
2019-11-27 06:25:00    INFO    Deleted security group named: awseb-e-xtuncgmjxq-stack-AWSEBSecurityGroup-1OX45879I5282
2019-11-27 06:25:31    INFO    Deleted security group named: sg-04858e5693e0726c4
2019-11-27 06:25:34    INFO    Deleting SNS topic for environment dev-env.
2019-11-27 06:25:35    INFO    terminateEnvironment completed successfully.

EB CLI指令eb init的问题

碰到问题:
Cannot setup CodeCommit because there is no Source Control setup, continuing with initialization

D:\AWS\Beanstalk> eb init
Cannot setup CodeCommit because there is no Source Control setup, continuing with initialization

需要使用git来做CodeCommit,如下:

D:\AWS\Beanstalk> git init
Initialized empty Git repository in D:\AWS\Beanstalk/.git/
D:\AWS\Beanstalk [master +2 ~0 -0 !]> git add .
D:\AWS\Beanstalk [master +3 ~0 -0 ~]> eb init --interactive
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
13) cn-northwest-1 : China (Ningxia)
14) us-east-2 : US East (Ohio)
15) ca-central-1 : Canada (Central)
16) eu-west-2 : EU (London)
17) eu-west-3 : EU (Paris)
18) eu-north-1 : EU (Stockholm)
19) ap-east-1 : Asia Pacific (Hong Kong)
20) me-south-1 : Middle East (Bahrain)
(default is 3): 7Select an application to use
1) XiongElasticBeanstalk
2) [ Create new Application ]
(default is 2): 1
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".Select a platform.
1) Node.js
2) PHP
3) Python
4) Ruby
5) Tomcat
6) IIS
7) Docker
8) Multi-container Docker
9) GlassFish
10) Go
11) Java
12) Corretto (BETA)
13) Packer
(default is 1): 2Select a platform version.
1) PHP 7.3
2) PHP 7.2
3) PHP 7.1
4) PHP 7.0
5) PHP 5.6
6) PHP 5.5
7) PHP 5.4
(default is 1):
WARNING: Git is in a detached head state. Using branch "default".
Do you wish to continue with CodeCommit? (y/N) (default is n):
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".
Do you want to set up SSH for your instances?
(Y/n): n
D:\AWS\Beanstalk [master +3 ~0 -0 ~]>

使用EB CLI发布项目

测试了使用EB CLI发布项目,对index.php做改动后,再进行发布。

首先碰到以下问题,需要做commit

D:\AWS\Beanstalk [master +3 ~0 -0 | +6 ~0 -2 !]> git add .
warning: LF will be replaced by CRLF in .ebextensions/logging.config.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in cron.yaml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in scheduled.php.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in styles.css.
The file will have its original line endings in your working directory.
D:\AWS\Beanstalk [master +7 ~0 -0 ~]> eb deploy
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".
WARNING: Git is in a detached head state. Using branch "default".
ERROR: CommandError - git could not find the HEAD; most likely because there are no commits present

需要提交,提交后有以下问题,Changes not staged for commitERROR: This branch does not have a default environment

D:\AWS\Beanstalk [master +7 ~0 -0 ~]> git commit
Aborting commit due to empty commit message.
D:\AWS\Beanstalk [master +7 ~0 -0 ~]> git commit -m "latest update"
[master (root-commit) a137324] latest update7 files changed, 223 insertions(+)create mode 100644 .ebextensions/logging.configcreate mode 100644 .gitignorecreate mode 100644 cron.yamlcreate mode 100644 index.phpcreate mode 100644 logo_aws_reduced.gifcreate mode 100644 scheduled.phpcreate mode 100644 styles.css
D:\AWS\Beanstalk [master]> eb deploy
ERROR: This branch does not have a default environment. You must either specify an environment by typing "eb deploy my-env-name" or set a default environment by typing "eb use my-env-name".
D:\AWS\Beanstalk [master]> git commit -m "latest update 2"
On branch master
Changes not staged for commit:modified:   index.phpno changes added to commit

针对以上两个问题,Changes not staged for commitERROR: This branch does not have a default environment,进行以下操作,可以解决:

D:\AWS\Beanstalk [master +0 ~1 -0 !]> git add index.php
D:\AWS\Beanstalk [master +0 ~1 -0 ~]> git commit -a -m "update after add index.php"
[master 5ec2d37] update after add index.php1 file changed, 1 insertion(+), 1 deletion(-)
D:\AWS\Beanstalk [master +0 ~1 -0 !]> eb use Xiongelasticbeanstalk-env-1
D:\AWS\Beanstalk [master]> eb deploy
Creating application version archive "app-5ec2-191127_152548".
Uploading XiongElasticBeanstalk/app-5ec2-191127_152548.zip to S3. This may take a while.
Upload Complete.
2019-11-27 07:26:04    INFO    Environment update is starting.
2019-11-27 07:26:07    INFO    Deploying new version to instance(s).
2019-11-27 07:26:21    INFO    New application version was deployed to running EC2 instances.
2019-11-27 07:26:21    INFO    Environment update completed successfully.D:\AWS\Beanstalk [master]>

发布完后,再使用DNS网址进行测试:http://xiongelasticbeanstalk-env-1.pysmrc6iwc.ap-southeast-1.elasticbeanstalk.com/,发现最新做的改动已经发布到网页中了。测试成功!

使用eb terminate删除所有的应用,完成本次测试。

Reference

What is AWS CloudFormation?
Getting Started with AWS CloudFormation
AWS Elastic Beanstalk Concepts
What Is AWS Elastic Beanstalk?
Getting Started Using Elastic Beanstalk
使用AWS云安装WordPress + RDS MySQL
403 Forbidden error
Configure the EB CLI
Github aws/aws-elastic-beanstalk-cli-setup

这篇关于AWS的CloudFormation和Elastic Beanstalk的简单测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/343446

相关文章

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分

高效+灵活,万博智云全球发布AWS无代理跨云容灾方案!

摘要 近日,万博智云推出了基于AWS的无代理跨云容灾解决方案,并与拉丁美洲,中东,亚洲的合作伙伴面向全球开展了联合发布。这一方案以AWS应用环境为基础,将HyperBDR平台的高效、灵活和成本效益优势与无代理功能相结合,为全球企业带来实现了更便捷、经济的数据保护。 一、全球联合发布 9月2日,万博智云CEO Michael Wong在线上平台发布AWS无代理跨云容灾解决方案的阐述视频,介绍了

csu 1446 Problem J Modified LCS (扩展欧几里得算法的简单应用)

这是一道扩展欧几里得算法的简单应用题,这题是在湖南多校训练赛中队友ac的一道题,在比赛之后请教了队友,然后自己把它a掉 这也是自己独自做扩展欧几里得算法的题目 题意:把题意转变下就变成了:求d1*x - d2*y = f2 - f1的解,很明显用exgcd来解 下面介绍一下exgcd的一些知识点:求ax + by = c的解 一、首先求ax + by = gcd(a,b)的解 这个

hdu2289(简单二分)

虽说是简单二分,但是我还是wa死了  题意:已知圆台的体积,求高度 首先要知道圆台体积怎么求:设上下底的半径分别为r1,r2,高为h,V = PI*(r1*r1+r1*r2+r2*r2)*h/3 然后以h进行二分 代码如下: #include<iostream>#include<algorithm>#include<cstring>#include<stack>#includ

usaco 1.3 Prime Cryptarithm(简单哈希表暴搜剪枝)

思路: 1. 用一个 hash[ ] 数组存放输入的数字,令 hash[ tmp ]=1 。 2. 一个自定义函数 check( ) ,检查各位是否为输入的数字。 3. 暴搜。第一行数从 100到999,第二行数从 10到99。 4. 剪枝。 代码: /*ID: who jayLANG: C++TASK: crypt1*/#include<stdio.h>bool h

【测试】输入正确用户名和密码,点击登录没有响应的可能性原因

目录 一、前端问题 1. 界面交互问题 2. 输入数据校验问题 二、网络问题 1. 网络连接中断 2. 代理设置问题 三、后端问题 1. 服务器故障 2. 数据库问题 3. 权限问题: 四、其他问题 1. 缓存问题 2. 第三方服务问题 3. 配置问题 一、前端问题 1. 界面交互问题 登录按钮的点击事件未正确绑定,导致点击后无法触发登录操作。 页面可能存在

uva 10387 Billiard(简单几何)

题意是一个球从矩形的中点出发,告诉你小球与矩形两条边的碰撞次数与小球回到原点的时间,求小球出发时的角度和小球的速度。 简单的几何问题,小球每与竖边碰撞一次,向右扩展一个相同的矩形;每与横边碰撞一次,向上扩展一个相同的矩形。 可以发现,扩展矩形的路径和在当前矩形中的每一段路径相同,当小球回到出发点时,一条直线的路径刚好经过最后一个扩展矩形的中心点。 最后扩展的路径和横边竖边恰好组成一个直

业务中14个需要进行A/B测试的时刻[信息图]

在本指南中,我们将全面了解有关 A/B测试 的所有内容。 我们将介绍不同类型的A/B测试,如何有效地规划和启动测试,如何评估测试是否成功,您应该关注哪些指标,多年来我们发现的常见错误等等。 什么是A/B测试? A/B测试(有时称为“分割测试”)是一种实验类型,其中您创建两种或多种内容变体——如登录页面、电子邮件或广告——并将它们显示给不同的受众群体,以查看哪一种效果最好。 本质上,A/B测

poj 1113 凸包+简单几何计算

题意: 给N个平面上的点,现在要在离点外L米处建城墙,使得城墙把所有点都包含进去且城墙的长度最短。 解析: 韬哥出的某次训练赛上A出的第一道计算几何,算是大水题吧。 用convexhull算法把凸包求出来,然后加加减减就A了。 计算见下图: 好久没玩画图了啊好开心。 代码: #include <iostream>#include <cstdio>#inclu