Clojure 通过托盘获取ec2 dns名称
我使用托盘返回ec2节点的列表。我想得到这些的dns名称。我看到jclouds中有一个dnsName方法,但我看不到在clojure中使用托盘时访问该方法的方法。这可能吗 详细信息 我正在尝试对storm deploy项目进行修改,以使用dns名称,从而使安全组能够正常工作。具体来说,我正在尝试编写类似于此函数的代码:Clojure 通过托盘获取ec2 dns名称,clojure,amazon-ec2,jclouds,pallet,Clojure,Amazon Ec2,Jclouds,Pallet,我使用托盘返回ec2节点的列表。我想得到这些的dns名称。我看到jclouds中有一个dnsName方法,但我看不到在clojure中使用托盘时访问该方法的方法。这可能吗 详细信息 我正在尝试对storm deploy项目进行修改,以使用dns名称,从而使安全组能够正常工作。具体来说,我正在尝试编写类似于此函数的代码: (defn zookeeper-dns-names [compute name] (let [running-nodes (filter running? (map
(defn zookeeper-dns-names [compute name]
(let [running-nodes (filter running?
(map (partial jclouds-node->node compute) (nodes-in-group compute (str "zookeeper-" name))))]
(map dns-name running-nodes)))
我在我们的托盘部署器中使用了它,它通过公共ip派生dns名称:
(defn get-aws-name []
(let [ip (-> (target-node) bean :publicAddresses first)]
(str "ec2-" (apply str (replace {\. \-} ip)) ".compute-1.amazonaws.com")))
私人IP也通过安全组工作:
(defn ips-in-group [group-name public-or-private]
"Sequence of the first public IP from each node in the group"
(->> (nodes-in-group group-name)
(map bean)
(map public-or-private)
(map first))
(defn public-ips-in-group
"Sequence of the first public IP from each node in the group"
[group-name]
(ips-in-group group-name :publicAddresses))
(defn private-ips-in-group
"Sequence of the first public IP from each node in the group"
[group-name]
(ips-in-group group-name :privateAddresses))
0.7,尽管查看文档,0.8中似乎不支持此功能,但文档中还没有此功能。我的答案是0.8版(我还没有在0.7版中测试过)。0.8版的测试版已经可以日常使用了。谢谢。我最终用私有ips方法解决了这个问题。