ラベル ツール の投稿を表示しています。 すべての投稿を表示
ラベル ツール の投稿を表示しています。 すべての投稿を表示

2016年5月22日日曜日

IDCFクラウドをAPIから使う(VM作成編)

このエントリーをはてなブックマークに追加
IDCFクラウドをAPIから使う(準備編)でCLIから使えるようにしたので簡単にサクっと作ってみた。

IDCFクラウド API Referencesを見たけど、利用できるAPIは限られているけど普段使いにはあまり問題はなさそう。(英語のままのもあるけど)

とりあえずSSHの認証鍵を生成して、
$ssh-keygen -t rsa
クラウドにアップロードする。
$ cloudstack-api registerSSHKeyPair --name idcf --publickey "$(cat .ssh/生成した公開鍵)" -t
SSH公開鍵がアップロードされたのは、クラウドコンソールで確認してもいいしCLIで確認してもいい。今回はCLIからやってみる。
$ cloudstack-api listSSHKeyPairs -t
+-------------------------------------------------+------------+
|                   fingerprint                   |    name    |
+-------------------------------------------------+------------+
| 31:8a:93:ff:c3:12:8a:ae:19:**:**:**:**:**:**:** | idcf |
+-------------------------------------------------+------------+
マシン生成する。今回作るサーバプランは一番安いlight.S1にしておく。OSはCentOS7.1を選ぶ。念のためサーバプランとOSテンプレートのid確認方法をもう一度。
$ cloudstack-api listServiceOfferings -t id,displaytext
+--------------------------------------+------------------------------------+
|                  id                  |            displaytext             |
+--------------------------------------+------------------------------------+
| 10d303d6-d39f-4b15-80a1-982e86ef002b | highio.3XL128( 24CPU /128GB RAM)   |
| 12e39b73-3ce6-4e57-9036-3dac0c2b2b06 | highmem.M16( 2CPU / 16GB RAM )     |
| 354c62e6-b99b-42f2-b5c7-e741f1085422 | standard.XL32( 8CPU / 32 GB RAM )  |
| 435c1aab-e796-42c7-9320-22ebdc8f50aa | highcpu.L8( 4CPU / 8GB RAM )       |
| 55621f17-4d38-457c-ba34-e6199701b67b | standard.S4( 1CPU / 4GB RAM )      |
| 6a99ff4c-1a24-4aa6-b4cc-600220987ed0 | standard.L16( 4CPU / 16GB RAM )    |
| 6fda5e0c-e64d-46ea-893d-7e2ac9e128e7 | highcpu.XL16 ( 8CPU / 16GB RAM )   |
| 7ae143a6-5662-4f1d-bc4c-10defa775bcb | standard.M8( 2CPU / 8GB RAM )      |
| 7c548831-427b-437c-9c8b-80dde8031303 | highcpu.2XL32( 16 CPU / 32GB RAM ) |
| 8cf15770-c3c8-4efc-8ae5-b8327790db76 | highcpu.M4( 2CPU / 4GB RAM )       |
| 95edba75-7cb5-4654-a2f5-f40b7acf7a57 | standard.S8( 1CPU / 8GB RAM )      |
| 9a2f3ee4-af46-4790-9331-753674c16e68 | highio.5XL128( 40CPU /128GB RAM)   |
| d1aac6d2-bb47-4106-90d0-6a73ac3ae78e | light.S2( 1CPU / 2GB RAM )         |
| d59817bc-ed79-4083-8b71-51b26c76d311 | highmem.L32( 4CPU / 32GB RAM )     |
| e01a9f32-55c4-4c0d-9b7c-d49a3ccfd3f6 | light.S1( 1CPU / 1GB RAM )         |
| ec13a7d8-26ce-4c4e-a223-7ef832bb1243 | light.S2( 1CPU / 2GB RAM )         |
| ee5ee568-76b2-46ad-9221-c695e6f2149d | highmem.XL64( 8CPU / 64GB RAM )    |
+--------------------------------------+------------------------------------+
$ cloudstack-api listTemplates --templatefilter executable -t name,id | grep Cent | grep "7\.1"
| CentOS 7.1 64-bit                                   | ee7bc439-0186-49b4-82e4-bf821db89601 |
| CentOS 7.1 64-bit                                   | ee7bc439-0186-49b4-82e4-bf821db89601 |
| CentOS 7.1 64-bit                                   | ee7bc439-0186-49b4-82e4-bf821db89601 |
| CentOS 7.1 64-bit                                   | ee7bc439-0186-49b4-82e4-bf821db89601 |
| CentOS 7.1 64-bit                                   | ee7bc439-0186-49b4-82e4-bf821db89601 |
| CentOS 7.1 64-bit for Vagrant                       | aa39af2c-a91e-4c7d-8bf1-4e4754959b11 |
| CentOS 7.1 64-bit for Vagrant                       | aa39af2c-a91e-4c7d-8bf1-4e4754959b11 |
| CentOS 7.1 64-bit for Vagrant                       | aa39af2c-a91e-4c7d-8bf1-4e4754959b11 |
| CentOS 7.1 64-bit for Vagrant                       | aa39af2c-a91e-4c7d-8bf1-4e4754959b11 |
| CentOS 7.1 64-bit for Vagrant                       | aa39af2c-a91e-4c7d-8bf1-4e4754959b11 |
| Hatohol 15.06 on CentOS 7.1                         | eedabe07-5f0e-4822-b9d9-6bbb4a04de85 |
| Hatohol 15.06 on CentOS 7.1                         | eedabe07-5f0e-4822-b9d9-6bbb4a04de85 |
| Hatohol 15.06 on CentOS 7.1                         | eedabe07-5f0e-4822-b9d9-6bbb4a04de85 |
| Hatohol 15.06 on CentOS 7.1                         | eedabe07-5f0e-4822-b9d9-6bbb4a04de85 |
| MIRACLE ZBX 2.2.11 on CentOS 7.1                    | 9cf7a110-caaa-4ae5-807c-218c80c88f31 |
| MIRACLE ZBX 2.2.11 on CentOS 7.1                    | 9cf7a110-caaa-4ae5-807c-218c80c88f31 |
| MIRACLE ZBX 2.2.11 on CentOS 7.1                    | 9cf7a110-caaa-4ae5-807c-218c80c88f31 |
| MIRACLE ZBX 2.2.11 on CentOS 7.1                    | 9cf7a110-caaa-4ae5-807c-218c80c88f31 |
テンプレートは同じのが表示されるが気にせず、このidを使おう。ZoneIDはクラウドコンソールの「ゾーン管理」から「有効」になっているものを使う。僕の場合はradianだった。group、displayname、nameはお好みで。
$ cloudstack-api deployVirtualMachine --serviceofferingid e01a9f32-55c4-4c0d-9b7c-d49a3ccfd3f6 --templateid ee7bc439-0186-49b4-82e4-bf821db89601 --zoneid a53ff3d3-042b-4cbd-ad16-494bb8d33e06 --group highmountain --displayname highmountain --name highmountain --keypair keypairname
正常に終わるとJSON形式でidとjobidが返ってきた。
{
  "deployvirtualmachineresponse": {
    "id": "...",
    "jobid": "..."
  }
}
この後クラウドコンソールから確認すると仮想マシンがRunning状態でできていた。
コマンドからも確認してみる。
$ cloudstack-api listVirtualMachines -t

