Weitere ähnliche Inhalte
Ähnlich wie NTTコミュニケーションズ Cloudn勉強会資料 SDKでAPIをたたいてみよう (20)
Kürzlich hochgeladen (11)
NTTコミュニケーションズ Cloudn勉強会資料 SDKでAPIをたたいてみよう
- 2. 自己紹介
大削 緑/Midori Oge
みろりん @star76popin
☆某SI会社 → 某通信事業者 → NTTコミュニケーションズで
の開発を担当しています
☆こんな記事を書いてます
オープンソースの「クラウド基盤ソフトウェア」を比較する【第1回】
機能を徹底比較! ∼Eucalyptus、CloudStack、OpenStack
オープンソースの「クラウド基盤ソフトウェア」を比較する【第2回】
【徹底比較】Eucalyptus、CloudStack、OpenStackの仮想マシン性能
☆いろんなユーザ会にいます
- 6. APIってめんどくさい?
(3)(2)の中身だけをURLエンコードする
$ echo 'deployVirtualMachine' | perl -MURI::Escape -lne 'print uri_escape($_)'
deployVirtualMachine
$ echo '8b4d9a30-91c2-47fc-92da-ea9cc97c0cad' | perl -MURI::Escape -lne 'print uri_escape($_)'
8b4d9a30-91c2-47fc-92da-ea9cc97c0cad
$ echo 'c5ec872b-d278-11e2-8039-4ce6766f4f75' | perl -MURI::Escape -lne 'print uri_escape($_)'
c5ec872b-d278-11e2-8039-4ce6766f4f75
$ echo '0d89362f-b68f-4fb8-a619-a9a481882a05' | perl -MURI::Escape -lne 'print uri_escape($_)'
0d89362f-b68f-4fb8-a619-a9a481882a05
$ echo 'Server1' | perl -MURI::Escape -lne 'print uri_escape($_)'
Server1
$ echo
'cmqDKrrSc6kFhGhvhUGLhxX_lSHNWPU8JFjDd_rxEia4ZjBva39xaQP0CVmlha7AnAfG0ySe3WacSEsa4kdbbw' |
perl -MURI::Escape -lne 'print uri_escape($_)'
cmqDKrrSc6kFhGhvhUGLhxX_lSHNWPU8JFjDd_rxEia4ZjBva39xaQP0CVmlha7AnAfG0ySe3WacSEsa4kdbbw
(4)コマンドのアルファベット順で並び替える
apikey=cmqDKrrSc6kFhGhvhUGLhxX_lSHNWPU8JFjDd_rxEia4ZjBva39xaQP0CVmlha7AnAfG0ySe3WacSEsa4kd
bbw&command=deployVirtualMachine&displayname=Server1&serviceofferingid=8b4d9a30-91c2-47fc-92
da-ea9cc97c0cad&templateid=c5ec872b-d278-11e2-8039-4ce6766f4f75&zoneid=0d89362f-b68f-4fb8-
a619-a9a481882a05
- 11. AWS SDKを使います
ソフトウェア開発キット(ソフトウェアかいはつキット、英語: Software
Development Kit、SDK)は一般に、特定のソフトウェアパッケージ、ソフトウェア
フレームワーク、ハードウェアプラットフォーム、コンピュータシステム、ゲーム
機、オペレーティングシステムなどのためのアプリケーションを作成するためにソ
フトウェア技術者が使用する開発ツールのセットを意味する。
ウィキペディア (Wikipedia): フリー百科事典
「ソフトウェア開発キット」 より
★AWS SDK
AWSのAPIを簡単に呼び出すための専用プログラム
AWSが配布
(Java,PHP他、
お客さま環境にあわせ
て言語を選択できる)
SDKってなぁに?
- 18. 1.ツールの環境を用意しよう
(2)作業用ディレクトリの作成
[CentOS]
$ yum search openjdk-devel
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
$ sudo yum install java-1.7.0-openjdk-devel
$ java -version
[Ubuntu]
$ apt-cache show openjdk-7-jdk
Version: 7u21-2.3.9-0ubuntu0.12.10.1
$ sudo apt-get install openjdk-7-jdk
$ java -version
(1)JDKのインストール
$ mkdir cloudn
$ cd cloudn
ver1.7の方をインストールして下さい
ここでは「/home/pyonkey/cloudn」を作業ディレクトリとします
- 20. $ cd ~/cloudn/httpcomponents-client-4.2.5/lib
$ cp httpclient-4.2.5.jar httpcore-4.2.4.jar commons-logging-1.1.1.jar
commons-codec-1.6.jar ~/cloudn/CloudnAPI/
(6)httpclientのjarファイルを作業ディレクトリにコピー
1.ツールの環境を用意しよう
$ cd ~/cloudn/aws-java-sdk-1.3.21.1/lib/
$ cp aws-java-sdk-1.3.21.1.jar aws-java-sdk-flow-build-tools-1.3.21.1.jar
~/cloudn/CloudnAPI/
(7)AWS SDKのjarファイルを作業ディレクトリにコピー
- 24. $ java CloudnAPIService
=== Start ===[2013/06/21 15:20:06]
> Which Service ? (Compute / LBA / ObjectStorage / AutoScaling / DNS /
Monitoring / Exit) :
Exit
Service =[Exit]
=== End ===[2013/06/21 15:21:24]
(12)ツールを実行してみる
わーいうごいた
1.ツールの環境を用意しよう
- 29. $ java CloudnAPIService
=== Start ===[2013/06/21 11:37:44]
> Which Service ? (Compute / LBA / ObjectStorage / AutoScaling / DNS / Monitoring /
Exit) :
Compute
Service =[Compute]
URL =[https://comp-apia.jp-e1.cloudn-service.com/awsapi/]
=== Start:CloudnAPICompute:publicMain ===[2013/06/21 11:38:24]
> Which Command ? (Describe / Create / Start / Stop / Delete / CreateTemplate /
CreateTag / Exit) :
Create
Command =[Create]
(2)仮想マシンの作成
「Create」と入力
2.仮想マシンを作ってみよう
「Compute」と入力
- 30. DescribeZonesResult:
{AvailabilityZones: [
{ZoneName: jp-e1a, State: available, RegionName: , Messages: [{Message:
Enabled, }], },
{ZoneName: jp-e1b, State: available, RegionName: , Messages: [{Message:
Enabled, }], }], }
> Enter Zone Name :
jp-e1a
Availability Zone =[jp-e1a]
DescribeSecGroupsResult:
{SecurityGroups: [{OwnerId: ff02929c-1819-4b93-95be-8f251564b83c:cln100050095,
GroupName: pyonkey-secgroup, GroupId: 8a0dba8f-7afc-436b-878a-ab7dce6e2bf6,
Description: for SDK test, IpPermissions: [
{IpProtocol: tcp, FromPort: 22, ToPort: 22, IpRanges: [0.0.0.0/0], },
{IpProtocol: tcp, FromPort: 80, ToPort: 80, IpRanges: [0.0.0.0/0], }], VpcId:,
Tags: [{Key: , Value: , }], }], }
> Enter Security Group ID :
8a0dba8f-7afc-436b-878a-ab7dce6e2bf6
Security Group ID =[8a0dba8f-7afc-436b-878a-ab7dce6e2bf6]
(2)仮想マシンの作成
作成したセキュリティグループのIDを入力
2.仮想マシンを作ってみよう
仮想マシンを作成したい方のゾーン名を入力
- 31. {Images: [{ImageId: 8fdc326b-6e82-49a3-af22-69b0e3ab0cd7, ImageLocation: ,
State: available, OwnerId: 1:admin, Public: true, ProductCodes:
[{ProductCodeId: , ProductCodeType: , }], Architecture: , ImageType: machine,
KernelId: , RamdiskId: , Platform: , StateReason: {Code: , Message: , },
ImageOwnerAlias: , Name: CentOS 6.3 64bit, Description: CentOS 6.3 64bit,
RootDeviceType: , RootDeviceName: , BlockDeviceMappings: [{DeviceName: , Ebs:
{SnapshotId: , VolumeSize: 0, DeleteOnTermination: false, }, }], Tags: [{Key:
, Value: , }], Hypervisor: , }], }
> Enter Image ID :
8fdc326b-6e82-49a3-af22-69b0e3ab0cd7
Image ID =[8abc326b-6e82-49a3-af22-69b0e3ab0cd7]
(2)仮想マシンの作成
Image IDを入力
2.仮想マシンを作ってみよう
- 32. > Enter Create Instance Type (t1.micro / m1.small / m1.medium / m1.large /
m1.xlarge) :
m1.small
Instance Type =[m1.small]
> Enter Minimum Count:
2
Minimum Count =[2]
> Enter Maximum Count:
2
Maximum Count =[2]
RunInstancesRequest:
{ImageId: 8fdc326b-6e82-49a3-af22-69b0e3ab0cd7, MinCount: 2, MaxCount: 2,
SecurityGroupIds: [8a0dba8f-7afc-436b-878a-ab7dce6e2bf6], InstanceType:
m1.small, Placement: {AvailabilityZone: jp-e1a, }, }
Instance Create Start =[2013/06/21 12:35:33]
(2)仮想マシンの作成
仮想マシンのタイプを入力
2台作成するため「2」を入力
2台作成するためß「2」を入力
仮想マシン作成開始
2.仮想マシンを作ってみよう
- 33. Instance Create Finish =[2013/06/21 12:37:49]
RunInstancesResult:
{Reservation: {ReservationId: , OwnerId:
ff02929c-1819-4b93-95be-8f251564b83c:cln100050095, RequesterId: , Groups:
[{GroupName: pyonkey-secgroup, GroupId: 8a0dba8f-7afc-436b-878a-
ab7dce6e2bf6, }], GroupNames: [pyonkey-secgroup], Instances: [{InstanceId:
3030d851-1f30-4447-b17b-de44f113b439, ImageId: 8fdc326b-6e82-49a3-
af22-69b0e3ab0cd7, State: {Code: 16, Name: running, }, PrivateDnsName: ,
PublicDnsName: , StateTransitionReason: , ProductCodes: [{ProductCodeId: ,
ProductCodeType: , }], InstanceType: m1.small, Placement: {AvailabilityZone:
jp-e1a, }, KernelId: , RamdiskId: , Platform: , Monitoring: {State: , },
SubnetId: , VpcId: , PrivateIpAddress: 153.128.37.234, StateReason: {Code: ,
Message: , }, Architecture: , RootDeviceType: , RootDeviceName: ,
VirtualizationType: , InstanceLifecycle: , SpotInstanceRequestId: ,
ClientToken: , Tags: [{Key: , Value: , }], SecurityGroups: [{GroupName: ,
GroupId: , }], Hypervisor: , }, {InstanceId:
46161e43-4388-4039-9182-7d59487b2830, ImageId: 8fdc326b-6e82-49a3-
af22-69b0e3ab0cd7, State: {Code: 16, Name: running, }, PrivateDnsName: ,
PublicDnsName: , StateTransitionReason: , ProductCodes: [{ProductCodeId: ,
ProductCodeType: , }], InstanceType: (略)
(2)仮想マシンの作成
仮想マシン作成完了
2.仮想マシンを作ってみよう
作成されたInstanceIDとIPアドレスを控えておく
- 34. > Which Command ? (Describe / Create / Start / Stop / Delete /
CreateTemplate / CreateTag / Exit) :
Describe
Command =[Describe]
(略)
DescribeInstancesResult:
{Reservations: [{ReservationId: 546695f6-52b2-4980-8ecd-38c3f2de0726, OwnerId:
ff02929c-1819-4b93-95be-8f251564b83c:cln100050095, RequesterId: , Groups:
[{GroupName: pyonkey-secgroup, GroupId: 8a0dba8f-7afc-436b-878a-
ab7dce6e2bf6, }], GroupNames: [pyonkey-secgroup], Instances: [ (略)
{InstanceId: 3030d851-1f30-4447-b17b-de44f113b439, ImageId:
8fdc326b-6e82-49a3-af22-69b0e3ab0cd7, State: {Code: 16, Name: running, },
PrivateDnsName: , PublicDnsName: , StateTransitionReason: , ProductCodes:
[{ProductCodeId: , ProductCodeType: , }], InstanceType: m1.small, Placement:
{AvailabilityZone: jp-e1a, GroupName: , }, KernelId: , RamdiskId: ,
Platform: , Monitoring: {State: , }, SubnetId: , VpcId: , PrivateIpAddress:
153.128.38.229, StateReason: {Code: , Message: , }, Architecture: ,
RootDeviceType: , RootDeviceName: 0, InstanceLifecycle: ,
SpotInstanceRequestId: , Tags: [{Key: , Value: , }], SecurityGroups:
[{GroupName: , }], Hypervisor: , (略) }], }], }
「Describe」を入力
2.仮想マシンを作ってみよう
(2)仮想マシンの作成(確認)
- 37. 3.Webサイトを立ち上げてみよう
[CentOS]
# yum install httpd.x86_64
# service httpd start
Starting httpd: [ OK ]
[Ubuntu]
$ sudo apt-get install apache2
$ cd /etc/apache2/sites-available
$ vi forsdktest
$ sudo a2dissite default
$ sudo a2ensite forsdktest
$ sudo service apache2 reload
Apacheのインストール
<Virtualhost *:80>
DocumentRoot /home/pyonkey
<Directory /home/pyonkey>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
- 40. 4.LBを作ってみよう
$ java CloudnAPIService
=== Start ===[2013/06/21 09:04:01]
> Which Service ? (Compute / LBA / ObjectStorage / AutoScaling / DNS /
Monitoring / Exit) :
LBA
Service =[LBA]
URL =[https://lba-api.jp-e1.cloudn-service.com/]
URL =[https://comp-apia.jp-e1.cloudn-service.com/awsapi/]
=== Start:CloudnAPILBA:publicMain ===[2013/06/21 09:05:31]
> Which Command ? (Describe / Create / Delete / RegisterInstance /
CreateListener / DefineHealth / HealthCheck / Exit) :
Create
Command =[Create]
> Enter Create LBA Name :
pyonkeyLBA
Create LBA Name =[pyonkeyLBA]
「LBA」を入力
「Create」を入力
LBAの名前を入力
LBの作成
- 41. 4.LBを作ってみよう
DescribeZonesResult:
{AvailabilityZones: [
{ZoneName: jp-e1a, State: available, RegionName: , Messages: [{Message:
Enabled, }], },
{ZoneName: jp-e1b, State: available, RegionName: , Messages: [{Message:
Enabled, }], }], }
> Enter Zone Name :
jp-e1a
Availability Zone =[jp-e1a]
DescribeSecGroupsResult:
{SecurityGroups: [{OwnerId: ff02929c-1819-4b93-95be-8f251564b83c:cln100050095,
GroupName: pyonkey-secgroup, GroupId: 8a0dba8f-7afc-436b-878a-ab7dce6e2bf6,
Description: for SDK test, IpPermissions: [
{IpProtocol: tcp, FromPort: 22, ToPort: 22, IpRanges: [0.0.0.0/0], },
{IpProtocol: tcp, FromPort: 80, ToPort: 80, IpRanges: [0.0.0.0/0], }], VpcId:,
Tags: [{Key: , Value: , }], }], }
> Enter Security Group ID :
8a0dba8f-7afc-436b-878a-ab7dce6e2bf6
Security Group ID =[8a0dba8f-7afc-436b-878a-ab7dce6e2bf6]
LBAを作成したい方のゾーン名を入力
LBAにSecurityGroupを設定
LBの作成
- 42. 4.LBを作ってみよう
> Enter LBA Protocol (HTTP / HTTPS / TCP / SSL) :
HTTP
LBA Protocol =[HTTP]
> Enter LBA Port :
80
LBA Port =[80]
> Enter Instance Protocol (HTTP / HTTPS / TCP / SSL) :
HTTP
Instance Protocol =[HTTP]
> Enter Instance Port :
80
Instance Port =[80]
CreateLoadBalancerRequest:
{LoadBalancerName: pyonkeyLBA, Listeners: [{Protocol: HTTP, LoadBalancerPort:
80, InstanceProtocol: HTTP, InstancePort: 80, }], AvailabilityZones: [jp-e1a],
SecurityGroups: [8a0dba8f-7afc-436b-878a-ab7dce6e2bf6], }
CreateLoadBalancerResult:
{DNSName: pyonkeyLBA-1371897092.lba.jp-e1.cloudn-service.com, }
LBの80番ポートにきたHTTPリクエストを
仮想マシンの80番ポートに転送
LBの作成
DNSName が返ってくるのでメモしておく
- 43. 4.LBを作ってみよう
> Which Command ? (Describe / Create / Delete / RegisterInstance /
CreateListener / DefineHealth / HealthCheck / Exit) :
Describe
Command =[Describe]
DescribeLoadBalancersResult:
{LoadBalancerDescriptions: [
{LoadBalancerName: pyonkeyLBA, DNSName: pyonkeyLBA-1371897092.lba.jp-
e1.cloudn-service.com, CanonicalHostedZoneName: pyonkeyLBA-1371897092.lba.jp-
e1.cloudn-service.com, CanonicalHostedZoneNameID: BBB1874A1E3A46,
ListenerDescriptions: [{Listener: {Protocol: HTTP, LoadBalancerPort: 80,
InstanceProtocol: HTTP, InstancePort: 80, SSLCertificateId: , }, }], Policies:
{}, BackendServerDescriptions: [{InstancePort: 80, }], AvailabilityZones: [jp-
e1a], VPCId: , HealthCheck: {Target: HTTP:80/index.html, Interval: 5, Timeout:
3, UnhealthyThreshold: 2, HealthyThreshold: 10, }, SourceSecurityGroup:
{OwnerAlias: , GroupName: , }, SecurityGroups: [8a0dba8f-7afc-436b-878a-
ab7dce6e2bf6], CreatedTime: Fri Jun 21 09:31:33 JST 2013, Scheme: internet-
facing, }], }
LBが作成された
LBの作成(確認)
- 45. 5.LBに仮想マシンを登録
> Which Service ? (Compute / LBA / ObjectStorage / AutoScaling / DNS /
Monitoring / Exit) :
LBA
Service =[LBA]
> Which Command ? (Describe / Create / Delete / RegisterInstance /
CreateListener / DefineHealth / HealthCheck / Exit) :
RegisterInstance
Command =[RegisterInstance]
> Enter LBA Name :
pyonkeyLBA
LBA Name =[pyonkeyLBA]
> List Instance? (Y/N) :
N
DescribeInstancesResult:
(略)
> Enter Register Instance ID :
216f442f-34bc-4b05-aa74-4914a7de65ec
Register Instance ID =[216f442f-34bc-4b05-aa74-4914a7de65ec]
LBに仮想マシンを登録するには「RegisterInstance」を入力
該当のLB名を入力
「N」を入力
先程メモした仮想マシンのIDを入力
(1)1台目の仮想マシンを登録
- 47. 5.LBに仮想マシンを登録
> Which Command ? (Describe / Create / Delete / RegisterInstance /
CreateListener / DefineHealth / HealthCheck / Exit) :
RegisterInstance
Command =[RegisterInstance]
> Enter LBA Name :
pyonkeyLBA
LBA Name =[pyonkeyLBA]
> List Instance? (Y/N) :
N
DescribeInstancesResult:
(略)
> Enter Register Instance ID :
8a5bfa47-645e-494a-adf6-042f2a99f8c5
Register Instance ID =[8a5bfa47-645e-494a-adf6-042f2a99f8c5]
LBにインスタンスを登録するには「RegisterInstance」を入力
該当のLB名を入力
「N」を入力
先程メモした仮想マシンのIDを入力
(2)2台目の仮想マシンを登録
- 49. > Which Command ? (Describe / Create / Delete / RegisterInstance /
CreateListener / DefineHealth / HealthCheck / Exit) :
Describe
Command =[Describe]
DescribeLoadBalancersResult:
{LoadBalancerName: pyonkeyLBA, DNSName: pyonkeyLBA-1371897092.lba.jp-
e1.cloudn-service.com, CanonicalHostedZoneName: pyonkeyLBA-1371897092.lba.jp-
e1.cloudn-service.com, CanonicalHostedZoneNameID: BBB1874A1E3A46,
ListenerDescriptions: [{Listener: {Protocol: HTTP, LoadBalancerPort: 80,
InstanceProtocol: HTTP, InstancePort: 80, SSLCertificateId: , }, }], Policies:
{}, BackendServerDescriptions: [{InstancePort: 80, }], AvailabilityZones: [jp-
e1a], VPCId: , Instances: [{InstanceId: 216f442f-34bc-4b05-
aa74-4914a7de65ec, }, {InstanceId: 8a5bfa47-645e-494a-adf6-042f2a99f8c5, }],
HealthCheck: {Target: HTTP:80/index.html, Interval: 5, Timeout: 3,
UnhealthyThreshold: 2, HealthyThreshold: 10, }, SourceSecurityGroup:
{OwnerAlias: cln100050095, GroupName: pyonkey-secgroup, }, SecurityGroups:
[8a0dba8f-7afc-436b-878a-ab7dce6e2bf6], CreatedTime: Sat Jun 22 19:31:33 JST
2013, Scheme: internet-facing, }], }
5.LBに仮想マシンを登録
(3)登録されたことを確認
- 52. 6.DNSを登録
$ java CloudnAPIService
=== Start ===[2013/06/21 09:04:01]
> Which Service ? (Compute / LBA / ObjectStorage / AutoScaling / DNS /
Monitoring / Exit) :
DNS
Service =[DNS]
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Create
Command =[Create]
> Enter Create Zone Name :
pyonkey.net
Zone Name =[pyonkey.net]
> Enter Caller Reference :
pyonkey.net
Caller Reference =[pyonkey.net]
(1)ゾーンを作成
「DNS」を入力
「Create」を入力
ゾーン名を入力
再度ゾーン名を入力
- 53. 6.DNSを登録
> Enter Comment (empty is available) :
Comment =[]
CreateHostedZoneRequest:
{Name: pyonkey.net, CallerReference: pyonkey.net, HostedZoneConfig:
{Comment: , }, }
CreateHostedZoneResult:
{HostedZone: {Id: BF04903FDB584F, Name: pyonkey.net., CallerReference:
pyonkey.net, Config: {Comment: , }, ResourceRecordSetCount: 2, }, ChangeInfo:
{Id: c5e8ad4b0cd047, Status: PENDING, SubmittedAt: Sun Jun 23 23:54:49 JST
2013, }, DelegationSet: {NameServers: [ns-08.dns.jp-e1.cloudn-service.com,
ns-09.dns.jp-e1.cloudn-service.com, ns-10.dns.jp-e1.cloudn-service.com], }, }
(1)ゾーンを作成
コメントを入力(任意)
ゾーンが作成された
「PENDING」…作成中のステータス
- 54. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
GetChange
Command =[GetChange]
> Enter Change ID :
c5e8ad4b0cd047
Change ID =[c5e8ad4b0cd047]
GetChangeRequest:
{Id: c5e8ad4b0cd047, }
GetChangeResult:
{ChangeInfo: {Id: c5e8ad4b0cd047, Status: INSYNC, SubmittedAt: Fri Jun 21
13:54:49 JST 2013, }, }
「INSYNC」となっていることを確認
「GetChange」と入力
Change IDを入力
(1)ゾーンを作成(確認)
- 55. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
List
Command =[List]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 2, }], IsTruncated: false, MaxItems: 100, }
ゾーンが作成されていることを確認
(1)ゾーンを作成(確認)
- 56. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Info
Command =[Info]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 2, }], IsTruncated: false, MaxItems: 100, }
> Enter Zone ID :
BF04903FDB584F
Zone ID =[BF04903FDB584F]
GetHostedZoneRequest:
{Id: BF04903FDB584F, }
GetHostedZoneResult:
{HostedZone: {Id: BF04903FDB584F, Name: pyonkey.net., CallerReference:
pyonkey.net, Config: {Comment: , }, ResourceRecordSetCount: 2, },
DelegationSet: {NameServers: [ns-08.dns.jp-e1.cloudn-service.com,
ns-09.dns.jp-e1.cloudn-service.com, ns-10.dns.jp-e1.cloudn-service.com], }, }
(2)ゾーン情報の表示
Zone ID を入力
「Info」と入力
- 57. 6.DNSを登録
ListResourceRecordSetsRequest:
{HostedZoneId: BF04903FDB584F, }
ListResourceRecordSetsResult:
{ResourceRecordSets: [
{Name: pyonkey.net., Type: SOA, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com. root.cloudn2.net. 1 7200 900 1209600
86400, }], },
{Name: pyonkey.net., Type: NS, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com., }, {Value: ns-09.dns.jp-e1.cloudn-
service.com., }, {Value: ns-10.dns.jp-e1.cloudn-service.com., }], }],
IsTruncated: false, MaxItems: 100, }
(2)ゾーン情報の表示
ネームサーバ名を確認
- 59. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Edit
Command =[Edit]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 3, }], IsTruncated: false, MaxItems: 100, }
> Enter Zone ID :
BF04903FDB584F
Zone ID =[BF04903FDB584F]
> Enter Action (CREATE / DELETE) :
CREATE
Action =[CREATE]
> Enter Type (A / AAAA / CNAME / MX / NS / PTR / SOA / SPF / SRV / TXT) :
CNAME
Type =[CNAME]
(4)レコードの登録(LB)
ゾーンIDを入力
「Edit」と入力
「CREATE」と入力
「CNAME」と入力※
※現在公開中のツールはA/AAAAレコードのみ対応しています。
CNAME登録は、順次対応予定です。
- 60. 6.DNSを登録
> Enter TTL :
3600
TTL =[3600]
> Enter Canonical Name (FQDN) :
web.pyonkey.net
Canonical Name =[web.pyonkey.net]
> Enter Host Name (FQDN) :
pyonkeylba-1371897092.lba.jp-e1.cloudn-service.com
Host Name =[pyonkeylba-1371897092.lba.jp-e1.cloudn-service.com]
ChangeResourceRecordSetsRequest:
{HostedZoneId: BF04903FDB584F, ChangeBatch: {Changes: [{Action: CREATE,
ResourceRecordSet: {Name: web.pyonkey.net, Type: CNAME, TTL: 3600,
ResourceRecords: [{Value: pyonkeylba-1371897092.lba.jp-e1.cloudn-
service.com, }], }, }], }, }
TTL値を入力
LBの別名を入力
メモしておいたLBの DNSName を入力
(4)レコードの登録(LB)
- 61. 6.DNSを登録
ChangeResourceRecordSetsResult:
{ChangeInfo: {Id: eb9330e8d52946, Status: PENDING, SubmittedAt: Mon Jun 24
11:17:35 JST 2013, }, }
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
GetChange
Command =[GetChange]
> Enter Change ID :
eb9330e8d52946
Change ID =[eb9330e8d52946]
GetChangeRequest:
{Id: eb9330e8d52946, }
GetChangeResult:
{ChangeInfo: {Id: eb9330e8d52946, Status: INSYNC, SubmittedAt: Mon Jun 24
11:17:35 JST 2013, }, }
「INSYNC」となったことを確認
(4)レコードの登録(LB)
Change IDを入力
- 62. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Info
Command =[Info]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 4, }], IsTruncated: false, MaxItems: 100, }
> Enter Zone ID :
BF04903FDB584F
Zone ID =[BF04903FDB584F]
GetHostedZoneRequest:
{Id: BF04903FDB584F, }
GetHostedZoneResult:
{HostedZone: {Id: BF04903FDB584F, Name: pyonkey.net., CallerReference:
pyonkey.net, Config: {Comment: , }, ResourceRecordSetCount: 4, },
DelegationSet: {NameServers: [ns-08.dns.jp-e1.cloudn-service.com,
ns-09.dns.jp-e1.cloudn-service.com, ns-10.dns.jp-e1.cloudn-service.com], }, }
(4)レコードの登録(LB)(確認)
Zone IDを入力
- 63. 6.DNSを登録
ListResourceRecordSetsRequest:
{HostedZoneId: BF04903FDB584F, }
ListResourceRecordSetsResult:
{ResourceRecordSets: [
{Name: pyonkey.net., Type: SOA, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com. root.cloudn2.net. 1 7200 900 1209600
86400, }], },
{Name: pyonkey.net., Type: NS, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com., }, {Value: ns-09.dns.jp-e1.cloudn-
service.com., }, {Value: ns-10.dns.jp-e1.cloudn-service.com., }], },
{Name: server01.pyonkey.net., Type: A, TTL: 3600, ResourceRecords: [{Value:
153.128.37.234, }], },
{Name: web.pyonkey.net., Type: CNAME, TTL: 3600, ResourceRecords: [{Value:
pyonkeylba-1371897092.lba.jp-e1.cloudn-service.com., }], }], IsTruncated:
false, MaxItems: 100, }
(4)レコードの登録(LB)(確認)
レコードが登録されている
- 64. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Edit
Command =[Edit]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 2, }], IsTruncated: false, MaxItems: 100, }
> Enter Zone ID :
BF04903FDB584F
Zone ID =[BF04903FDB584F]
> Enter Action (CREATE / DELETE) :
CREATE
Action =[CREATE]
> Enter Host Name (FQDN) :
server01.pyonkey.net.
Host Name =[server01.pyonkey.net.]
(5)レコードの登録(1台目の仮想マシン)
Zone IDを入力
「CREATE」と入力
ホスト名を入力
「Edit」と入力
- 65. 6.DNSを登録
> Enter Type (A / AAAA) :
A
Type =[A]
> Enter TTL :
3600
TTL =[3600]
> Enter IP Address :
153.128.37.234
IP Address =[153.128.37.234]
ChangeResourceRecordSetsRequest:
{HostedZoneId: BF04903FDB584F, ChangeBatch: {Changes: [{Action: CREATE,
ResourceRecordSet: {Name: server01.pyonkey.net., Type: A, TTL: 3600,
ResourceRecords: [{Value: 153.128.37.234, }], }, }], }, }
ChangeResourceRecordSetsResult:
{ChangeInfo: {Id: ca3a3ad691014f, Status: PENDING, SubmittedAt: Fri Jun 21
10:31:28 JST 2013, }, }
(5)レコードの登録(1台目の仮想マシン)
「A」と入力
「3600」と入力
先程メモしたIPアドレスを入力
- 66. 6.DNSを登録
> Which Command ? (List / Info / Create / Delete / Edit / GetChange / Exit) :
Info
Command =[Info]
ListHostedZonesResult:
{HostedZones: [
{Id: BF04903FDB584F, Name: pyonkey.net., CallerReference: pyonkey.net,
ResourceRecordSetCount: 3, }], IsTruncated: false, MaxItems: 100, }
> Enter Zone ID :
BF04903FDB584F
Zone ID =[BF04903FDB584F]
GetHostedZoneRequest:
{Id: BF04903FDB584F, }
GetHostedZoneResult:
{HostedZone: {Id: BF04903FDB584F, Name: pyonkey.net., CallerReference:
pyonkey.net, Config: {Comment: , }, ResourceRecordSetCount: 3, },
DelegationSet: {NameServers: [ns-08.dns.jp-e1.cloudn-service.com,
ns-09.dns.jp-e1.cloudn-service.com, ns-10.dns.jp-e1.cloudn-service.com], }, }
Zone ID を入力
「Info」と入力
(5)レコードの登録(1台目の仮想マシン)(確認)
- 67. 6.DNSを登録
ListResourceRecordSetsRequest:
{HostedZoneId: BF04903FDB584F, }
ListResourceRecordSetsResult:
{ResourceRecordSets: [
{Name: pyonkey.net., Type: SOA, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com. root.cloudn2.net. 1 7200 900 1209600
86400, }], },
{Name: pyonkey.net., Type: NS, TTL: 60, ResourceRecords: [{Value:
ns-08.dns.jp-e1.cloudn-service.com., }, {Value: ns-09.dns.jp-e1.cloudn-
service.com., }, {Value: ns-10.dns.jp-e1.cloudn-service.com., }], },
{Name: server01.pyonkey.net., Type: A, TTL: 3600, ResourceRecords: [{Value:
153.128.37.234, }], }], IsTruncated: false, MaxItems: 100, }
Aレコードが登録された
(5)レコードの登録(1台目の仮想マシン)(確認)
- 68. 6.DNSを登録
$ dig server01.pyonkey.net
; <<>> DiG 9.8.3-P1 <<>> server01.pyonkey.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53291
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 2
;; QUESTION SECTION:
;server01.pyonkey.net. IN A
;; ANSWER SECTION:
server01.pyonkey.net. 3600 IN A 153.128.37.234
;; AUTHORITY SECTION:
pyonkey.net. 60 IN NS ns-10.dns.jp-e1.cloudn-service.com.
pyonkey.net. 60 IN NS ns-09.dns.jp-e1.cloudn-service.com.
pyonkey.net. 60 IN NS ns-08.dns.jp-e1.cloudn-service.com.
(略)
(5)レコードの登録(1台目の仮想マシン)(確認)
名前解決できた
わ〜い♪