我已经配置了一个RDS Postgres微实例进行测试但是连接有问题.我创建了一个安全组,并允许所有主机(0.0.0.0/0)默认为端口5432但由于某种原因我无法连接.我尝试连接到机器上的端口5432,但它似乎已关闭.有任何想法吗?我已验证安全组正在使用正确的安全组.
这是我的配置
TCP
Port (Service) Source Action
5432 0.0.0.0/0 Delete
Run Code Online (Sandbox Code Playgroud)
以下是我尝试连接到rds服务的方法
psql -p 5432 -h example.cs945smhrv09.us-west-2.rds.amazonaws.com -U example example
Run Code Online (Sandbox Code Playgroud)
UPDATE
在确定rds在私有172子网上启动后,确定感觉有点傻.我能够从我的ec2实例连接.
问题现在是否有办法将其放在我可以连接的公共地址上?我想配置一个安全组来限制源IP,然后能够从我的桌面使用psql连接到它.
更新2
我最初发布这个问题时不记得所有细节但不再是问题.我们现在有一个管理vpc,我们使用vpn服务器连接到它.管理vpc网络受rds实例的prod和devel安全组信任.没有添加任何公共IP,我们没有问题与他们沟通.
我在没有修改的文件上遇到冲突.合并时,一行文件的冲突会发生变化.我开始处理可能发生的事情,但仍然无法解决问题.
这是分支结构.
Master已经很老了,并且在相当长的一段时间内没有从current_iteration进行过更改.然而,master通过直接将其他碱基重新定位到master上来直接应用它.所以技术上master和current_iteration已经分道扬.. 我们始终对current_iteration进行分支和标记.我看到的问题是,当我从current_iteration合并回到我的分支时.根据对current_iteration的更改,我遇到的冲突多于应该发生的冲突.我能够从current_iteration做一个git diff/git apply,它应用得很干净.
当我git show-branch --merge-base在mapr-autoinit上运行时,我看到提交实际上是几个月前的主提交.但是,当我检查时,git merge-base current_iteration mapr_autoninit我发现该版本是非常新的,很可能不会有冲突.
从我在过去几天看到的情况来看,如果我将master合并到current_iteration,提交然后将current_iteration合并回master,这似乎是合乎逻辑的.这可能应该解决我的分支merge-base指向更新版本.
也有可能我可以停止跟踪主人.我尝试使用git config --unset branch.master.merge; git config --unset branch.master.remote停止跟踪主人,但这并没有解决我的问题.
这是一个问题,其中master和current_iteration已经分歧,并且merge正在尝试通过重放整个日志来协调合并?
这里还有更多细节.我现在开了一个新问题,问题更具体.我将使用有效的答案更新两者或删除旧的,具体取决于哪个是首选.
我正在运行psql批处理脚本并将输出格式化为xml.我遇到的问题是+输出中有一个字符.我想简单地使用换行符而不是加号.我已经尝试了不少不同的论点并且惊讶于彻底的谷歌搜索没有找到答案.我假设我可以使用pset选项来更改输出eol字符,但我无法让它工作.该脚本在存储的函数上调用query_to_xml.
调用批处理脚本
psql -t -q -U user -h database-qa.example.com -f db_test_query.sql -o output.xml DatabaseToUse
Run Code Online (Sandbox Code Playgroud)
示例输出
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
+
<order_id>12345</order_id> +
<status_id>ORDER_COMPLETED</status_id> +
<customer_id>9999</customer_id> +
<company_name>ExampleComany</company_name> +
<main_contact_name>user</main_contact_name> +
<email_address>someone@gmail.com</email_address> +
<country_code xsi:nil="true"/> +
<local_number>1112223333</local_number> +
<address1>1009 Customer Ln</address1> +
<address2></address2> +
<city>Houston</city> +
<state_province_geo_id>TX</state_province_geo_id> +
<postal_code>77380</postal_code> +
...
Run Code Online (Sandbox Code Playgroud) 问题:当我向hadoop 2.2.0群集提交作业时,它不会显示在作业跟踪器中,但作业成功完成.通过这个我可以看到输出,它正确运行并在运行时打印输出.
我尝试过多种选择,但是求职者没有看到这份工作.如果我使用2.2.0 hadoop运行流媒体作业,它会显示在任务跟踪器中,但是当我通过hadoop-client api提交它时,它不会显示在作业跟踪器中.我正在查看端口8088上的ui接口以验证该作业
环境 OSX Mavericks,Java 1.6,Hadoop 2.2.0单节点集群,Tomcat 7.0.47
码
try {
configuration.set("fs.defaultFS", "hdfs://127.0.0.1:9000");
configuration.set("mapred.jobtracker.address", "localhost:9001");
Job job = createJob(configuration);
job.waitForCompletion(true);
} catch (Exception e) {
logger.log(Level.SEVERE, "Unable to execute job", e);
}
return null;
Run Code Online (Sandbox Code Playgroud)
等/ hadoop的/ mapred-site.xml中
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
Run Code Online (Sandbox Code Playgroud)
等/ hadoop的/芯-site.xml中
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hadoop-${user.name}</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Run Code Online (Sandbox Code Playgroud) 我正在寻找一种方法,从另一个pom.xml包含项目中的所有模块.所以在我的情况下,我有一个包装设置为pom的父pom.它包含3个子模块,用于在另一个api模块中实现我的接口.我想在maven中动态地包含我项目中的所有子模块.
在这种情况下,我想在另一个模块中包含connector1,connector2,connector3,而不必隐式指定connector1,2,3.
connectors - packaging: pom
connector1 - packaging: jar
connector2 - packaging: jar
connector3 - packaging: jar
Run Code Online (Sandbox Code Playgroud)
我尝试在我的项目中包含连接器pom,但这不起作用.我希望用pom指定父包将包含子模块,但这不起作用.有没有解决方法如何做到这一点?
更新
这更像是我的后果,因为我想简单地添加一个连接器并包含项目的所有子模块依赖关系jar.这将使pom更容易阅读.
而不必像这样注册所有子依赖项
<dependencies>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector1</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector1-api</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector1-etl</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector1-persistence</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector2</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector2-api</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector2-etl</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector2-persistence</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector2-other</artifactId>
<version>0.0.1</version>
</dependency>
...
</dependencies>
Run Code Online (Sandbox Code Playgroud)
这只是澄清原始问题的一个例子.它不存在,如果确实有效,可能会有重新发布.
<dependencies>
<dependency>
<groupId>com.foo</groupId>
<artifactId>connector1</artifactId>
<version>0.0.1</version>
<type>pom</type>
<include>submodules</include>
</dependency> …Run Code Online (Sandbox Code Playgroud) TL; DR我正在寻找一种按分钟存储,增加和检索事件计数范围的方法.
我正在寻找一种在redis中创建递增时间序列的解决方案.我希望将分数存储到分钟.我的目标是能够查找时间范围并获得值.因此,如果特定键的事件每30分钟发生一次,则为instnace.我想做像zrange这样的事情,并获得他们的关键价值观.我也希望使用像zincrby这样的东西来增加价值.我当然看了一个有条不紊的装置,看起来像是一个完美的装,直到我意识到我只能对得分进行范围扫描,而不是值.最佳解决方案是使用分钟数作为分数,然后使用排序集中的值作为该分钟的事件数.我遇到的问题是,锌只会增加分数而不是值.我无法找到一种原子地增加值的方法.我还使用当前分钟作为键和事件计数作为值来查看散列映射.我能够使用hincrby增加值,但问题是它不支持获取一系列键.
任何帮助,将不胜感激.
我想要做的是为我们所有的子项目推出几个父母poms.我有一个项目,包含一个父pom和两个子模块poms.如果这有所不同,那么所有三种包装都是pom型.当我部署时,它未能部署子模块,说它们被跳过.
父Pom
<groupId>com.test.cpbx</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.1-SNAPSHOT</version>
<name>Parent Pom</name>
<scm>
<connection>scm:svn:https://url/trunk</connection>
</scm>
<modules>
<module>appia</module>
<module>rialto</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<goals>deploy</goals>
<providerImplementations>
<svn>javasvn</svn>
</providerImplementations>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
<artifactId>maven-scm-provider-svnjava</artifactId>
<version>2.0.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
这是我的一个孩子pom,他们是唯一的变化是artifactId名称
儿童POM
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test.cpbx</groupId>
<artifactId>parent</artifactId>
<version>1.1-SNAPSHOT</version>
</parent>
<artifactId>rialto-parent</artifactId>
<packaging>pom</packaging>
<name>Rialto Parent POM</name>
</project>
Run Code Online (Sandbox Code Playgroud)
产量
mvn -B -DreleaseVersion=1.1 -DdevelopmentVersion=1.2.0-SNAPSHOT release:prepare -DdryRun
...
[INFO] Not removing release POMs
[INFO] Executing completion goals …Run Code Online (Sandbox Code Playgroud) 我来自guice世界,正在寻找一种类似于Guice提供的Modules.override的方法.我有一个模式,我为我的生产创建一个基本模块/ AbstractBinder,然后在测试中覆盖需要更改的绑定.
在理想的世界中,我想简单地扩展Parent AbstractBinder,然后实现绑定以覆盖父绑定器.或者另一种方法是简单地安装父Binder,然后覆盖我想要进行测试的绑定.
public class IOCRestModule extends AbstractBinder {
@Override
protected void configure() {
// Max timeout for rest calls is 20 seconds, this will come from properties later on.
bind(20000).to(Integer.class).named("MAX_REST_REQUEST_TIMEOUT");
bind("tcp://localhost").to(String.class).named("jms.url");
}
}
public class IOCMockRestModule extends AbstractBinder {
public static final Logger logger = Logger.getLogger(IOCMockRestModule.class.getName());
@Override
protected void configure() {
install(new IOCRestModule());
bind(200).to(Integer.class).named("MAX_REST_REQUEST_TIMEOUT");
bind("vm://localhost").to(String.class).named("jms.url");
}
Run Code Online (Sandbox Code Playgroud)
这可能吗,推荐吗?我注意到,当我这样做时,IOCRestModule的绑定没有被IOCMockRestModule覆盖.我假设我可以在最后添加安装,这可能会工作但不确定这是否会导致以后出现任何问题.
我基本上在从 current_iteration 合并到我的分支的几乎所有文件上遇到冲突。这令人发狂,让许多人惊讶地看着并挠头。
我目前正在使用 git version 使用 mac 2.18.0。我的同行都在研究 Windows git 版本2.12.2.windows.2。
MacBook 配置
macbook-pro:~ chris$ git config -l
credential.helper=osxkeychain
user.email=chris.hinshaw@foo.com
user.name=Chris Hinshaw
user.autocrlf=false
Run Code Online (Sandbox Code Playgroud)
视窗配置
C:> git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Users/…
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.required=true
filter.lfs.process=git-lfs filter-process
credential.helper=manager
merge.tool=kdiff3
mergetool.kdiff3.cmd="C:\\Program Files\\KDiff3\\kdiff3" $BASE $LOCAL $REMOTE -o $MERGED
difftool.kdiff3.path="C:\\Program Files\\KDiff3\\kdiff3"
difftool.kdiff3.keepbackup=false
difftool.kdiff3.trustexitcode=false
alias.lg=!git lg1
alias.lg1=!git lg1-specific --all
alias.lg2=!git lg2-specific --all
alias.lg3=!git lg3-specific --all
alias.lg1-specific=log --graph …Run Code Online (Sandbox Code Playgroud) 我试图按照此处的示例创建一个工厂,以便注入我的 HttpSession。不幸的是,无论我尝试什么,它都不起作用。不确定可能是什么问题。
我尝试仅注入 HttpServletRequest 和提供程序。这是我使用提供商的示例。该错误是尝试在提供方法中访问提供程序时出现空指针异常。如果我尝试注入 HttpServletRequest,则没有可用于注入的对象。我使用 JerseyTest 在 GrizzlyTestContainer 内运行它。为了绑定 HttpServletRequest,我需要添加一些东西到我的活页夹中吗?我似乎找不到例子。
public class HttpSessionFactory implements Factory<HttpSession> {
private final HttpServletRequest request;
@Inject
public HttpSessionFactory(Provider<HttpServletRequest> requestProvider) {
this.request = requestProvider.get();
}
@Override
public HttpSession provide() {
return request.getSession();
}
@Override
public void dispose(HttpSession t) {
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用映射实现线程块,以便一次只能在一个客户上处理一个操作.这是与Web服务的对话,需要多个步骤才能完成整个工作流程.我需要能够一次锁定一个客户,但允许其他线程执行而不会阻止流程.
这是我的测试用例,看看如何让它工作.我所看到的是第二个线程doSynchronizedSomething在第一个线程清除之前无法进入同步块.我认为这应该有效,但它没有按预期工作.
结果如下,您会发现毫秒相距三秒钟.我还检查过以确保CustomerLocks在我的测试用例中它们不是同一个对象.这可能吗?
Starting operation 123456 at time 1381173121688
Done with operation for 123456 at time 1381173124689
Starting operation 234567 at time 1381173124689
Done with operation for 234567 at time 1381173127690
Run Code Online (Sandbox Code Playgroud)
码
package simplethreadlock;
public class CustomerLock {
private String customerId;
public CustomerLock(String customerId) {
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
}
package simplethreadlock;
import java.util.concurrent.ConcurrentHashMap;
public class CustomerLockingMap {
private static ConcurrentHashMap<String, CustomerLock> locks …Run Code Online (Sandbox Code Playgroud) java ×6
git ×2
hk2 ×2
jersey-2.0 ×2
maven ×2
maven-3 ×2
postgresql ×2
git-merge ×1
hadoop ×1
hadoop-yarn ×1
jersey ×1
lettuce ×1
merge ×1
redis ×1
sql ×1