ここでインターネットから接続するためにPublicIPを確認する。
$ cloudstack-api listPublicIpAddresses -t id,ipaddress
+--------------------------------------+---------------+
|                  id                  |   ipaddress   |
+--------------------------------------+---------------+
| 205e7e75-aae1-4de9-a1fe-b79e4947a715 | xxx.xxx.xxx.xxx |
+--------------------------------------+---------------+
ソースIPはNATできないのでポートフォワードの設定をする。今回はSSH。
$ cloudstack-api createPortForwardingRule --ipaddressid 205e7e75-aae1-4de9-a1fe-b79e4947a715 --privateport 22 --protocol TCP --publicport 22 --virtualmachineid f3991f90-0962-4948-a965-508c013700c6
クラウドコンソールからも確認できるが、これもコマンドから確認できる。
$  cloudstack-api listPortForwardingRules -t
ここでSSHしてみるとログインできる!
$ ssh root@xxx.xxx.xxx.xxx -i ~/.ssh/PrivateKey
    ________  ______   ______                 __  _
   /  _/ __ \/ ____/  / ____/________  ____  / /_(_)__  _____
   / // / / / /      / /_  / ___/ __ \/ __ \/ __/ / _ \/ ___/
 _/ // /_/ / /___   / __/ / /  / /_/ / / / / /_/ /  __/ /
