My genesis file (used same for both nodes)
"config": {
"chainId": 42,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"ethash": {}
},
"nonce": "0x0",
"timestamp": "0x62c17562",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x80000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0000000000000000000000000000000000000000": {
"balance": "0x1"
},
"0000000000000000000000000000000000000001": {
"balance": "0x1"
},
"0000000000000000000000000000000000000002": {
"balance": "0x1"
},
"0000000000000000000000000000000000000003": {
"balance": "0x1"
},
"0000000000000000000000000000000000000004": {
"balance": "0x1"
},
My .sh file for node 1
geth --identity "miner1" --networkid 42 --mine --datadir "~/RPI/miner1" --nodiscover --http --http.port "8042" --port "30303" --http.corsdomain "*" --nat "any" --http.api db,eth,web,web3,private,miner,admin,txpool,debug,personal,net --allow-insecure-unlock --unlock 0 --password ~/RPI/password.sec --ipcpath "~/.ethereum/geth.ipc"
for node 2:
geth --identity "miner2" --networkid 42 --datadir "~/RPI/miner2" --mine --nodiscover --http --http.port "8043" --port "30304" --http.corsdomain "*" --nat "any" --http.api db,eth,web,web3,private,miner,admin,txpool,debug,personal,net --allow-insecure-unlock --unlock 0 --password ~/RPI/password.sec --ipcpath "~/.ethereum/geth.ipc"
I have tried using admin.addPeer but always returns [] tried another method by adding static-nodes.json file but didn't work either.
content of my static-nodes.json:
[
“enode://f9d48547c373fd61124d110791168572382298979d18ab5d6314cd399538ef77b8ff826b870a3474ad351f175b6d4d6f03c09ab4382b4d075e6a3c7fdeee58aa#35.247.47.68:30303?discport=0”,
“enode://991f8279ae27e665151621a9940b42e208bb7cda0108c3cda219059bed28fbb7ec869b04db84d173fbb1cecdce5fef222d010f02a90238e7d8a53b163f6b0a2a#34.105.65.4:30304?discport=0”
]
One thing that I noticed which was very peculiar was mode info:
id: "1fdd33dee80b18a109b51e083ab05fe70d98a2c80d55da9c8679b412a438e180",
ip: "127.0.0.1",
listenAddr: "[::]:30303",
name: "Geth/miner1/v1.10.20-stable-8f2416a8/linux-amd64/go1.18.1",
ports: {
discovery: 0,
listener: 30303
},
protocols: {
eth: {
config: {
byzantiumBlock: 0,
chainId: 42,
constantinopleBlock: 0,
eip150Block: 0,
eip150Hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
eip155Block: 0,
eip158Block: 0,
ethash: {},
homesteadBlock: 0,
istanbulBlock: 0,
petersburgBlock: 0
},
difficulty: 147322604,
genesis: "0xd3ad0f15c44cf0543e7cccce24ce94024026b14a547428f1df6d9d89ab1d6fe7",
head: "0x82714efde94e31b659b232a62a88beb9be1d1cc9a8846f7bde6781276b35ec89",
network: 42
},
snap: {}
}
For some reason in both nodes my discovery ports is set to 0 I feel like that could be the issue but have not been able to find the way to change it. I was under the impression when you set ports both discovery and listener are set to that value.
If that is not the issue then I have no idea what it could be.
Related
Unsuccessfully trying to set up a CloudFront distribution for a static AWS-bucket based website, which worked with http, but not https. After adding certificate and configuring CloudFront, I am getting ERR_TOO_MANY_REDIRECTS
Can the problem be the multiple CNAMEs for mywebsite, configured in Route 53?
2 records are from certificate manager validation, not sure where the others came from.
Thank you!
mywebsite.com A Simple -
dwm6otdm3onq4.cloudfront.net.
mywebsite.com MX Simple -
10 inbound-smtp.us-east-1.amazonaws.com
mywebsite.com NS Simple -
ns-480.awsdns-60.com.
ns-1803.awsdns-33.co.uk.
ns-622.awsdns-13.net.
ns-1286.awsdns-32.org.
mywebsite.com SOA Simple -
ns-480.awsdns-60.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
_ab7fff75e12e479a02ad7b663442718d.mywebsite.com CNAME Simple -
_ffb36079eac41a4ec0d793858a8756ae.cvfdyspdbk.acm-validations.aws.
_amazonses.mywebsite.com TXT Simple -
"16fq2E3zX5omvpZj0u/Wjf3U3Qky9a5eI/G8FQdp2VA="
c43idfnpaak4u3nh3znyjcezzfgjbza7._domainkey.mywebsite.com CNAME Simple -
c43idfnpaak4u3nh3znyjcezzfgjbza7.dkim.amazonses.com
n3b4lhcvp63woqnod6tlgpovm5dcpqkz._domainkey.mywebsite.com CNAME Simple -
n3b4lhcvp63woqnod6tlgpovm5dcpqkz.dkim.amazonses.com.
tgfvwhfjzfmn4cfpalcjlxrb7vfutszu._domainkey.mywebsite.com CNAME Simple -
tgfvwhfjzfmn4cfpalcjlxrb7vfutszu.dkim.amazonses.com
autodiscover.mywebsite.com CNAME Simple -
autodiscover.mail.us-east-1.awsapps.com
www.mywebsite.com A Simple -
dwm6otdm3onq4.cloudfront.net.
_b6ae735a7252c03dbfbe162ec5be00cc.www.mywebsite.com CNAME Simple -
_16d9e15225e215d9fd9e9876ce29c409.cvfdyspdbk.acm-validations.aws.
{
"ETag": "E2UARY2PF3JN6L",
"Distribution": {
"Id": "E2VAMJ3R5UEYSD",
"ARN": "arn:aws:cloudfront::098706368979:distribution/E2VAMJ3R5UEYSD",
"Status": "Deployed",
"LastModifiedTime": "2021-08-18T19:41:28.165Z",
"InProgressInvalidationBatches": 0,
"DomainName": "dwm6otdm3onq4.cloudfront.net",
"ActiveTrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"DistributionConfig": {
"CallerReference": "49a807de-37a4-4c9f-add6-739dcffd27cb",
"Aliases": {
"Quantity": 2,
"Items": [
"www.mywebsite.com",
"mywebsite.com"
]
},
"DefaultRootObject": "index.html",
"Origins": {
"Quantity": 2,
"Items": [
{
"Id": "www.mywebsite.com.s3.us-east-1.amazonaws.com",
"DomainName": "mywebsite.com.s3-website-us-east-1.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"CustomOriginConfig": {
"HTTPPort": 80,
"HTTPSPort": 443,
"OriginProtocolPolicy": "match-viewer",
"OriginSslProtocols": {
"Quantity": 3,
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
},
"OriginReadTimeout": 30,
"OriginKeepaliveTimeout": 5
}
},
{
"Id": "mywebsite.com.s3.us-east-1.amazonaws.com",
"DomainName": "mywebsite.com.s3-website-us-east-1.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"CustomOriginConfig": {
"HTTPPort": 80,
"HTTPSPort": 443,
"OriginProtocolPolicy": "http-only",
"OriginSslProtocols": {
"Quantity": 3,
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
},
"OriginReadTimeout": 30,
"OriginKeepaliveTimeout": 5
}
}
]
},
"OriginGroups": {
"Quantity": 0
},
"DefaultCacheBehavior": {
"TargetOriginId": "www.mywebsite.com.s3.us-east-1.amazonaws.com",
"ForwardedValues": {
"QueryString": false,
"Cookies": {
"Forward": "none"
},
"Headers": {
"Quantity": 0
},
"QueryStringCacheKeys": {
"Quantity": 0
}
},
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "redirect-to-https",
"MinTTL": 0,
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"DefaultTTL": 0,
"MaxTTL": 0,
"Compress": true,
"LambdaFunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": ""
},
"CacheBehaviors": {
"Quantity": 0
},
"CustomErrorResponses": {
"Quantity": 0
},
"Comment": "",
"Logging": {
"Enabled": false,
"IncludeCookies": false,
"Bucket": "",
"Prefix": ""
},
"PriceClass": "PriceClass_100",
"Enabled": true,
"ViewerCertificate": {
"ACMCertificateArn": "arn:aws:acm:us-east-1:098706368979:certificate/8213cadd-5efd-44ad-b252-3d2cb7bed408",
"SSLSupportMethod": "sni-only",
"MinimumProtocolVersion": "TLSv1.2_2021",
"Certificate": "arn:aws:acm:us-east-1:098706368979:certificate/8213cadd-5efd-44ad-b252-3d2cb7bed408",
"CertificateSource": "acm"
},
"Restrictions": {
"GeoRestriction": {
"RestrictionType": "none",
"Quantity": 0
}
},
"WebACLId": "",
"HttpVersion": "http2",
"IsIPV6Enabled": true
},
"AliasICPRecordals": [
{
"CNAME": "www.mywebsite.com",
"ICPRecordalStatus": "APPROVED"
},
{
"CNAME": "mywebsite.com",
"ICPRecordalStatus": "APPROVED"
}
]
}
}
get-bucket-policy
{
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"PublicReadGetObject\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::mywebsite.com/*\"},{\"Sid\":\"PublicReadGetObjectVersion\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObjectVersion\",\"Resource\":\"arn:aws:s3:::mywebsite.com/*\"},{\"Sid\":\"PublicListBucket\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:ListBucket\",\"Resource\":\"arn:aws:s3:::mywebsite.com\"}]}"
}
get-bucket-website:
{
"IndexDocument": {
"Suffix": "index.html"
}
}
It's difficult to see what is causing the redirects, but it is clear that your CloudFront configuration is not really ideal. You've got the same origin configured twice (while only using one) and they are configured to also use HTTPS to access S3, which is not supported. They are also configured using a custom HTTP origin, while it is a little more secure to use the S3 origin configuration with an Origin Access Identity (OAI).
You can use this blog as a base to set it up using an OAI. This will probably/hopefully also fix your redirection issues.
Adding an AAA record fixed the issue.
Unsuccessfully trying to set up a CloudFront distribution for a static AWS-bucket based website, which worked with http, but not https. After adding certificate and configuring CloudFront, I am getting ERR_TOO_MANY_REDIRECTS
Can the problem be the multiple CNAMEs for mywebsite, configured in Route 53?
2 records are from certificate manager validation, not sure where the others came from.
Thank you!
mywebsite.com A Simple -
dwm6otdm3onq4.cloudfront.net.
mywebsite.com MX Simple -
10 inbound-smtp.us-east-1.amazonaws.com
mywebsite.com NS Simple -
ns-480.awsdns-60.com.
ns-1803.awsdns-33.co.uk.
ns-622.awsdns-13.net.
ns-1286.awsdns-32.org.
mywebsite.com SOA Simple -
ns-480.awsdns-60.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
_ab7fff75e12e479a02ad7b663442718d.mywebsite.com CNAME Simple -
_ffb36079eac41a4ec0d793858a8756ae.cvfdyspdbk.acm-validations.aws.
_amazonses.mywebsite.com TXT Simple -
"16fq2E3zX5omvpZj0u/Wjf3U3Qky9a5eI/G8FQdp2VA="
c43idfnpaak4u3nh3znyjcezzfgjbza7._domainkey.mywebsite.com CNAME Simple -
c43idfnpaak4u3nh3znyjcezzfgjbza7.dkim.amazonses.com
n3b4lhcvp63woqnod6tlgpovm5dcpqkz._domainkey.mywebsite.com CNAME Simple -
n3b4lhcvp63woqnod6tlgpovm5dcpqkz.dkim.amazonses.com.
tgfvwhfjzfmn4cfpalcjlxrb7vfutszu._domainkey.mywebsite.com CNAME Simple -
tgfvwhfjzfmn4cfpalcjlxrb7vfutszu.dkim.amazonses.com
autodiscover.mywebsite.com CNAME Simple -
autodiscover.mail.us-east-1.awsapps.com
www.mywebsite.com A Simple -
dwm6otdm3onq4.cloudfront.net.
_b6ae735a7252c03dbfbe162ec5be00cc.www.mywebsite.com CNAME Simple -
_16d9e15225e215d9fd9e9876ce29c409.cvfdyspdbk.acm-validations.aws.
{
"ETag": "E2UARY2PF3JN6L",
"Distribution": {
"Id": "E2VAMJ3R5UEYSD",
"ARN": "arn:aws:cloudfront::098706368979:distribution/E2VAMJ3R5UEYSD",
"Status": "Deployed",
"LastModifiedTime": "2021-08-18T19:41:28.165Z",
"InProgressInvalidationBatches": 0,
"DomainName": "dwm6otdm3onq4.cloudfront.net",
"ActiveTrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"DistributionConfig": {
"CallerReference": "49a807de-37a4-4c9f-add6-739dcffd27cb",
"Aliases": {
"Quantity": 2,
"Items": [
"www.mywebsite.com",
"mywebsite.com"
]
},
"DefaultRootObject": "index.html",
"Origins": {
"Quantity": 2,
"Items": [
{
"Id": "www.mywebsite.com.s3.us-east-1.amazonaws.com",
"DomainName": "mywebsite.com.s3-website-us-east-1.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"CustomOriginConfig": {
"HTTPPort": 80,
"HTTPSPort": 443,
"OriginProtocolPolicy": "match-viewer",
"OriginSslProtocols": {
"Quantity": 3,
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
},
"OriginReadTimeout": 30,
"OriginKeepaliveTimeout": 5
}
},
{
"Id": "mywebsite.com.s3.us-east-1.amazonaws.com",
"DomainName": "mywebsite.com.s3-website-us-east-1.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"CustomOriginConfig": {
"HTTPPort": 80,
"HTTPSPort": 443,
"OriginProtocolPolicy": "http-only",
"OriginSslProtocols": {
"Quantity": 3,
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
},
"OriginReadTimeout": 30,
"OriginKeepaliveTimeout": 5
}
}
]
},
"OriginGroups": {
"Quantity": 0
},
"DefaultCacheBehavior": {
"TargetOriginId": "www.mywebsite.com.s3.us-east-1.amazonaws.com",
"ForwardedValues": {
"QueryString": false,
"Cookies": {
"Forward": "none"
},
"Headers": {
"Quantity": 0
},
"QueryStringCacheKeys": {
"Quantity": 0
}
},
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "redirect-to-https",
"MinTTL": 0,
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"DefaultTTL": 0,
"MaxTTL": 0,
"Compress": true,
"LambdaFunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": ""
},
"CacheBehaviors": {
"Quantity": 0
},
"CustomErrorResponses": {
"Quantity": 0
},
"Comment": "",
"Logging": {
"Enabled": false,
"IncludeCookies": false,
"Bucket": "",
"Prefix": ""
},
"PriceClass": "PriceClass_100",
"Enabled": true,
"ViewerCertificate": {
"ACMCertificateArn": "arn:aws:acm:us-east-1:098706368979:certificate/8213cadd-5efd-44ad-b252-3d2cb7bed408",
"SSLSupportMethod": "sni-only",
"MinimumProtocolVersion": "TLSv1.2_2021",
"Certificate": "arn:aws:acm:us-east-1:098706368979:certificate/8213cadd-5efd-44ad-b252-3d2cb7bed408",
"CertificateSource": "acm"
},
"Restrictions": {
"GeoRestriction": {
"RestrictionType": "none",
"Quantity": 0
}
},
"WebACLId": "",
"HttpVersion": "http2",
"IsIPV6Enabled": true
},
"AliasICPRecordals": [
{
"CNAME": "www.mywebsite.com",
"ICPRecordalStatus": "APPROVED"
},
{
"CNAME": "mywebsite.com",
"ICPRecordalStatus": "APPROVED"
}
]
}
}
get-bucket-policy
{
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"PublicReadGetObject\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::mywebsite.com/*\"},{\"Sid\":\"PublicReadGetObjectVersion\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObjectVersion\",\"Resource\":\"arn:aws:s3:::mywebsite.com/*\"},{\"Sid\":\"PublicListBucket\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:ListBucket\",\"Resource\":\"arn:aws:s3:::mywebsite.com\"}]}"
}
get-bucket-website:
{
"IndexDocument": {
"Suffix": "index.html"
}
}
It's difficult to see what is causing the redirects, but it is clear that your CloudFront configuration is not really ideal. You've got the same origin configured twice (while only using one) and they are configured to also use HTTPS to access S3, which is not supported. They are also configured using a custom HTTP origin, while it is a little more secure to use the S3 origin configuration with an Origin Access Identity (OAI).
You can use this blog as a base to set it up using an OAI. This will probably/hopefully also fix your redirection issues.
Adding an AAA record fixed the issue.
- name: Use Collections
hosts: all
connection: local
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python3.9
tasks:
- name: Collect BIG-IP information
bigip_device_info:
gather_subset:
- virtual-servers
provider:
server: y.y.y.y
user: abc
password: abc1
validate_certs: False
delegate_to: localhost
register: output
- name: debug
debug: msg={{output.ansible_facts| json_query(jmesquery)}}
vars:
jmesquery: "[*].{Satus: item.availability_status, Destinationaddress: item.destination_address, Destination: item.destination}"
i am getting below output, empty message
ansible-playbook -i inv bigipfacts.yml
PLAY [Use Collections] ***************************************************************************************************************************************************************************
TASK [Collect BIG-IP information] ****************************************************************************************************************************************************************
ok: [y.y.y.y]
TASK [debug] *************************************************************************************************************************************************************************************
ok: [y.y.y.y] => {
"msg": ""
}
PLAY RECAP ***************************************************************************************************************************************************************************************
y.y.y.y : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Required/wanted output- in future i want parse more from bottom output. but for now these three values.
"availability_status": "available",
"destination": "/1.1.1..1:8080",
"destination_address": "2.2.2.2",
"availability_status": "available",
"destination": "/3.3.3.3.3%22:8080",
"destination_address": "4.4.4.4",
output.ansible_facts has below info, i want to parse below output and extract only few values in a list like shown above
TASK [debug] *************************************************************************************************************************************************************************************
ok: [x.x.x.x] => {
"msg": {
"ansible_net_queried": true,
"ansible_net_virtual_servers": [
{
"auto_lasthop": "default",
"availability_status": "available",
"client_side_bits_in": 0,
"client_side_bits_out": 0,
"client_side_current_connections": 0,
"client_side_evicted_connections": 0,
"client_side_max_connections": 0,
"client_side_pkts_in": 0,
"client_side_pkts_out": 0,
"client_side_slow_killed": 0,
"client_side_total_connections": 0,
"cmp_enabled": "yes",
"cmp_mode": "all-cpus",
"connection_limit": 0,
"connection_mirror_enabled": "no",
"cpu_usage_ratio_last_1_min": 0,
"cpu_usage_ratio_last_5_min": 0,
"cpu_usage_ratio_last_5_sec": 0,
"current_syn_cache": 0,
"default_pool": "/POOL01",
"destination": "/1.1.1..1:8080",
"destination_address": "2.2.2.2",
"destination_port": 8080,
"enabled": "no",
"ephemeral_bits_in": 0,
"ephemeral_bits_out": 0,
"ephemeral_current_connections": 0,
"ephemeral_evicted_connections": 0,
"ephemeral_max_connections": 0,
"ephemeral_pkts_in": 0,
"ephemeral_pkts_out": 0,
"ephemeral_slow_killed": 0,
"ephemeral_total_connections": 0,
"full_path": "/p1/VS01",
"gtm_score": 0,
"hardware_syn_cookie_instances": 0,
"max_conn_duration": 0,
"mean_conn_duration": 0,
"min_conn_duration": 0,
"name": "vs01",
"nat64_enabled": "no",
"profiles": [
{
"context": "all",
"full_path": "/Common/http",
"name": "http"
},
{
"context": "all",
"full_path": "/Common/oneconnect",
"name": "oneconnect"
},
{
"context": "all",
"full_path": "/Common/tcp",
"name": "tcp"
}
],
"protocol": "tcp",
"rate_limit": -1,
"rate_limit_destination_mask": 0,
"rate_limit_mode": "object",
"rate_limit_source_mask": 0,
"snat_type": "automap",
"software_syn_cookie_instances": 0,
"source_address": "0.0.0.0%22/0",
"source_port_behavior": "preserve",
"status_reason": "The virtual server is available",
"syn_cache_overflow": 0,
"syn_cookies_status": "not-activated",
"total_hardware_accepted_syn_cookies": 0,
"total_hardware_syn_cookies": 0,
"total_requests": 0,
"total_software_accepted_syn_cookies": 0,
"total_software_rejected_syn_cookies": 0,
"total_software_syn_cookies": 0,
"translate_address": "yes",
"translate_port": "yes",
"type": "standard",
"vlans": [
"/Common/vlans"
]
},
{
"auto_lasthop": "default",
"availability_status": "available",
"client_side_bits_in": 0,
"client_side_bits_out": 0,
"client_side_current_connections": 0,
"client_side_evicted_connections": 0,
"client_side_max_connections": 0,
"client_side_pkts_in": 0,
"client_side_pkts_out": 0,
"client_side_slow_killed": 0,
"client_side_total_connections": 0,
"cmp_enabled": "yes",
"cmp_mode": "all-cpus",
"connection_limit": 0,
"connection_mirror_enabled": "no",
"cpu_usage_ratio_last_1_min": 0,
"cpu_usage_ratio_last_5_min": 0,
"cpu_usage_ratio_last_5_sec": 0,
"current_syn_cache": 0,
"default_pool": "/POOL01",
"destination": "/3.3.3.3.3%22:8080",
"destination_address": "4.4.4.4",
"destination_port": 8080,
"enabled": "no",
"ephemeral_bits_in": 0,
"ephemeral_bits_out": 0,
"ephemeral_current_connections": 0,
"ephemeral_evicted_connections": 0,
"ephemeral_max_connections": 0,
"ephemeral_pkts_in": 0,
"ephemeral_pkts_out": 0,
"ephemeral_slow_killed": 0,
"ephemeral_total_connections": 0,
"full_path": "/p1/VS01",
"gtm_score": 0,
"hardware_syn_cookie_instances": 0,
"max_conn_duration": 0,
"mean_conn_duration": 0,
"min_conn_duration": 0,
"name": "vs02",
"nat64_enabled": "no",
"profiles": [
{
"context": "all",
"full_path": "/Common/http",
"name": "http"
},
{
"context": "all",
"full_path": "/Common/oneconnect",
"name": "oneconnect"
},
{
"context": "all",
"full_path": "/Common/tcp",
"name": "tcp"
}
],
"protocol": "tcp",
"rate_limit": -1,
"rate_limit_destination_mask": 0,
"rate_limit_mode": "object",
"rate_limit_source_mask": 0,
"snat_type": "automap",
"software_syn_cookie_instances": 0,
"source_address": "0.0.0.0%22/0",
"source_port_behavior": "preserve",
"status_reason": "The virtual server is available",
"syn_cache_overflow": 0,
"syn_cookies_status": "not-activated",
"total_hardware_accepted_syn_cookies": 0,
"total_hardware_syn_cookies": 0,
"total_requests": 0,
"total_software_accepted_syn_cookies": 0,
"total_software_rejected_syn_cookies": 0,
"total_software_syn_cookies": 0,
"translate_address": "yes",
"translate_port": "yes",
"type": "standard",
"vlans": [
"/Common/vlan"
]
}
]
}
}
You omitted ansible_net_virtual_servers entirely, and appear to have conflated with_items: (which sets an item name in jinja2) with JMESPath which has no such implicit name creation
- debug:
msg: >-
{{ output.ansible_facts.ansible_net_virtual_servers
| json_query(jmesquery) }}
vars:
jmesquery: "[*].{Satus: availability_status, Destinationaddress: destination_address, Destination: destination}"
produces
ok: [localhost] => {
"msg": [
{
"Destination": "/1.1.1..1:8080",
"Destinationaddress": "2.2.2.2",
"Satus": "available"
},
{
"Destination": "/3.3.3.3.3%22:8080",
"Destinationaddress": "4.4.4.4",
"Satus": "available"
}
]
}
I am trying to create an ec2 spot instance using docker-machine. I tried to debug my command and found that it is failing at ssh.
I used ssh-keygen to create my key pair, and i have uploaded the key-pair to aws.
I am able to connect to the instance using putty. Please help me solving this error!
Also i am running the docker-machine command from an ec2 instance.
docker-machine version:
docker-machine version 0.13.0, build 9ba6da9
Command:
docker-machine --debug create --driver amazonec2 --amazonec2-access-key xxxxxxxxx --amazonec2-secret-key xxxxxxxxx --amazonec2-ssh-user ubuntu --amazonec2-region us-east-1 --amazonec2-instance-type t2.large --amazonec2-ami ami-xxxxx--amazonec2-vpc-id vpc-xxxxx--amazonec2-subnet-id subnet-xxxx--amazonec2-zone a --amazonec2-root-size 32 --amazonec2-keypair-name id_rsa --amazonec2-ssh-keypath $HOME/.ssh/id_rsa --amazonec2-request-spot-instance --amazonec2-security-group dev --amazonec2-private-address-only --amazonec2-spot-price x.xx dev4
Error:
Using SSH client type: external
Using SSH private key: /home/centos/.docker/machine/machines/dev4/id_rsa (-rw-------)
&{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none ubuntu#xx.xxx.x.xx -o IdentitiesOnly=yes -i /home/centos/.docker/machine/machines/dev4/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : ssh command error:
command : exit 0
err : exit status 255
output :
docker-machine inspect dev4
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "xx.xxx.xx.xx",
"MachineName": "dev4",
"SSHUser": "ubuntu",
"SSHPort": 22,
"SSHKeyPath": "/home/centos/.docker/machine/machines/dev4/id_rsa",
"StorePath": "/home/centos/.docker/machine",
"SwarmMaster": false,
"SwarmHost": "tcp://0.0.0.0:3376",
"SwarmDiscovery": "",
"Id": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"AccessKey": "xxxxxxxxxx",
"SecretKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"SessionToken": "",
"Region": "us-east-1",
"AMI": "ami-xxxx",
"SSHKeyID": 0,
"ExistingKey": true,
"KeyName": "id_rsa",
"InstanceId": "i-xxxxxxxxxxxxxxxxxxxx",
"InstanceType": "t2.large",
"PrivateIPAddress": "xx.xxx.xx.xx",
"SecurityGroupId": "",
"SecurityGroupIds": [
"sg-xxxxxx"
],
"SecurityGroupName": "",
"SecurityGroupNames": [
"dev"
],
"OpenPorts": null,
"Tags": "",
"ReservationId": "",
"DeviceName": "/dev/sda1",
"RootSize": 32,
"VolumeType": "gp2",
"IamInstanceProfile": "",
"VpcId": "vpc-xxxxxx",
"SubnetId": "subnet-xxxxx",
"Zone": "a",
"RequestSpotInstance": true,
"SpotPrice": "x.xx",
"BlockDurationMinutes": 0,
"PrivateIPOnly": true,
"UsePrivateIP": false,
"UseEbsOptimizedInstance": false,
"Monitoring": false,
"SSHPrivateKeyPath": "/home/centos/.ssh/id_rsa",
"RetryCount": 5,
"Endpoint": "",
"DisableSSL": false,
"UserDataFile": ""
},
"DriverName": "amazonec2",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": [],
"Dns": null,
"GraphDir": "",
"Env": [],
"Ipv6": false,
"InsecureRegistry": [],
"Labels": [],
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": true,
"RegistryMirror": [],
"InstallURL": "https://get.docker.com"
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": [],
"ArbitraryJoinFlags": [],
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/home/centos/.docker/machine/certs",
"CaCertPath": "/home/centos/.docker/machine/certs/ca.pem",
"CaPrivateKeyPath": "/home/centos/.docker/machine/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/home/centos/.docker/machine/machines/dev4/server.pem",
"ServerKeyPath": "/home/centos/.docker/machine/machines/dev4/server-key.pem",
"ClientKeyPath": "/home/centos/.docker/machine/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/home/centos/.docker/machine/certs/cert.pem",
"ServerCertSANs": [],
"StorePath": "/home/centos/.docker/machine/machines/dev4"
}
},
"Name": "dev4"
}
When I run this command:
rabbitmqctl list_connections pid
I get output like the following:
<rabbit#my_box.2.1234.0>
<rabbit#my_box.2.1235.0>
Is there a way to read this pid from my kombu client?
RabbitMQ does not expose this kind of internal details through AMQP.
You can get many informations about connections using the management plugin and its REST API. Here is an example:
// JSON returned by http://localhost:15672/api/connections
// ...
{
"connected_at": 1458292870638,
"client_properties":
{
"product": "RabbitMQ",
"copyright": "Copyright (c) 2007-2016 Pivotal Software, Inc.",
"capabilities":
{
"exchange_exchange_bindings": true,
"connection.blocked": true,
"authentication_failure_close": true,
"basic.nack": true,
"publisher_confirms": true,
"consumer_cancel_notify": true
},
"information": "Licensed under the MPL. See http://www.rabbitmq.com/",
"version": "0.0.0",
"platform": "Java"
},
"channel_max": 0,
"frame_max": 131072,
"timeout": 60,
"vhost": "/",
"user": "guest",
"protocol": "AMQP 0-9-1",
"ssl_hash": null,
"ssl_cipher": null,
"ssl_key_exchange": null,
"ssl_protocol": null,
"auth_mechanism": "PLAIN",
"peer_cert_validity": null,
"peer_cert_issuer": null,
"peer_cert_subject": null,
"ssl": false,
"peer_host": "127.0.0.1",
"host": "127.0.0.1",
"peer_port": 54872,
"port": 5672,
"name": "127.0.0.1:54872 -> 127.0.0.1:5672",
"node": "rabbit#localhost",
"type": "network",
"channels": 1,
"state": "running",
"send_pend": 0,
"send_cnt": 108973,
"recv_cnt": 99426,
"recv_oct_details":
{
"rate": 288892.8
},
"recv_oct": 5540646,
"send_oct_details":
{
"rate": 1912389.8
},
"send_oct": 36669998
},
// ...
However, PIDs are not exposed either through this mechanism.