Installing Tango 9.3.4 on Ubuntu LTS 20.04

Profiting from the break from zoom meetings I tried out the latest version (V9.3.4) of the source code release of Tango controls on a virgin Ubuntu LTS 20.04. Here are my notes:

1. Download source tarball from github:
   wget https://github.com/tango-controls/TangoSourceDistribution/releases/download/9.3.4/tango-9.3.4.tar.gz

2. Unpack in a sub-directory called tango (so I can test multiple versions in the future):
   mkdir tango
tar xzvf tango-9.3.4.tar.gz

3. Install packages required to compile tango-controls:
   sudo apt-get install g++ openjdk-8-jdk mariadb-server libmariadb-dev zlib1g-dev libomniorb4-dev libcos4-dev omniidl libzmq-dev make

4. Start mariadb :
   sudo service mariadb start

5. Set password for mariabdb root user to 'mypassword':
   sudo mariadb -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
UPDATE mysql.user SET authentication_string = '' WHERE user = 'root';
UPDATE mysql.user SET plugin = '' WHERE user = 'root';

6. Configure tango-controls to build and install in /usr/local/tango:
   ./configure –enable-java=yes –enable-mariadb=yes –enable-dbserver=yes –enable-dbcreate=yes –with-mysql-admin=root –with-mysql-admin-passwd='mypassword' –prefix=/usr/local/tango

7. Compile tango-controls:
   make

8. Install tango-controls:
   sudo make install

9. Add following lines to start script /usr/local/tango/bin/tango:
   sudo gedit /usr/local/tango/bin/tango
export MYSQL_USER=root
export MYSQL_PASSWORD=mypassword

10. Start tango-controls database server:
    sudo /usr/local/tango/bin/tango start

11. Start test device server:
    /usr/local/tango/bin/TangoTest test &

11. Test jive:
    export TANGO_HOST=localhost:10000
/usr/local/tango/bin/jive

12. You can now define your device servers and devices, start and test them - ENJOY!

Two issues that will need fixing in the next releases are:
1. Add the MYSQL_USER and MYSQL_PASSWORD to the tango startup script
2. Suppress the TANGO_HOST undefined message which is not relevant


Questions and feedback welcomed!

Cheers

Andy
Hi Andy,

I've given this a go and it seems to work - just two minor points:

1. The libzmq-dev package does not seem to be available any more, at least on my freshly-downloaded Ubuntu 20.04.4 .iso. I used libzmq3-dev instead.

2. In step 11 (actually there are two steps numbered 11!) the TANGO_HOST env. var. needs to be set before the TangoTest device server is started.

Other than that it works well!

Thanks,
Jack
Hi Nico,
looks like the package list in your PC is not updated. Try executing "sudo apt-get update" before…
Edited 2 years ago
Hello,
I try 5. Set password for mariabdb root user to 'mypassword':
I get an error ERROR 1356 (HY000) View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them.
Where is mistake.? does anyone know?
smile
Hi Dariusz,

Do you know what version of MariaDB you are using?
On recent MariaDB versions, mysql.user is a view rather than a table. Please have a look at this stackoverflow answer: https://stackoverflow.com/a/64841540/4215114
It looks like we'll have to update our documentation for the recent MariaDB version. smile
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hello!

Relatively new to TANGO here and have decided to build and install from scratch on a RHEL7 machine.
I have followed the instructions in TANGO 9.3.4 README and was about to work through all of the build/install issue. The build configuration command line:

$ ../configure –enable-mariadb –with-mysql-ho=localhost –with-mysql-admin=root –with-mysql-passwd=

The Configuration resulted in:

Configuration (tango):

Source code location: ..
Version: 9.3.4
Compiler: gcc,g++

OMNIORB PATH: /usr
OMNIORB VERSION:

ZMQ PATH: /usr/local
ZMQ VERSION: 4.3.2

JAVA PATH: /usr/bin/java
JAVA VERSION: 1.8.0_181

Database MARIADB
CLIENT LIB: -lmariadb
CLIENT VERSION:
VERSION: 10.10.2-MariaDB
CONNECTION: OK

build:
libraries: yes
java application: yes
access control server: yes
database server: yes
database schema create: yes

Please check whether the configuration I detected matches what you
would like to have.

The problem occurs in the Runtime and is database related. I try:

-bash-4.2$ DataBaseds 2 -ORBendPoint giop:tcp::10000
main(): arrived
main(): export DataBase as named servant (name=database)
Received a CORBA::Exception
Tango exception
Severity = ERROR
Error reason = DB_DeviceNotDefined
Desc : device sys/database/2 not defined in the database !
Origin : DataBase::ExportDevice()

Exiting

And can go no further (TantoTest test fails)

I know very little about databases but could do a basic query. It appears that a tango as well as test database were created
Your MariaDB connection id is 550
Server version: 10.10.2-MariaDB MariaDB Server

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
| sys |
| tango |
| test |
+——————–+
6 rows in set (0.003 sec)

Not sure what to try next. Has anyone else run into this problem?

UPDATE: This problem was resolved. For reasons still not clear to me, I needed to run the update_db.sql as suggested by my build output. This solved the problem with my DataBaseds errors.
Edited 1 year ago
Do you have the TANGO_HOST environment variable defined?
Maybe it's just a matter of doing
export TANGO_HOST=my_host:10000
before launching the Database server?
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Reynald
Do you have the TANGO_HOST environment variable defined?
Maybe it's just a matter of doing
export TANGO_HOST=my_host:10000
before launching the Database server?

Thanks for your response ..

The problem was resolved today when I noticed my build output suggested I run "update_db.sql". I did this and now I can start the TANGO database.
-bash-4.2$ tango start
Starting TANGO database
Starting TANGO Database Server
main(): arrived
main(): export DataBase as named servant (name=database)
Ready to accept request

However, I ran into a problem with the next step:

-bash-4.2$ TangoTest test
The device server TangoTest/test is not defined in database. Exiting!

TANGO_HOST is setup properly ( I hope ):
-bash-4.2$ echo $TANGO_HOST
localhost:10000

I tried using a "verbose" mode but its not too helpful:
-bash-4.2$ TangoTest test -v100
Entering Logging::init
TANGO_LOG_PATH is /tmp/tango-pwhiteis
cmd line logging level is 100
Logging::create_log_dir(/tmp/tango-pwhiteis/TangoTest/test) returned -1
added console target (logging level set from cmd line)
Leaving Logging::init
1676063015 [139628767930176] DEBUG dserver/TangoTest/test Connected to database
1676063015 [139628767930176] DEBUG dserver/TangoTest/test Entering Util::server_already_running method
The device server TangoTest/test is not defined in database. Exiting!

I am not sure what to try next ..
Edited 1 year ago
Hi,

You can run
TangoTest -?
to see all the instances of Test device server defined in your Tango Database.
If none is defined, you need to add a new instance, following this documentation: https://tango-controls.readthedocs.io/en/latest/tutorials-and-howtos/how-tos/how-to-start-device-server.html

You can also use the tango_admin tool to define some device servers in the Tango database. For instance, to add a new TangoTest instance named my_test, managing 1 device of TangoTest class named my/tg_test/device, you can run:

tango_admin –add-server TangoTest/my_test TangoTest my/tg_test/device


Hoping this helps,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
 
Register or login to create to post a reply.