how to deal "failed to connect to Kubernetes master ip" - macos

I started learn Kubernetes, so I follow this guide https://kubernetes.io/docs/setup/turnkey/gce/
I got an error after I run "cluster/kube-up.sh"
Waiting up to 300 seconds for cluster initialization.
This will continually check to see if the API for kubernetes is reachable.
This may time out if there was some uncaught error during start up.
.........................................................................................................................................Cluster failed to initialize within 300 seconds.
Last output from querying API server follows:
% Total % Received % Xferd Average Speed Time Time Time current
             Dload Upload Total Spent Left speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to "[kubernetes-master (external IP)]"
So I tried to search about this error. And then found one solution. It said go to the "cluster/gce/config-default.sh"
secret: $(dd if=/dev/urandom iflag=fullblock bs=32 count=1 2>/dev/null | base64 | tr -d '\r\n')
And then change 'dd' to 'gdd'. So I modified config-default.sh, But it doesn't work.
I don't know how to fix it. Is there are any solution about this error ?̊̈ Also in the /var/logs there are no logs about Kubernetes. Where logs are saved ?̊̈
My Mac version: mas OS Mojave
version: 10.14.3

Looks like GDD is only available in MacOS, about the Kubernetes logs you can have a look at this other article. If you would have a Google Kubernetes Engine cluster it would be easier to check the log by looking at Stackdriver.

Related

Trouble getting started with Spring Boot: Error: Could not find or load main class

I got this error when trying to mess around with Spring Boot. I create a new project with the initializr. Got JDK and Maven installed. I run the command ./mvnw spring-boot:run and get
./mvnw: line 280: /Users/alesh/projects/spring-boot-demo/.mvn/wrapper/maven-wrapper.properties: No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file
Warning: /Users/alesh/projects/spring-boot-demo/.mvn/wrapper/maven-wrapper.jar:
Warning: No such file or directory
1 58727 1 1033 0 0 4152 0 0:00:14 --:--:-- 0:00:14 4251
curl: (23) Failure writing output to destination
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain
mvn spring-boot:run
Running this worked for me. Looks like nobody else on the internet has had this problem, at least nobody for whom the solution wasn't obvious. If I'm missing anything please let me know!

Getting EOF error which call APNS in golang with developement certificate

What version of Go are you using?
go version go1.13 linux/amd64
What OS and processor architecture are you using?
OS: CentOS-7 x86_64 GNU/Linux
What did I do?
Span 100 threads using goroutine reach thread read data from
redis,data is in json which contains key csv_file path.Each csv
contains 1000 tokens. Each thread pop data from redis and read csv and
spawn 1000 threads, how much tokens that much thread and call APNS
push. During the push getting "EOF". 90% calls failed with this error.
I have set my OS ulimit is 500000
what did you expect to see? It should get processed 10M tokens in 1 minute
What did I see instead?
I am getting following error when call APNS sevice with load testing
on dev certificate time="2020-02-25T08:54:44-05:00" level=info
msg="Push Error:%!(EXTRA *url.Error=Post
https://api.sandbox.push.apple.com/3/device/eoQtFQtlL4s:APA91bGrV0HqQH4qbxe
ZCJrX-XMHj63: EOF)" 90% calls failed with this error. each thread with
1000 tokens publishe taken 2s with EOF error which is extermelly slow.
Further informations:
Aim:
My aim is publish 10M tokens in 1 minute
Where I run the code:
I am running in golang code in aws EC2 instance in Virginia us-east-1
My question:
When this error came and how can I fix?
It will be great if I can get help.

Unresponsive socket after x time (puma - ruby)