/___/_____/\____/  /_/   /_/   \____/_/ /_/\__/_/\___/_/

[root@hostname ~]#

2016年5月7日土曜日

Bash on Ubuntu on Windowsのnetwork周りはまだまだだった(build14332)

このエントリーをはてなブックマークに追加
Bash on Ubuntu on Windowsを触ってみたんだけど、どの程度までできるものなのかApacheをコンパイルして起動させてみるとこまでやってみたいと思う。

Bash on Ubuntu on Windows10を試すの時はPowerShellから起動して...みたいなことを書いていたけども、スタートメニューにBash on Ubuntu on Windowsってのが増えてたので、こちらから起動する。


開けたらこんな感じ。ディレクトリもLinuxになってる。rootも可。


IP調べようと思ったらifconfigでエラーが出た。

$ ifconfig
Warning: cannot open /proc/net/dev (No such file or directory). Limited output.

一応、networkをスタートしてみたもののエラーが出た。

$ /etc/init.d/networking start
 * Configuring network interfaces...                                                                                    resolvconf: Error: /run/resolvconf/interface either does not exist or is not a directory
resolvconf: Error: /run/resolvconf/interface either does not exist or is not a directory
../../../../lib/isc/unix/socket.c:2379: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
../../../../lib/isc/unix/socket.c:2379: setsockopt(21, SO_TIMESTAMP) failed: Invalid argument
../../../../lib/isc/unix/socket.c:2408: setsockopt(21, IPV6_RECVPKTINFO) failed: Invalid argument
../../../../lib/isc/unix/socket.c:5678: setsockopt(21, IPV6_V6ONLY) failed: Invalid argument

そこで同じようなエラーが出てる人がいて解決できたよってあるので参考にしてみた。

名前解決できないからDNSをGoogleDNSに向けてねってあったので向けてみた。

search web.setting
#nameserver 192.168.128.1
#nameserver 192.168.128.1
#nameserver 192.168.2.1
nameserver 8.8.8.8
nameserver 8.8.4.4

さてもう一度networkをstartした結果。

$ /etc/init.d/networking start
 * Configuring network interfaces...                                                                                    ../../../../lib/isc/unix/socket.c:2379: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
../../../../lib/isc/unix/socket.c:2379: setsockopt(21, SO_TIMESTAMP) failed: Invalid argument
../../../../lib/isc/unix/socket.c:2408: setsockopt(21, IPV6_RECVPKTINFO) failed: Invalid argument
../../../../lib/isc/unix/socket.c:5678: setsockopt(21, IPV6_V6ONLY) failed: Invalid argument
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Error getting interfaces; Invalid argument
Can't get list of interfaces.
Failed to bring up eth0.

resolveconfのエラーは出なくなったけどsocketのエラーはそのまま。

BashのMSDNにあるFrequently Asked Questionsには
Why isn't ICMP working?

This is a known issues that will effect several networking commands such as ping. Stay tuned for updates.
(pingみたいなnetwork周りのコマンドは問題あること分かってるからupdateを待っててね)
とあるので、少し待ち。

ちなみにUbuntu on Windowsのウィンドウを閉じると、今の時点ではさっきのresolve.confへの変更は取り消されます。

手元のbuildは14332だけどrelease noteをみるとresolve.confをマシにしたとあるので、こまめにアップデートして確認できればいいかな。

まだ問題はあるけどプロダクトとしては非常に面白い。VirtualBoxやVMwareを使わずに手軽に動かせる環境として使えそう。

2016年5月6日金曜日

Chrome ExtensionでSSH

このエントリーをはてなブックマークに追加
chromeでSSHぐらいできる拡張機能あるんじゃないかと思い探してみたらあった。

Secure Shell


インストールしてSSHをブラウザからお手軽に使える!



PC問わず、chromeさえインストールしていれば使えるというのはあって困らない選択肢だと思うので、避難手段として入れておくのはアリだと思いました。


2016年4月18日月曜日

Apache Incubater(2016)をさらっと見てみた

このエントリーをはてなブックマークに追加
今後の流れみたいなのが見えるかなと思い、Apache Incubatorを年に1回ぐらいはチェックしてます。

#正直、ピンキリの世界なので、あくまで概要だけでもさらっと読んで流す程度ですけどね。

