Integrating InfluxDB with ONOS - influxdb

I have followed all the steps in https://wiki.onosproject.org/display/ONOS/InfluxDB+Report+and+Query+Application , but I can't integrate ONOS with InfluxDB.
After configuring all that's in the documentation, I execute "SHOW MEASUREMENTS" in InfluxDB and nothing is showing, because the database I created is empty, ONOS does not publish the metrics in it.
Is there anything any configuration file I must edit in order to run correctly?
Thank you so much for your help.

I tried the documentation, it has some missing information. Here is what i did:
My OS is Ubuntu:
yavuz#ubuntu:/opt/onos/apache-karaf-3.0.8/data/log$ uname -a
Linux ubuntu 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I've installed influxdb version 0.10.0
Note that ONOS supports InfluxDB up to 0.10.3. The InfluxDB which has
higher version number will not work properly with ONOS.
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt-get install influxdb=0.10.0+dfsg1-1
sudo service influxdb start
sudo apt-get install influxdb-client
Create onos database on influx
yavuz#ubuntu$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.10.0
InfluxDB shell 0.10.0
CREATE DATABASE onos
use onos
CREATE USER onos WITH PASSWORD 'onos.password' WITH ALL PRIVILEGES
Now, influxdb is ready. Then, I installed ONOS 1.10.2:
cd /opt
sudo wget -c http://downloads.onosproject.org/release/onos-1.10.2.tar.gz
sudo tar xzf onos-1.10.2.tar.gz
sudo mv onos-1.10.2 onos
sudo /opt/onos/bin/onos-service start
Be sure to run ONOS with sudo, otherwise influxdb gives permission
errors.
After getting ONOS console install influxdb feature: (this is missed in documentation)
feature:install onos-apps-influxdbmetrics
Activate application
app activate org.onosproject.influxdbmetrics
Last trick, default influxdb address is localhost and it causes parsing errors, you can set this value to 127.0.0.1
cfg set org.onosproject.influxdbmetrics.InfluxDbMetricsConfig address 127.0.0.1
You can tail the karaf.log to control if an error occurs during these steps. After few seconds, here is the query result
Hope this helps.

Related

unable to verify that docker engine is installed by reaching pull rate limit

I wanted to install docker on my laptop to test and run my web applications on it's containers instead of virtual environment (I am running ubuntu desktop version 20.04 LTS and using pipenv for virtual environment). After signing up at hub.docker I went to https://docs.docker.com/engine/install/ubuntu/(hub.docker manual to install docker on ubuntu), I decided to install using the repository and typed following commands in terminal
1.sudo apt-get update
2.sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
3.curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.apt-key fingerprint 0EBFCD88
after running last command I got desired result which was
" pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) docker#docker.com
sub rsa4096 2017-02-22 [S]"
As my system is amd64 I continued by
5.sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
6.sudo apt-get update
7.sudo apt-get install docker-ce docker-ce-cli containerd.io
8.sudo docker run hello-world
then at this point I got
"Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.
See 'docker run --help'."
Questions
Did I do anything wrong in installation process?
How can I run to pull rate limit when I have just installed it?
Have docker correctly installed on my laptop? (when I type docker --version in terminal I get "Docker version 20.10.2, build 2291f61"
What should I do now?
I just installed docker myself and encountered the same error.
I don't think you have installed it wrong (since I'm a newbie myself I cannot confirm it 100%), but I solved this error by creating an account in docker website and then logged-in from CLI.
to create an account go to: https://www.docker.com/pricing
and then use signup for free.
To login through CLI type:
docker login -u your-username
and then it asks for your password, and then you are good to go!

WSL: Can't install docker on WSL 2, Ubuntu 18.04