I'm experiencing an unresponsive socket in with my Puma setup after random time. Up to this point I don't have a clue what's causing the issue. I was hoping somebody over here can help we with some answers or point me in the right direction. I'm having the following setup:
I'm using the official docker ruby-2.2.3-slim image together with the latest puma release 2.15.3, I've also installed Nginx as a reverse proxy. But I'm already sure Nginx isn't the problem over here because and I've tried to verify if the socket was working using this script. And the socket wasn't working, I got a timeout over there as well so I could ignore Nginx.
This is a testing environment so the server isn't experiencing any extreme load, I've also check memory consumption it has still several GB's of free space so that couldn't be the issue either.
What triggered me to look at the puma socket was the error message I got in my Nginx error logging:
upstream timed out (110: Connection timed out) while reading response header from upstream
Also I couldn't find anything in the logs of puma indicating what is going wrong, over here are my puma setup:
threads 0, 16
app_dir = ENV.fetch('APP_HOME')
environment ENV['RAILS_ENV']
daemonize
bind "unix://#{app_dir}/sockets/puma.sock"
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true
pidfile "#{app_dir}/pids/puma.pid"
state_path "#{app_dir}/pids/puma.state"
activate_control_app
on_worker_boot do
require 'active_record'
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[ENV['RAILS_ENV']])
end
And this it the output in my puma state file:
---
pid: 43
config: !ruby/object:Puma::Configuration
cli_options:
conf:
options:
:min_threads: 0
:max_threads: 16
:quiet: false
:debug: false
:binds:
- unix:///APP/sockets/puma.sock
:workers: 1
:daemon: true
:mode: :http
:before_fork: []
:worker_timeout: 60
:worker_boot_timeout: 60
:worker_shutdown_timeout: 30
:environment: staging
:redirect_stdout: "/APP/log/puma.stdout.log"
:redirect_stderr: "/APP/log/puma.stderr.log"
:redirect_append: true
:pidfile: "/APP/pids/puma.pid"
:state: "/APP/pids/puma.state"
:control_url: unix:///tmp/puma-status-1449260516541-37
:config_file: config/puma.rb
:control_url_temp: "/tmp/puma-status-1449260516541-37"
:control_auth_token: cda8879717be7a645ea323d931b88d4b
:tag: APP
The application itself is a Rails app on the latest version 4.2.5, it's deployed on GCE (Google Container Engine).
If somebody could give me some pointer's on how to debug this any further would be very much appreciated. Because now I don't see any output anywhere which could help me any further.
EDIT
I replaced the unix socket with tcp connection to Puma with the same result, still hangs after x time
I'd start with:
How many requests get processed successfully per instance of puma?
Make sure you log the beginning and end of each request with the thread id of the thread executing it, what do you see?
Not knowing more about your application, I'd say it's likely the threads get stuck doing some long/blocking calls without timeouts or spinning on some computation until the whole thread pool gets depleted.
We'll see.
I finally found out why my application was behaving the way it was.
After trying to use a tcp connection and switching to Unicorn I start looking into other possible sources.
That's when I thought maybe my connection to Google Cloud SQL could be the problem. Once I read the faq of Cloud SQL, they mentioned that you have to tweak you Compute instances to ensure they keep open your DB connection. So I performed the next steps they recommend and that solved the problem for me, I added them just in case:
# Display the current tcp_keepalive_time value.
$ cat /proc/sys/net/ipv4/tcp_keepalive_time
# Set tcp_keepalive_time to 60 seconds and make it permanent across reboots.
$ echo 'net.ipv4.tcp_keepalive_time = 60' | sudo tee -a /etc/sysctl.conf
# Apply the change.
$ sudo /sbin/sysctl --load=/etc/sysctl.conf
# Display the tcp_keepalive_time value to verify the change was applied.
$ cat /proc/sys/net/ipv4/tcp_keepalive_time

Cannot Update Macports Port Tree