ちょっと前まではNoSQLの流行からかDB系のものが多かった気がするのですが、今はわりとカオスな状況な感じがします。あと夢で終わりそうなのもちらほら。

この中から今年Graduateするのはいくつ出るのでしょうね。


Airflow is a workflow automation and scheduling system that can be used to author and manage data pipelines.
Apex is an enterprise grade native YARN big data-in-motion platform that unifies stream processing as well as batch processing.
Apache AsterixDB is a scalable big data management system (BDMS) that provides storage, management, and query capabilities for large collections of semi-structured data.
Apache Atlas is a scalable and extensible set of core foundational governance services that enables enterprises to effectively and efficiently meet their compliance requirements within Hadoop and allows integration with the complete enterprise data ecosystem
BatchEE projects aims to provide a JBatch implementation (aka JSR352) and a set of useful extensions for this specification.
Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow (a cloud service). Beam also brings DSL in different languages, allowing users to easily implement their data integration processes.
Blur is a search platform capable of searching massive amounts of data in a cloud computing environment.
CMDA provides web services for multi-aspect physics-based and phenomenon-oriented climate model performance evaluation and diagnosis through the comprehensive and synergistic use of multiple observational data, reanalysis data, and model outputs.
Commons RDF is a set of interfaces and classes for RDF 1.1 concepts and behaviours. The commons-rdf-api module defines interfaces and testing harness. The commons-rdf-simple module provides a basic reference implementation to exercise the test harness and clarify API contracts.
Apache Concerted is a Do-It-Yourself toolkit for building in-memory data engines.
DataFu provides a collection of Hadoop MapReduce jobs and functions in higher level languages based on it to perform data analysis. It provides functions for common statistics tasks (e.g. quantiles, sampling), PageRank, stream sessionization, and set and bag operations. DataFu also provides Hadoop jobs for incremental data processing in MapReduce.
Eagle is a Monitoring solution for Hadoop to instantly identify access to sensitive data, recognize attacks, malicious activities and take actions in real time.
Fineract is an open source system for core banking as a platform.
FreeMarker is a template engine, i.e. a generic tool to generate text output based on templates. FreeMarker is implemented in Java as a class library for programmers.
Gearpump is a reactive real-time streaming engine based on the micro-service Actor model.
Geode is a data management platform that provides real-time, consistent access to data-intensive applications throughout widely distributed cloud architectures.
Guacamole is an enterprise-grade, protocol-agnostic, remote desktop gateway. Combined with cloud hosting, Guacamole provides an excellent alternative to traditional desktops. Guacamole aims to make cloud-hosted desktop access preferable to traditional, local access.
HAWQ is an advanced enterprise SQL on Hadoop analytic engine built around a robust and high-performance massively-parallel processing (MPP) SQL framework evolved from Pivotal Greenplum Database.
HORN is a neuron-centric programming APIs and execution framework for large-scale deep learning, built on top of Apache Hama.
HTrace is a tracing framework intended for use with distributed systems written in java.
Impala is a high-performance C++ and Java SQL query engine for data stored in Apache Hadoop-based clusters.
Open source system that enables the orchestration of IoT devices.
Implementation of JSR-353 JavaTM API for JSON Processing (Renamed from Fleece)
Joshua is a statistical machine translation toolkit
Kudu is a distributed columnar storage engine built for the Apache Hadoop ecosystem.
Logging for C++
Big Data Machine Learning in SQL for Data Scientists.
Metron is a project dedicated to providing an extensible and scalable advanced network security analytics tool. It has strong foundations in the Apache Hadoop ecosystem.
Distributed Cryptography; M-Pin protocol for Identity and Trust
Mnemonic is a Java based non-volatile memory library for in-place structured data processing and computing.
MRQL is a query processing and optimization system for large-scale, distributed data analysis, built on top of Apache Hadoop, Hama, Spark, and Flink.
Mynewt is a real-time operating system for constrained embedded systems like wearables, lightbulbs, locks and doorbells. It works on a variety of 32-bit MCUs (microcontrollers), including ARM Cortex-M and MIPS architectures.
Myriad enables co-existence of Apache Hadoop YARN and Apache Mesos together on the same cluster and allows dynamic resource allocations across both Hadoop and other applications running on the same physical data center infrastructure.
Java modules that allow programmatic creation, scanning and manipulation of OpenDocument Format (ISO/IEC 26300 == ODF) documents
Omid is a flexible, reliable, high performant and scalable ACID transactional framework that allows client applications to execute transactions on top of MVCC key/value-based NoSQL datastores (currently Apache HBase) providing Snapshot Isolation guarantees on the accessed data.
Tools and libraries for developing Attribute-based Access Control (ABAC) Systems in a variety of languages.
Quarks is a stream processing programming model and lightweight runtime to execute analytics at devices on the edge or at the gateway.
Quickstep is a high-performance database engine.
The Ranger project is a framework to enable, monitor and manage comprehensive data security across the Hadoop platform.
Rya (pronounced "ree-uh" /rēə/) is a cloud-based RDF triple store that supports SPARQL queries. Rya is a scalable RDF data management system built on top of Accumulo. Rya uses novel storage methods, indexing schemes, and query processing techniques that scale to billions of triples across multiple nodes. Rya provides fast and easy access to the data through SPARQL, a conventional query mechanism for RDF data.
S2Graph is a distributed and scalable OLTP graph database built on Apache HBase to support fast traversal of extremely large graphs.
SAMOA provides a collection of distributed streaming algorithms for the most common data mining and machine learning tasks such as classification, clustering, and regression, as well as programming abstractions to develop new algorithms that run on top of distributed stream processing engines (DSPEs). It features a pluggable architecture that allows it to run on several DSPEs such as Apache Storm, Apache S4, and Apache Samza.
Singa is a distributed deep learning platform.
Monitoring Solution.
Slider is a collection of tools and technologies to package, deploy, and manage long running applications on Apache Hadoop YARN clusters.
Apache Streams is a lightweight server for ActivityStreams.
SystemML provides declarative large-scale machine learning (ML) that aims at flexible specification of ML algorithms and automatic generation of hybrid runtime plans ranging from single node, in-memory computations, to distributed computations such as Apache Hadoop MapReduce and Apache Spark.
Tamaya is a highly flexible configuration solution based on an modular, extensible and injectable key/value based design, which should provide a minimal but extendible modern and functional API leveraging SE, ME and EE environments.
Taverna is a domain-independent suite of tools used to design and execute data-driven workflows.
Tephra is a system for providing globally consistent transactions on top of Apache HBase and other storage engines.
TinkerPop is a graph computing framework written in Java
Toree provides applications with a mechanism to interactively and remotely access Apache Spark.
Trafodion is a webscale SQL-on-Hadoop solution enabling transactional or operational workloads on Hadoop.
Twill is an abstraction over Apache Hadoop YARN that reduces the complexity of developing distributed applications, allowing developers to focus more on their business logic
Unomi is a reference implementation of the OASIS Context Server specification currently being worked on by the OASIS Context Server Technical Committee. It provides a high-performance user profile and event tracking server.
A wave is a hosted, live, concurrent data structure for rich communication. It can be used like email, chat, or a document.
A collaborative data analytics and visualization tool for distributed, general-purpose data processing systems such as Apache Spark, Apache Flink, etc.

