Golang and NSQ (bitly) - go

So kind of a noob here but I can't seem to find any examples or help anywhere. I have a working instance of NSQ, can register tasks, consumers, etc. Unfortunately I did not originally set the system up. What I am trying to do is figure out how to activate some of the built in command line tools that NSQ offers ( nsq_to_file, nsq_tail, etc. ). I found documentation on how to fire them but have no idea where to fire them from.
When I try nsq_tail --channel=MyTestChannel --topic=test --lookupd-http-address=127.0.0.1:4161 i get nsq_tail command not found. The only other thing I know is that NSQ is managed by docker in our circumstance. Any help / a shove in the right direction would be awesome. Thanks!

Did some digging and answered my own question. Hopefully this helps someone since the docs dont really exist:
Make sure NSQ is running by checking out the dashboard: localhost:4171
Install the NSQ library (different than nsq-go) go get github.com/bitly/nsq
Install godep, how bitly manages dependencies go get github.com/tools/godep
Go to bitly src directory cd $GOPATH/src/github.com/bitly
Use docker to compile and test the nsq command line tools sudo docker build nsq
You should see about 5 or 6 steps run followed by a schlew of tests and a success message.
Run nsq_tail you should see something along the lines of --topic is required
Clap your hands, you just installed the command line tools for NSQ.
Might also need to install docker if you don't have it, not referenced above but FYI.

Related

kubectl not working on my windows 10 machine

When I try to run any kubectl command including kubectl version, I get a pop-up saying "This app can't run on your PC, To find a version for your PC, check with the software publisher" when this is closed, the terminal shows "access denied"
The weird thing is, when I run the "kubectl version" command in the directory where I have downloaded kubectl.exe, it works fine.
I have even added this path to my PATH variables.
thank you for the answer, #rally
apparently, in my machine, it was an issue of administrative rights during installation. My workplace's IT added the permission and it worked for me.
Adding this answer here so that if anyone else comes across this problem they can try this solution as well.
Not knowing what exactly you downloaded, i would suggest you to delete everying in the folder and follow the instructions for installing kubectl for Windows from here:
https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
Note: downloading the .exe is not enough. You need a kubeconfig file "config", which contains the configuration to access your cluster.
kubectl looks for this file in a hidden folder under your user profile directory. c:\users<me>.kube.
Just to let you try, i would suggest you to activate Kubernetes in your Docker-Desktop installation. I guess you have this installed. If not install it from the Dockersite. https://www.docker.com/products/docker-desktop/
Activating Kubernetes inside Docker-desktop, will install also kubectl and save the config in the .kube folder.
After the installation finished, in a new terminal:
kubectl get node
You should see the 1 node in the kubernetes-docker-desktop cluster.
Now if you want to access another cluster, you need the kubeconfig-file for that cluster. If you have it, just rename the config in the .kube folder (to not loose it) and put the other config inside.
If the new config file is correct you should be able to access that cluster.
The config file can be structured to hold more than one cluster configuration and you can switch between them using a so called context.
Here you can get the information how to do that, according to your needs:
https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
Hope this can help you, starting with KUbernetes.

Getting too many arguments in call to spdy.NewRoundTripperWithProxy error when i try to run my terratest go code for validating EKS cluster on AWS

Getting too many arguments in call to spdy.NewRoundTripperWithProxy error when i try to run my terratest go code which deploys, validates and un-deploys k8s pod to/from AWS EKS
My scripts were perfectly working fine 3 months back but looks like some library change happened in between these 3 months in k8s side which is affecting my scripts
Most problematic part is i am unable to find out at which line number my script is failing
go mod init and go go mod tidy are working fine but as soon as i run go test command getting the error as attached in the screen shot.
My code is present in Dropbox
I got resolution from gruntwork community which helped me to fix this issue
We need to call or use go get -u k8s.io/apimachinery#v0.20.6 command which pulls/sets required library to relevant version
Below steps are the resolutions for the current problem
go mod init
go get -u k8s.io/apimachinery#v0.20.6
go mod tidy -compat=1.17
go test -v -timeout 120m | tee test_output.log

Process killed when running npm install during file generation step of production guide (Canvas LMS)

