Error during SSH Session: Another Problem when deploying Agent to Raspberry Pi


#1

I’m trying to remotely deploy the ioFog Agent (v2) from a virtual Linux Box, where the Controller runs, to a Raspberry Pi on the same Network. SSH Login from the Linux Shell to the Raspberry Pi with the same Keyfile I’m using in my agent.yaml works fine, there is no Password used in the Key File.

When I issue this on the virtual Linux Box:

iofogctl deploy -f /tmp/agent.yaml

I get an Error “Error during SSH Session”

Looks like the ioFog Controller on the Linux Box isn’t permitting access for the ioFog Agent on the Rapberry Pi. What am I missing?

The Agent “raspi-1” listed in the screenshot is the one I was trying to provision.

I’ve followed the steps in the “Prepare Remote Hosts” Section of the Manual. The Remote User in my agent.yaml File is in the sudoers Group on the PI, and I’ve changed the sudoer file so that sudoers may issue commands without a Password. SSH Login to the Pi without Password also works from the Terminal on the Linux Box.


(Saeid) #2

Hi @mdolphin.

Could you please run iofogctl get all on your Linux box? The Agent on RPi is trying to connect to Controller on 0.0.0.0 which is not correct (it should be the IP address of your Linux box). Also, could you please share the yaml that you used to deploy the Control Plane?

Saeid


#3

You can see the ouput from “iofogctl get all” in the first Screenshot above. I’ve set up the control pane with the yaml File from the Local Deployment Tutorial here.

echo "---
apiVersion: iofog.org/v2
kind: LocalControlPlane
metadata:
  name: ecn
spec:
  iofogUser:
    name: Quick
    surname: Start
    email: user@domain.com
    password: q1u45ic9kst563art
  controller:
    container:
      image: iofog/controller:2.0.0

#4

LocalControlPlane is if you want to run the Controller and Agents as Docker images all on one machine.

You should deploy a regular control plane onto the Linux box. You could do this by running iofogctl on your laptop and using a deployment file like this:

https://iofog.org/docs/2/platform-deployment/remote-control-plane.html

Then, again from your laptop deploy the Agent to the Pi. It will get connected to the Controller on your Linux box.

Let us know how you get on.


#5

Thank you for your Reply, but now I’m totally confused, and don’t know how to ask the right questions. From the Architecture Overview Page it looks like Users will only issue commands using iofogctl directly at the Controllers Computer. But obvioulsy at least I can’t install the Controller directly on that Machine (apart from a LocalControlPane that isn’t useful apart from the local demo use case).

OK, then I’ve setup another Linux Box (named iofog-installer) just to install the Controller remotely on my Controller Machine (named iofog-controller).

After having installed the Controller remotely, I logged into that Machine (192.168.178.89) and tried to deploy an agent from there, but I got an Error: “Namespace default does not contain a Control Plane”. OK, went back to the Installer Machine, and deployed an Agent from there to my Raspberry Pi.

This it how looks like now when I issue “iofogctl get all” on my Installer Machine:

I can see the Controller on 192.168.178.89 and the Agent at 192.168.178.42, but the Agent seems not to be running.

This is how it looks on my Controller Machine:

Nothing there. Also you may notice in the first Screenshot, that I’m not able to connect remotely from the Installer to the Controller, because of the “namespace” Issue. Of course I’ve only used the default Namesppace yet.

Long Story short: OK, I’ve somehow set up my Controller remotely on 192.168.178.89 but I can’t do anything with it using iofogctl directly on that Machine. From what I read out of the the Architecture Overview, the Controller should be my main “go to” Point to manage the ECN, but currently I can’t do anything there.

I think, the main Problem I’m having with the Documentation that I don’t see what Commands needs to be issued from which Machine.


#6

Hi,