2016年4月11日月曜日

Windows10で使えるいいターミナルソフトがないか探してTerminalを捨て結局Rlginを選んだ

このエントリーをはてなブックマークに追加
Windows10で使えるいいターミナルソフトがないか探してTerminalsを選んだを書いたんだけど、割と見掛け倒しでしょぼかったので今度こそは思って選んだのがRloginというもの。

割と多機能なようでポートフォワードも対応してるし、スクリプトもかけるらしいのでこれにした。

#自分的にはリモートデスクトップをSSH Tunnelで接続したりしてるのでポートフォワード超重要。

SSHはTerminalの際に出たdiffie-hellman-group1-sha1問題も無く普通に接続できた。なんだよ。やっぱり普通にできるじゃねーか。


さてポートフォワードの出番だ。これが使いたい。

「ファイル」→「サーバに接続」を選択し、「新規」を選択すると下記のような画面になる。

「プロトコル」から「ssh」を選択し、リモートサーバのIPアドレス、アカウントとパスワードを入力する。


左側のメニューから「プロトコル」を選択し、下にある「ポートフォワード」を押す。


「新規」を押し、


Listenするポートと接続に利用するポートを入力する。


このようにリモートに接続できたことを確認したら、


「リモートデスクトップ接続」を開いて接続すると、


Windowsファイアウォールが通信を許可するか聞いてくるので「はい」を選択するとRDPで接続ができる。


これでいいじゃん!