Author Topic: ssh: connect to host xxx.yyy.sss.ddd port 22: Connection refused SSH from Google  (Read 4435 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
มีเจอปัญหาเรื่องการ reboot vm บน Gcloud หลังจากแก้ไขจูนนิ่ง sysctl.conf ไป
แล้ว reboot vm ไม่ขึ้น ตรวจเช็คดูเป็นเกี่ยวกับค่าบางตัวที่ปรับไป ไม่สอดคล้องกับสภาพแวดล้อมของ Gcloud ที่ควรจะเป็นครับีก
คือเหมือนกับ vm ปิงได้ แต่ว่า ssh ไม่ทำงานเหมือนกับว่ายังไม่สามารถ reboot ระบบได้ปกติครับ
วิธีแก้ไขก็ปรับลด ตัวที่มีปัญหาออกไปก่อนครับ ก็จะได้ใช้งานได้ปกติ

SSH from one session to another (same internal IP):

ssh: connect to host xxx.yyy.sss.ddd port 22: Connection refused
SSH from Google Dev Console :

We are unable to connect to the VM on port
22. Learn more about possible causes of this issue.

Today I have found some point when tunning on sysctl.conf (VM box on GcloudGcloud(GCE))

###My edit tunning
kernel.sem = 250 32000 100 128
kernel.shmmax = 17179869184
kernel.shmall = 4194304

###GCloud default environment
kernel.sem = 32000 1024000000 500 32000
kernel.shmall = 18446744073692774399
kernel.shmmax = 18446744073692774399

After run

sysctl -p

It's OK.

But if you reboot system then VM will read optimize value on sysctl.conf then will effect could not connect to VM . (Sometime could not ping to that VM or could not ssh to that VM).

Please concern on these tunning value on sysctl.conf also in Gcloud(GCE).

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ssh: connect to host xxx.yyy.sss.ddd port 22: Connection refused SSH from Google
« Reply #1 on: เมษายน 27, 2017, 05:46:57 PM »
###For GCloud
##Added by PKL on 20-Apr-2017
kernel.shmmni = 4096
vm.swappiness = 40
vm.vfs_cache_pressure = 50

net.ipv4.tcp_synack_retries = 3
net.ipv4.tcp_syn_retries = 2
net.core.dev_weight = 64
net.ipv4.tcp_fin_timeout = 3
net.ipv4.tcp_no_metrics_save = 1

## Decrease TIME_WAIT seconds
net.ipv4.tcp_fin_timeout = 30
## Recycle and Reuse TIME_WAIT sockets faster
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
##End by PKL