It looks like you are on the right track! Let me see if I can help get everything cleared up. These are the main parts to ioFog:

  • Agent: this is your “workhorse”. It is deployed onto a remote host (anywhere from a Cray Super computer, to a Pi0). It will receive instructions on what microservices to run from Controller. An Agent is only every connected to ONE controller.

  • Controller: this is the “brain” of your edge network. It mains the entire state of everything connected to it and is used to send commands/instructions to the Agents. A controller can have one to MANY agents. Generally, you install controller on it’s own host or cloud node. Most people run it somewhere in the public cloud so that all Agents can see it, but you can of course run it on your local network.

  • A collection of a Controller and some Agents is called an Edge Compute Network (ECN). You deploy Applications across your ECN. Applications are made up of multiple microservice that work together and are described in an application.yml file.

  • iofogctl is the automation and management tool for iofog. You generally run this locally. E.g. most people run it on their laptop or desktop from where they are developing or managing their ECNs. iofogctl can connect to multiple different ECNs giving you huge power in how you can manage multiple agents distribute across the world. You do NOT generally run this on the host that runs Controller or Agent. It is modeled on tools like Ansible and kubectl.

For your example, I would install iofogctl on your laptop, or whatever is local for you. Could of course be a very thin VM on your network (which seems to be what you did above). You can then create a new name space and start using it, e.g.

iofogctl create namespace test-space
iofogctl configure default-namespace test-space

Now, you can deploy your Controller to a remote host as before and it will get deployed into your test-space.

iofogctl deploy -f controller.yml

Next, deploy your Agent to Pi as before.

iofogctl deploy -f agent.yml

You now have a two node ECN. You can view it with iofogctl get all.

Note: if you want, you can combine controller and agent into single yml file and do:

iofogctl deploy -f test-space-ecn.yml

Using iofogctl you should generally never have a need to remote log in to your Controller host, and generally very little need to log into your Agent host (unless you are making OS/hardware config changes for some reason).

Hope this helps!


#7

Thanks again for your detailed aswers.

As also depicted in the Documentation you wrote: _"Controller: this is the “brain” of your edge network. It mains the entire state of everything connected to it and is used to send commands/instructions to the Agents. "

This, and the following Image let me misunderstood on how and where to use the Controller:

So instead of working directly on the Controller Machine, I issue Commands to the Controller(?) of a given Namespace remotely via iofogctl? But what if there is more than one Controller in that Namespace? (Don’t know if that would be useful anyhow) Even more important: How do I acces a Controller from another PC where iofogctl is installed? (i.e. my second Notebook) These Namespaces seem only to exist on the Machine where I created them.

**EDIT: ** OK, got it. iofogctl connect is your Friend

What is the Difference between a Namespace and an ECN? Do I switch the ECN I’m curently working with by switching Workspaces?

I know that I can move Microservices and Agents to different Namespaces (ECN’s?) using iofogctl move. But can I also move Controllers somehow? What if I accidently deployed a Controller to the wrong Namespace? Let’s say I want to move my Test Installation from the Screenshot above from “default” to another Namespace?

Are Agents automatically attached to Controllers in the same Namespace, or do I need to attach them manually with iofogctl attach?

I hope things will get clearer when I start to deploy Microservices to my Agents, as currently I can’t see what the Controllers are doing at all, because all the Provisioning and Managing of Agents is done by iofogctl Commands that I’m issuing from a Computer where there isn’t a Controller installed. (Well, I guess iofogctl is talking to the Controller in a given Namespace under the Hood, but that’s just guessing).


#8

Lots of great questions! Here are a few answers:

  • there is only ever one Controller per ECN
  • yes! ‘iofogctl connect’ is your friend! Also, iofogctl connect —generate’ makes it easy to connect from multiple machine
  • A namespace and ECN are synonymous. Yes, you ‘iofogctl switch’ to change which one you are working with
  • You can not move a Controller. You can only move Agents from one namespace/ecn to another. Technically this means detaching and attaching the Agents to different controllers. ‘iofogctl move’ makes this easy.
  • Agents are automatically attached to the Controller when you ‘iofogctl deploy’ them
  • You can ‘iofogctl rename’ a namespace if you want

And yes, while you could talk directly the Controller REST API, iofogctl makes all of this easy for you. It does indeed talk directly to the Controller. It is a very powerful tool. With it you can deploy and manage thousands of Agents deployed across the world from a single location.

Once you have your controller and agents deployed, you should try using iofogctl to deploy an Application.


#9

Thank you very much - again!

I think, I now understand the basic Principles. I also have a running Test Environment now, and will proceed with deploying and building some Microservice Apps.