I am trying to set up a canvas lms on an amazon ec2 Ubuntu environment. I've gone so far until the file generation step of the production environment guide. I've been able to successfully follow the steps until this point.
Steps to reproduce:
I was successful in making the asset directories and taking their ownership as directed in this step:
sysadmin#appserver:~$ cd /var/canvas
sysadmin#appserver:/var/canvas$ mkdir -p log tmp/pids public/assets public/stylesheets/compiled
sysadmin#appserver:/var/canvas$ touch Gemfile.lock
sysadmin#appserver:/var/canvas$ sudo chown -R canvasuser config/environment.rb log tmp public/assets \ public/stylesheets/compiled Gemfile.lock config.ru`
After this, I run 'npm install'
It is at this point that after getting some deprecated warnings I get stuck at this line:
canvas-lms#0.0.0 preinstall /home/ubuntu/canvas/script/gem_npm install
running npm install for gems/canvas_i18nliner/package.json
running npm install for gems/selinimum/package.json
Killed [ ..] / extract:lodash: sill gunzTarPerm modified mode [ 'fp/getOr.js', 420, 436 ]'
What I've already tried:
First I thought it was an error with the port 9418/tcp not being open. I opened this port through amazon ec2 security group inbound rules. This did not work. Then I tried opening all the ports 1-65000 to fix this. It still did not work.
Additional notes:
From the looks of it, it does not looks like a port issue because the script is able to fetch data in the previous steps. Also from the progress bar it can be seen that the extract is failing only when the last 2 dots are left as the progress bar is shows like this: [ ..]. I'm guessing this is a .js creation erorr.
The documentation provides a link to fix those issues but the description of the steps to follow are not very elaborate there as I can't understand what exactly i need to do. Can someone please look into this and help me? Any help is much appreciated.
The File Generation section in the production guide says to follow this link to fix .js creation issues. The solution I found in this link was to add the following code to the compile_template function found in lib/handlebars/handlebars.rb file. The directory lib/handlebars does not exist in /lib
def compile_template(source, id, plugin=nil)
require 'execjs'
require 'multi_json'
P.S. I downloaded my installation directly from the git repository so no chance of this being missing for some reason :/

How to check Mesos Master?

I'm new to Mesos. I would like to know how do I know whether Mesos master is set up correctly in the node?
I have follow the set up given by http://mesos.apache.org/gettingstarted/
I am unable to run the following command:
Comment: Start mesos master (Ensure work directory exists and has proper permissions).
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
but it shown error given:
./bin/mesos-master.sh: line 24: /home/user/mesos-0.20.0/build/src/mesos-master: No such file or directory
What ways should I proceed?
First, a few questions to help us debug your build:
Did the mesos build (make) complete successfully, and did make check pass all the tests?
If /home/user/mesos-0.20.0/build/src/mesos-master does exist, do you have execute permissions on it?
Are you running ./bin/mesos-master.sh from within /home/user/mesos-0.20.0/build/, or did you move the directory elsewhere?
If this is your first attempt at Mesos and you just want to run it and try it out (rather than fix bugs and develop features for it). I would recommend using a pre-built or cloud-deployed version of Mesos, rather than trying to build it yourself. See:
http://mesosphere.com/downloads/
http://mesosphere.com/downloads/details/index.html#apache-mesos
I'd suggest to follow Mesos Getting Started documentation.
After your system requirements are satisfied, following the section:
System Requirements
Once you reach the following section:
Building Mesos
when you execute the make without disabling verbosity, ensure that all process completed successfully. If it stops (e.g. tipically for proxy related issues) try to fix it accordingly or otherwise post your stack somewhere and I would be happy to help (if I can).
Unfortunately, running make check could not reveal the problem sometimes.
Have you run the make check command ? It is said in the documentation that the binaries will only be available after running the make checkcommand.Ì faced the same issue and it was because i didn't run that command.

TeamCity: How to show parameters in the history

I have 3 servers for PROD, with the same deployment build configuration, I choose which server to deploy depending on a build parameter.
The issue is that reviewing the history you can't check which environment are you deploying.
I wonder if it's possible one of this solutions:
- Show parameters in the history of a build
- Autotag a build with parameters
I hope I had explained well enough.
Thanks in advance
You can accomplish this with a Command Line build step that echoes the relevant parameters to the build log. For a Windows-based agent, you could do something like:
Run: Executable with parameters
Command Executable: echo
Command Parameters: Deployed to server %your.server.host%
This would simply add a line to the build log that reads, Deployed to server FOO
Autotagging would be pretty cool, but I don't know of a way to do that.

Resources