Follow the installation on : https://bitbucket.org/hzgwpn/mtangorest.server/wiki/Home. (for .jar). (For information my tango host is on local)
TANGO_ACCESS → tango://127.0.0.1:20000/sys/access_control/1
TANGO_DB → tango://127.0.0.1:20000/sys/database/2
TOMCAT_PORT -->8844
Export DatabaseDS, and load it to create a TangoAccessControl server
TangoAccessControl
1
TangoAccessControl
sys/access_control/1
(For this step, you will need to update “database” by “tangoAccessControl”).
On jive, click on edit, then create free property named “CtrlSystem”. Then go to property (last tab), click on CtrlSystem, add a new property named “Services” with the value
AccessControl/tango:sys/access_control/1
define a tomcat user in C://apache-tomcat-8/conf :
Go to $Tango_home/bin and launch with a command line “TangoAccessControl.exe 1”
Go to C://apache-tomcat-8/webapp and launch with a command line “java -jar -DTANGO_HOST=127.0.0.1:20000 mtango.server-rc4-0.4.jar test”
Open Jive, then open an atk panel on TangoControlAccess DS, then test device, and execute the AddDeviceForUser command with “[“tango-cs”,“sys/database/2”, “write”]” as parameter.
Also, add a new environment variable name SUPER_TANGO with the value true.
Then go on Astor, tool and open AccessControl HMI. Add ... as allowed address for the user tango-cs.
Try your mtango server instance by the URL : http://127.0.0.1:8844/tango/rest (enter username: tango-cs, password : tango if necessary).
Time to try the tango webapp. try to go to the URL : http://127.0.0.1:8080/TangoWebapp. Get logged, then at the top enter as rest host : http://127.0.0.1:8844. (http:// is important), and as host : $Tango_host. Then refresh the page via f5. You should have an access to the device tree.
After i complete step 5, then can not start TangoAccessControl server (step 8):
[ics@localhost ~]$ TangoAccessControl 1
Tango exception
Severity = ERROR
Error reason = API_ReadOnlyMode
Desc : Command DbExportDevice on device sys/database/2 is not authorized because an error occurs while talking to the Controlled Access Service
Origin : Connection::command_inout()
Tango exception
Severity = ERROR
Error reason = API_CommandFailed
Desc : Failed to execute command_inout on device sys/database/2, command DbExportDevice
Origin : Connection::command_inout()
Received a CORBA_Exception
Exiting
because i can not start TangoAccessControl server, so jive also report error!
In step 4, [quote](For this step, you will need to update “database” by “tangoAccessControl”).[/quote], i want to know what is it meaning?
Thank you in advance for help.
The TangoAccessControl device server should ideally be started from a script.
For instance, with the Tango source distribution, there is a script named tango_wca (located in /usr/local/bin by default) which will start MySQL, the DatabaseDs and TangoAccessControl device server.
This script will do an
export SUPER_TANGO=true
before starting the TangoAccessControl device server, this is essential to avoid the errors you are currently seeing.
The other device servers must be started without this SUPER_TANGO environment variable defined.
[quote=“Jimmy”]In step 4,
(For this step, you will need to update “database” by “tangoAccessControl”).[/quote]
I agree with you about step 4. I don’t understand this sentence.
As I wrote this environment variable should be set to true only when TangoAccessControl is started.
When running jive or any other device server or client, it should not be set if you want the Tango Access Control to work as expected.
Of course, you need to configure the access permissions in Tango Access Control for the different users properly using Astor, as explained on this page: http://tango-controls.readthedocs.io/en/latest/administration/services/access-control.html
@Jimmy, if you want just to give a try. You may skip TangoAccessControl in your deployment at all. Just set TANGO_ACCESS TangoRestServer’s device property to “none”:
I meant you have to export your database DS (Right click on your server name / Serve server data), then edit it with some edit and replace “Database” by “access_control”.
As it’s not so easy, I joined my access control device.
So basically, step 4 is to define TangoAccessControl device server and its devices in the Tango database.
This could be done by loading a file from jive as you are suggesting, or can be done via Jive → Edit menu → Create Server, as described on this documentation page: http://tango-controls.readthedocs.io/en/latest/tools-and-extensions/jive/servers.html
[quote=“Reynald”]As I wrote this environment variable should be set to true only when TangoAccessControl is started.
When running jive or any other device server or client, it should not be set if you want the Tango Access Control to work as expected.[/quote]
I find why i have to set SUPER_TANGO to true before run jive, it’s hostname’s format.
On my CentOS 7 (tango 9.2.5 + omniorb 4.2.1 + zmq 4.2.1), i define hostname as “localhost.localdomain” in /etc/hosts, and define TANGO_HOST in /etc/tangorc by hostname
[ics@localhost ~]$ jive
Host name/address cannot be determined !
then in jive, can’t access any device information (seemly jive not correctly retrieve data from tango DB). if I don’t configure TAC, everything is ok!
If i edit hostname in /etc/hosts and /etc/tangorc
/etc/hosts:
Hi Jimmy,
besides the issues with the TANGO_HOST env variable, the /etc/hosts file content you’re showing looks wrong. Hosts file is supposed to contain one line for each host, with the following information:
Internet-address OfficialHostname Aliases
The official hostname may or may not include the complete domain name.
But… your first configuration is basically assigning two different IP addresses to localhost, which won’t work.
(and localhost s really just for 127.0.0.1).
Cheers,
Lorenzo