I've searched lots of related posts on here and other site but anything didn't solve my problem.
As mentioned on title I'm struggling to install docker on linux subsystem on window OS
I'm with win 10 home edition so I've already installed Docker tool box, and my wsl is version 2 with Ubuntu 18.04
I was following the instructions and everything was fine until I did:
~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
Is there anyone who had same difficulty but solved this problem?
Thank you in advance!
The issue is because of a real-time clock issue with the Glibc library under the WSL v1 setup. WSL v2 may fix this under the hood and you may not run into the issue in future.
Now you can fix Glibc manualy:
$ sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
$ sudo apt update
$ sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 -y
$ sudo apt-mark hold libc6
//Remove "-y" if needed on above step #3.
//And when asked, give "y" and hit enter.
The above set of commands will add the latest version of the Glibc library and put the stable library on hold, until needed to reenable.
You can track this issue https://github.com/microsoft/WSL/issues/5125

docker login fails on a server with no X11 installed

I am trying to deploy a docker configuration with images on a private docker registry.
Now, every time I execute docker login registry.example.com, I get the following error message:
error getting credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY
The only solution I found for non-MacOS users was to run export $(dbus-launch) first, but that did not change anything.
I am running Ubuntu Server and tried with both the Ubuntu Docker package and the Docker-CE package.
How can I log in without an X11 session?
Looks like this is because it defaults to use the secretservice executable which seems to have some sort of X11 dependency for some reason. If you install and configure pass docker will use that instead which seems to solve the problem.
In a nutshell (from https://github.com/docker/compose/issues/6023)
sudo apt install gnupg2 pass
gpg2 --full-generate-key
This generates a you a gpg2 key. After that's done you can list it with
gpg2 -k
Copy the key id (from the line labelled [uid]) and do
pass init "whatever key id you have"
Now docker login should work.
There are a couple of bugs logged on launchpad regarding this:
https://bugs.launchpad.net/ubuntu/+source/golang-github-docker-docker-credential-helpers/+bug/1794307
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
This works: sudo apt remove golang-docker-credential-helpers
You can remove the offending package golang-docker-credential-helpers without removing all of docker-compose.
The following worked for me on a server without X11 installed:
dpkg -r --ignore-depends=golang-docker-credential-helpers golang-docker-credential-helpers
and then
echo 'foo' | docker login mydockerrepo.com -u dockeruser --password-stdin
Source:
bug reported in debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910823#39
bug reported on ubuntu:
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
secretservice requires a GUI. You can use pass without a GUI.
Unfortunately, Docker's documentation on how to configure Docker Credential Helpers is quite lacking. Here's a comprehensive guide how to configure pass with Docker (tested with Ubuntu 18.04):
1. Install the Docker Credential Helper for pass
Find the url for the latest version of docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases . For example:
# substitute with the latest version
url=https://github.com/docker/docker-credential-helpers/releases/download/v0.6.2/docker-credential-pass-v0.6.2-amd64.tar.gz
# download and untar the binary
wget $url
tar -xzvf $(basename $url)
# move the binary to a dir in your $PATH
sudo mv docker-credential-pass /usr/local/bin
# verify it works
docker-credential-pass list
2. Install and configure pass
apt install pass
# create a gpg2 key
gpg2 --gen-key
# if you have issues with lack of entropy, "apt install haveged" and try again
# create the password store using the gpg user id above
pass init $gpg_id
3. docker login
docker login
# You should not see any credentials stored in "auths" section.
# "credsStore": "pass" should have been automatically added.
# If the value is "secretservice", replace it with "pass".
cat ~/.docker/config.json
# verify credentials stored in `pass` store now
pass
There is a much easier answer than the ones already posted, which I found in a comment on https://github.com/docker/docker-credential-helpers/issues/105.
The solution is to rename docker-credential-secretservice out of the way
e.g: mv /usr/bin/docker-credential-secretservice /usr/bin/docker-credential-secretservice.broken
Once you do this, docker login works regardless of whether or not docker-compose is installed. No other package additions or removals are necessary.
I've resolved this issue by uninstalling docker-compose which was installed from Ubuntu repo and installing docker-compose by official instruction at https://docs.docker.com/compose/install/#install-compose
What helped me on Ubuntu 18.04 was:
Following the steps in #oberstet 's post and uninstalling the golang helper
Performing a login after the helper uninstall
Reinstalling docker via sudo apt-get install docker
Logging back in via sudo docker login

docker Error with pre-create check: "We support Virtualbox starting with version 5

I'm trying to create docker machine host using the following command in fedora OS version 25.
docker-machine create -driver=virtualbox host01
I get below error while executing the command.
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is \"WARNING:
The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (4.10.12-200.fc25.x86_64) or it failed to load.
Please try load the kernel module by executing as root
dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
You will not be able to start VMs until this problem is fixed.\\n5.1.26r117224\".
Please upgrade at https://www.virtualbox.org"
I have already virtualbox latest version installed. Running the command suggested by
sudo dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
I got the below error
Last metadata expiration check: 0:48:35 ago on Thu Aug 17 22:38:47 2017.
Package akmods-0.5.6-7.fc25.noarch is already installed, skipping.
No package --kernels available.
No package 4.10.12-200.fc25.x86_64 available.
Any suggestions?
I also had this problem and for this I upgrade Virtual box to 5.2 using following commands. This link help me
sudo apt-get remove virtualbox virtualbox-5.1
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.2
Hope this helps.
For windows users, in 2022 such problem still exists. So for those who use last build (now it is virtualBox-6.1.32-149290-Win), try to use version that starts with prefix 5. But not all '5' versions work. For example, for me worked only version 5.2.42 while versions: 5.2.18, 5.2.20, 5.2.44 didn't work
Helped for win 11 x64

Vagrant - Rails Not Installed

I recently had to destroy and recreate my Vagrant instance. Now I can't run any rails command as it says Rails is not installed. When I did
Vagrant Up
I got the following error
default: /tmp/vagrant-shell: line 1: /home/vagrant/.rvm/scripts/rvm: No such file or directory
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
My Provision.sh file contains the following:
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main " | sudo tee -a /etc/apt/sources.list.d/pgdg.list
sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get remove postgresql-client-9.1 postgresql-client-common postgresql-client postgresql-common -y
sudo apt-get install postgresql-9.3 postgresql-client-9.3 libpq-dev curl git build-essential libxslt-dev libxml2-dev -y
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
curl -sSL https://get.rvm.io | bash -s stable --ruby
cat << EOF | sudo tee -a /home/vagrant/.bashrc
cd /vagrant
EOF
echo '# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust' | sudo tee /etc/postgresql/9.3/main/pg_hba.conf
echo 'machine api.heroku.com
login *****
password ****
machine code.heroku.com
login *****
password *****
' | tee /home/vagrant/.netrc
echo 'ssh-rsa ***** vagrant#precise32
' | tee /home/vagrant/.ssh/id_*****.pub
chmod 0600 /home/vagrant/.netrc
sudo -u postgres psql -c "create user ***** createdb createuser password '*****';"
sudo /etc/init.d/postgresql restart
I have seen some answers (not specific to Vagrant) suggesting that I must have installed rvm using sudo or as root and need to remove it and then get rvm again. I have tried to do that butI'm not sure how it applies to a vagrant box and at any rate I must have done it wrong as it hasn't worked.
Is there something I need to correct/add to my provision.sh file or to my Vagrantfile?
Vagrant runs the provisioning file as root, so you would have indeed installed rvm as root unless you specified otherwise*. This was quite confusing for me as well (also a newbie), I would install things during provisioning and they would "disappear". In fact, they were all being installed / set as root.
*Or, you manually installed rvm when ssh'd into the machine, which I'll touch on more below.
You can switch your user using su -c "source /home/vagrant/myapp/vagrant/user-config.sh" vagrant
What goes in the "" is any command you want to execute. In this case, we're switching to a separate shell file user-config.sh that contains all the commands that should not be run as root, such as installing RVM.
I also sense somewhat of a conceptual misunderstanding. Each time you do vagrant destroy your entire virtual machine is destroyed, hard drives and all. The next time you do vagrant up, everything is rebuilt from scratch. If you had ssh'd in and installed things, they'll no longer be there.
This means that all of your install and config goes into the provisioning file, and you shouldn't be installing things manually after the fact. You should be able to vagrant destroy any time you want.
Take a read through https://coderwall.com/p/uzkokw/configure-the-vagrant-login-user-during-provisioning-using-the-shell-provider once more, I'm hoping it makes more sense this time around.
May be this link helps you to install rvm using Vagrant.
RVM_Vagrant

Resources