I've been trying to install a few ports ( wget, autoconf, coreutils, ... etc ) but it seems impossible !!! Here's what I have done step by step :
I'm using OS X 10.9.1 Mavericks and I've downloaded and installed macports using installation package (.pkg) from macports website. I had Xcode 5.0.2 already installed so I logged in my Apple iOS developer account, and downloaded command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg and installed the package !
When I use
sudo port install coreutils I get the following error: Error: Port coreutils not found
I thought (And Googled of course) it must be because I haven't updated macports. Then I tried using self update using : sudo port -v selfupdate which by the way was not successful and I got the following error log :
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Operation timed out (60)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
Error: Error synchronizing MacPorts sources: command execution failed
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed`
According to failed to connect to server message, I thought it may be caused because of restrictions and sanctions applied to my IP Address which by the way is currently from Iran (I figured that out because I cannot even open macports website directly without using a proxy server) ! I used the instructions in the following URL to reroute the connection and make Macports connect through a proxy server :
http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/
The instruction above tries to connect and fetch the port tree using a .tar.gz archive over HTTP ! I didn't got that connection error anymore but I got some Could not access the file error, so I downloaded that file manually, set up an Apache web server locally, and replaced that HTTP URL with my localhost link.
Everything seemed to be fine by using
sudo port -v sync instead of sudo port -v selfupdate
Here's how the log started :
---> Updating the ports tree
Synchronizing local ports tree from http://localhost/ports.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 24.6M 100 24.6M 0 0 98.9M 0 --:--:-- --:--:-- --:--:-- 99.1M
x ports/
x ports/gnome/
x ports/gnome/gnofract4d/
x ports/gnome/gnofract4d/Portfile
x ports/gnome/gnofract4d/files/
x ports/gnome/gnofract4d/files/patch-setup.py.diff
x ports/gnome/gnofract4d/files/patch-win.diff
x ports/gnome/gnofract4d/files/patch-fract4d_fractconfig.py.diff
x ports/gnome/gnofract4d/files/patch-fract4d-c-imageIO.cpp.diff
x ports/gnome/libchamplain/
x ports/gnome/libchamplain/Portfile
x ports/gnome/gconf/
x ports/gnome/gconf/Portfile
x ports/gnome/goocanvas/
x ports/gnome/goocanvas/Portfile
x ports/gnome/gstreamer1-gst-libav/
.
.
.
But in the end, I got some errors :
.
.
.
x ports/net/daemonlogger/Portfile
x ports/net/dibbler/
x ports/net/dibbler/Portfile
x ports/net/dibbler/files/
x ports/net/dibbler/files/0-enable-prefix.patch
x ports/net/dibbler/files/1-correct-man-pages.patch
x ports/PortIndex_darwin_11_i386/
x ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.
Command failed: cd /opt/local/var/macports/sources/localhost/ports/.. && /usr/bin/tar -v -z -xf ports.tar.gz
Exit code: 1
Error: Extracting http://localhost/ports.tar.gz failed (command execution failed)
port sync failed: Synchronization of 1 source(s) failed
Now, I still cannot install any ports, and if I revert that default link in /opt/local/etc/macports/sources.conf to its original RSYNC one, everything returns to the way it was ( all errors, all messages, etc ... )
If I don't revert and go on using the file I have put on my localhost ( or using file:// to address the file directly ) , here's what happens when I try to install a port ( for example, Using sudo port install coreutils ) :
Port extract failed: ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.
while executing
"macports::fetch_port $path 1"
(procedure "macports::getportdir" line 12)
invoked from within
"macports::getportdir $source"
(procedure "macports::getindex" line 4)
invoked from within
"macports::getindex $source"
(procedure "_mports_load_quickindex" line 11)
invoked from within
"_mports_load_quickindex"
(procedure "mportinit" line 577)
invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, Port extract failed: ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.
I have Googled and read almost every solution that is suggested but NONE has worked out and I'm really stuck with this :(
Any NEW solution is really appreciated.
No replies, and I Found the solution myself!
The only way to redirect RSYNC requests through a proxy server is to tunnel over an L2TP VPN connection ( not PPTP ). That's the only way to make Macports work behind a proxy server.
Hope this can help other guys who are stuck with this weird connection method.
Instead of the main MacPorts mirror (which is sponsored by MacOSForge, which is run by Apple, which is thus bound to US law and export restrictions to Iran), you can use an alternate rsync mirror from the list at http://trac.macports.org/wiki/Mirrors.
If none of the rsync mirrors work for you, also read the FAQ entry for this very question: http://trac.macports.org/wiki/FAQ#selfupdatefails.

REE Installation

I am trying to Install Ruby EE on my machine but am not able to.
ping production.cf.rubygems.org also works. What may be the problem?
prashanth#prashanth-laptop:~/Downloads$ rvm install ree
Installing Ruby Enterprise Edition from source to: /usr/local/rvm/rubies/ree-1.8.7-2011.03
ree-1.8.7-2011.03 - #fetching (ruby-enterprise-1.8.7-2011.03)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 184 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0Warning: Failed to create the file ruby-enterprise-1.8.7-2011.03.tar.gz
0 7713k 0 16150 0 0 3108 0 0:42:21 0:00:05 0:42:16 17497
curl: (23) Failed writing body (0 != 16150)
ERROR: There was an error, please check /usr/local/rvm/log/ree-1.8.7-2011.03/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 184 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0Warning: Failed to create the file ruby-enterprise-1.8.7-2011.03.tar.gz
0 7713k 0 16150 0 0 4375 0 0:30:05 0:00:03 0:30:02 18692
curl: (23) Failed writing body (0 != 16150)
ERROR: There was an error, please check /usr/local/rvm/log/ree-1.8.7-2011.03/*.log
ERROR: There has been an error while trying to fetch the source.
Halting the installation.
Thanks.
The message:
Warning: Failed to create the file ruby-enterprise-1.8.7-2011.03.tar.gz
Is your clue. You're running a machine-wide install of RVM, but trying to install a new ruby as a user without root access.
Try:
rvmsudo rvm install ree
Or login as root and retry the command.

Resources