关于EC2 ELB的两个问题:
首先是如何正确运行JMeter测试.我找到了以下http://osdir.com/ml/jmeter-user.jakarta.apache.org/2010-04/msg00203.html,基本上说是设置-Dsun.net.inetaddr.ttl = 0时启动JMeter(这很容易),第二点是路由是每个ip而不是每个请求.因此,除了开始一个jmeter实例的农场,我不知道如何解决这个问题.欢迎提出任何想法,或者我可能会错误地阅读解释(?)
另外,我有一个Web服务,它正在服务器端调用java中的另一个Web服务(并且都在ELB后面),所以我使用的是HttpClient,它是MultiThreadedHttpConnectionManager,我在那里提供了一些大的主机路由值.连接管理器.我想知道这是否会破坏负载平衡行为ELB,因为连接被缓存(而且,请求都来自同一台机器).我每次都可以切换到使用一个新的HttpClient(有点蹩脚),但这并没有解决所有请求都来自少数主机的事实.
背景故事:我正在使用EC2上的ELB对服务进行性能测试,流量不均匀分布(大多数流量到1-2个节点,几乎没有流量到1个节点,根本没有流量到第4个节点).所以上面的问题是我发现的可能的罪魁祸首.
java amazon-ec2 performance-testing amazon-web-services amazon-elb
我想删除项目makefile并编写一些很好的gradle任务.我需要按以下顺序执行以下任务:
#1,#3和#4是来自android和plugin(bintray)的任务,而#2是自定义任务.这是我到目前为止:
task releaseMajor {
doLast {
clean.execute()
build.execute()
incrementVersion.execute()
bintrayUpload.execute()
}
}
Run Code Online (Sandbox Code Playgroud)
因为我觉得批量订单就没有那么大clean了后运行build.而且binrayUpload没有味道(release).我也尝试使用dependsOn没有成功(订单不工作).
我无法在Gradle doc中找到如何正确执行此操作.当从正确的顺序执行时,从CLI开始,一切都运行良好.
我有一个时髦的剧本Automate.groovy.该脚本没有类定义或主方法.我正在寻找创建包含脚本的jar的最简单方法.我尝试使用以下命令编译groovy脚本:
groovyc Automate.groovy
Run Code Online (Sandbox Code Playgroud)
我还有一个Manifest文件manifest-addition.txt,它指定了主类
Main-Class: Automate
Run Code Online (Sandbox Code Playgroud)
我使用命令创建了jar:
jar cvfm Automate.jar mainfest-addition.txt *.class
Run Code Online (Sandbox Code Playgroud)
这给了我一个带有Automate.class和Automate $ 1.class的jar和一个带有Main类的Manifest文件.但是当我尝试使用jar时,java -jar Automate.jar我总是得到错误
cannot find or load main class Automate.
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么?
应该有这样一个简单的方法来创建jar.我只需要在我的jar中使用这个脚本文件,我不想使用maven/ant/gradle来完成这项工作.有没有一种简单明了的方法呢?
我正在Intellij Idea IDE中构建一个Java项目.以下是我的build.gradle文件:
group 'fyp_group09'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.5
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'log4j:log4j:1.2.17'
}
Run Code Online (Sandbox Code Playgroud)
我使用学校提供的代理连接,并在IDE中完成了所需的代理设置.log4j依赖项未下载.我已多次刷新gradle项目,但它没有下载依赖项,甚至没有给出任何错误.我怎么解决这个问题?
我在 ALB 后面有一个 lambda 目标。我的 lambda 是一个 python lambda。
def handler(event, context):
response = {
"statusCode": 200,
"statusDescription": "200 OK",
"isBase64Encoded": False,
"headers": {
"Content-Type": "text/html; charset=utf-8"
}
}
Run Code Online (Sandbox Code Playgroud)
不过,在使用 curl 访问我的 url 时,我收到了一个
< HTTP/1.1 200 OK
< Server: awselb/2.0
< Date: Sat, 06 Apr 2019 04:46:50 GMT
< Content-Type: application/octet-stream
< Content-Length: 0
< Connection: keep-alive
Run Code Online (Sandbox Code Playgroud)
注意Content-Type是一个八位字节流,它会导致浏览器将响应下载为文件而不是显示它。我尝试向"Foo":"Bar"响应添加额外的标头,但它们没有出现在 curl 响应中。ALB 似乎正在吃我的 lambda 提供的标头。我怎样才能解决这个问题?
我有一个通过 apigateway 提供的 API,它使用 AWS_IAM 身份验证。我希望使用 lambda 授权程序,以便可以实现自定义授权。我意识到我可以使用 cognito 或自定义 OAuth 应用程序,并让我的客户端发送相关的身份验证令牌。
但是,我当前的客户端已经发送了 AWS v4 签名(用于 AWS_IAM 实施),我可以使用它来识别用户并验证签名是否有效吗?
授权者 lambda 中收到的令牌如下所示:
AWS4-HMAC-SHA256 Credential=ASIASLKDFSLKDF923C/20200408/us-east-1/execute-api/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=2c65e09dedasdfasdfwfewfa592a60bcc2623296174e78780a2caad
Run Code Online (Sandbox Code Playgroud) 我的以下项目结构如下所示:
\n\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build.gradle\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 out.txt\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Server\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build.gradle\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 plugins\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 TestPlugin-0.1.0.zip\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 pluginApi\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build.gradle\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 plugins\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 testPlugin\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 libs\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 TestPlugin-0.1.0.zip\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 build.gradle\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 settings.gradle\nRun Code Online (Sandbox Code Playgroud)\n\n现在我想在主 build.gradle 中创建一个 gradle 任务,它应该执行类似的操作:
\n\n我设法编写了一个像这样的简单任务:
\n\ntask compilePluginsAndCopy() {\n delete \'Server/plugins\'\n mkdir \'Server/plugins\'\n\n subprojects.each { p ->\n if (p.path.contains("plugins/")) {\n\n p.createZip\n\n doLast {\n copy {\n from p.path.substring(1) …Run Code Online (Sandbox Code Playgroud) 你能告诉我为什么当我运行gradle时我得到这个错误:
Error:Module version trestGradle:trestGradle:1.0-SNAPSHOT,
configuration 'runtime' declares a dependency on
configuration 'default' which is not declared in the module
descriptor for it.develop:myLib:1.0.0"
Run Code Online (Sandbox Code Playgroud)
需要在ivy.xml(模块描述符)上声明什么?
MyLib位于内部常春藤存储库中
我检查过:凭据,常春藤网址和模式
的build.gradle:
group 'trestGrad'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.5
configurations {
compile
}
repositories {
ivy {
url = 'http://example.com/artifactory/cst'
credentials {
username = "user"
password = "pass123"
}
layout('pattern') {
// Pattern to resolve Ivy descriptor files.
ivy '[organization]/[module]/[revision]/[type]s/ivy.xml'
// Pattern to resolve files.
artifact '[organization]/[module]/[revision]/[type]s/[module].[ext]'
}
}
}
dependencies {
compile …Run Code Online (Sandbox Code Playgroud) 我在尝试db.properties在build.gradle文件中添加文件时收到此错误
的build.gradle:
allprojects {
apply from: 'db.properties'
apply from: 'deployment.properties'
repositories {
mavenCentral()
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
}
Run Code Online (Sandbox Code Playgroud)
db.properties:
db=blal
dbUsername=/bilal/home
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
* Where:
Script 'camelawsextractionservicesb/db.properties' line: 1
* What went wrong:
A problem occurred evaluating script.
> Could not find property 'blal' on root project 'CamelExtractionServices'.
Run Code Online (Sandbox Code Playgroud) 我想编写用于CI / CD的Terraform脚本,我不喜欢脚本中的CD,而是有特定的路径。
我试过了 terraform init c:\my\folder\containing\tf-file
但是运行该命令会将.terraform文件夹放入我的cwd中。
gradle ×5
build.gradle ×3
java ×2
amazon-ec2 ×1
amazon-elb ×1
android ×1
aws-alb ×1
aws-lambda ×1
dependencies ×1
groovy ×1
ivy ×1
jar ×1
log4j ×1
repository ×1
terraform ×1
windows ×1