Hi Alex,
Thanks a lot for the help. I try to run OpenSAF in a single node
environment.
It turned out that the failure of message sample program is due to
nodes.cfg. Initially, I created a two-node configuration with
"immxml-clustersize -s 2" with the assumption that two controllers are
required. After re-creating nodes.cfg with one controller using
"immxml-clustersize -s 1", the sample program works.
Although the root cause may be identified, I still don't know the
reason/mechanism behind the failure. In my opinion, a two-controller
configuration file should be allowed. The topology may have two controllers but
my app just uses one.
Feng
From: Alex Jones <[email protected]>
Sent: Friday, March 16, 2018 1:52 PM
To: Feng Xie <[email protected]>
Cc: [email protected]
Subject: Re: Opensaf-users Digest, Vol 58, Issue 10
Hi Feng,
How many nodes are you running? Just 1 controller?
Look in /var/log/messages for output from msgd and msgnd. These implement
the MSG subsystem. Maybe there is something wrong with how they started up.
Alex
From: Feng Xie
Sent: Thursday, March 15, 2018 4:25 PM
To: Anders Widell <[email protected]>;
[email protected]; [email protected]
Cc: Feng Xie <[email protected]>
Subject: Errors in running OpenSAF message sample
Hi,
Thanks a lot to Anders' suggestion. After downgrading from Python 3 to Python
2.7, the errors in running immxml-configure were resolved!
I was able to start OpenSAF related demos and compile sample programs. The
first OpenSAF sample program I ran is msg_demo under
~/local/share/opensaf/samples/mqsv. The sample was run in a single-node Ubuntu
VM. However, I encountered error code 2 from saMsgInitialize. I checked the
source code in ~/src/msg/agent/mqa_api.cc, it seems that error code 2 maps to
SA_AIS_ERR_LIBRARY. There are may occurrences of it. I am stuck at this step.
Any help will be highly appreciated!
In addition, I have two additional questions:
1. Is there a timer service provided by OpenSAF?
2. How to turn on internal tracing when running OpenSAF sample programs?
The output from ./amf-state, error messages and opensaf demos are attached
at the end of the email for reference. Thanks.
Feng
1. Error messages when running msg_demo
On one terminal (as a receiver):
~/local/share/opensaf/samples/mqsv$ sudo msg_demo 0
STARTING THE MQSv DEMO
======================
MessageQ Receiver Application
#####################################################################################
DEMO SCENARIO#1: Receiving messages via Sync API - saMsgMessageGet START
Error Initialising saMsgInitialize with error - 2Press Enter Key to Continue...
On the other terminal (as a sender):
~/local/share/opensaf/samples/mqsv$ sudo msg_demo 1
STARTING THE MQSv DEMO
======================
MessageQ Sender Application
##########################################################################
SCENARIO#1:Sending Messages via Sync API - saMsgMessageSend START
Error Initialising saMsgInitialize with error - 2Press Enter Key to Continue...
##########################################################################
1. OpenSAF related demos
~/local/share/opensaf/samples/mqsv$ ps -A
........
2697 ? 00:00:00 osafdtmd
2705 ? 00:00:00 osaftransportd
2713 ? 00:00:00 osafclmna
2724 ? 00:00:00 osafrded
2735 ? 00:00:00 osaffmd
2747 ? 00:00:00 osafimmd
2760 ? 00:00:03 osafimmnd
2777 ? 00:00:00 osaflogd
2791 ? 00:00:00 osafntfd
2803 ? 00:00:00 osafclmd
2815 ? 00:00:00 osafamfd
2833 ? 00:00:00 osafamfnd
2853 ? 00:00:00 osafsmfd
2855 ? 00:00:00 osafsmfnd
2883 ? 00:00:03 osafmsgnd
2896 ? 00:00:00 osafmsgd
2957 ? 00:00:00 osaflckd
2967 ? 00:00:00 osaflcknd
2994 ? 00:00:00 osafckptnd
3002 ? 00:00:01 osafevtd
3017 ? 00:00:01 osafckptd
3022 ? 00:00:00 osafamfwd
......
1. Output of amf-state
~/local/bin$ ./amf-state
Service Instances UNLOCKED and UNASSIGNED:
safSi=NoRed2,safApp=OpenSAF
Service Units UNLOCKED and DISABLED:
safSu=SC-2,safSg=2N,safApp=OpenSAF
safSu=SC-2,safSg=NoRed,safApp=OpenSAF
Nodes UNLOCKED and DISABLED:
safAmfNode=SC-2,safAmfCluster=myAmfCluster
From: Anders Widell
<[email protected]<mailto:[email protected]>>
Sent: Thursday, March 8, 2018 7:20 AM
To: Feng Xie <[email protected]<mailto:[email protected]>>; Dheeroj Ram
<[email protected]<mailto:[email protected]>>;
[email protected]<mailto:[email protected]>;
[email protected]<mailto:[email protected]>
Subject: Re: Errors in running immxml-configure with OpenSaf 5.3 in a Ubuntu VM
Just a wild guess: maybe your Linux distribution installs Python version 3 as
default? We haven't fully converted our Python code to be compatible with
version 3 yet (it ought to be done, though). Could you run 'python --version'
to check your default version. If it is version 3, you probably need to install
version 2 and use it to run the OpenSAF Python code.
OpenSAF supports running in virtual machines.
regards,
Anders Widell
On 03/07/2018 09:59 PM, Feng Xie wrote:
Hi Dheeraj, Gary and Anders,
Thanks a lot for the quick response! With your help, I was able to solve
the original issue of locating the share libraries. The current issue I am
facing now is with immxml-configure, which failed in File "./immxml-merge",
line 370, in save_result
self.imm_content_element.toxml(encoding).replace("/>", ">") + "\n"). As a
result, IMMD can't be started. My debug procedure and detailed error messages
are attached at the end for your reference. I am stuck at this step. Any help
will be highly appreciated!
Let me provide some background information about my current effort so
that you can better understand my situation:
1. I am trying to use opensaf for core middleware services like messaging
(IPC), log, timer, etc.. The target environment is a single-node multicore
(ARM) Linux embedded system. If opensaf works in a single-node environment, we
may extend to a cluster environment in the future.
1. I created a virtual machine using VMWare on a X86 Dell PC with ubuntu
Linux and installed the latest opensaf tarball (OpenSAF package
opensaf-5.18.02.tar.gz in a Ubuntu Linux VM (Linux version 4.4.0-116-generic
(buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.9));
1. As part of proof of concept, my goal is to start opensaf related daemons
in such single-node VM environment and run several sample programs.
1. The installation/configuration procedure I follow is exactly as Anders
suggested:
https://sourceforge.net/p/opensaf/wiki/OpenSAF%20as%20an%20application/. I did
not try any extra advanced configuration yet. Thus, I have NOT changed
nid.conf. The underlying transport is still TCP. The OPENSAF_GROUP/USER are
still "opensaf". The node_type is "controller" and the node_name is
"feng-opensaf-2".
By the way, from the above website, I saw a statement like "Note no sudo
or virtualization!". Does it mean that OpenSAF can't be run in a VM
environment? Thanks again for your help!
Feng
P.S.
Procedure and error messages:
fxie@feng-opensaf-2:~/local/share/opensaf/immxml$ sudo ./immxml-configure
error: immxml-merge SC templates failed. Aborting script! exitCode: 1
fxie@feng-opensaf-2:~/local/share/opensaf/immxml$
I was able to locate a log file under /tmp/immxml_configure. LFwfeK:
root@feng-opensaf-2:/tmp/immxml_configure.LFwfeK#<mailto:root@feng-opensaf-2:/tmp/immxml_configure.LFwfeK>
ls
immxml-configure.log intermediatefiles nodes templatedir
root@feng-opensaf-2:/tmp/immxml_configure.LFwfeK#<mailto:root@feng-opensaf-2:/tmp/immxml_configure.LFwfeK>
vi immxml-configure.log
/* content from the above log file is highlighted in red below */
encoding in first source xml document: utf-8
Traceback (most recent call last):
File "./immxml-merge", line 611, in <module>
main(sys.argv[1:])
File "./immxml-merge", line 603, in main
merged_doc.save_result()
File "./immxml-merge", line 370, in save_result
self.imm_content_element.toxml(encoding).replace("/>", ">") + "\n")
TypeError: a bytes-like object is required, not 'str'
I used "immxml-clustersize -s 1" to generate the following nodes.cfg:
SC SC-1 SC-1
and I replaced the third column with "feng-opensaf-2", which I got from
"hostname -s". In fact, I also tried "immxml-clustersize -s 2" and replaced the
third column with "feng-opensaf-2". I got the same error.
If I started running opensafd, it would be stuck. Using "journalctl -xe"
revealed that immd could not be started:
Mar 07 14:57:40 feng-opensaf-2 osafimmd[71940]: WA IMMND coordinator at
7f000001 apparently crashed => electing new coord
Mar 07 14:57:40 feng-opensaf-2 osafimmd[71940]: ER Failed to find candidate for
new IMMND coordinator (ScAbsenceAllowed:0 RulingEpoch:1
Mar 07 14:57:40 feng-opensaf-2 osafimmd[71940]: ER Active IMMD has to restart
the IMMSv. All IMMNDs will restart
Mar 07 14:57:40 feng-opensaf-2 osafimmd[71940]: NO Cluster failed to load =>
IMMDs will not exit.
Mar 07 14:57:40 feng-opensaf-2 osafclmna[71906]: exiting for shutdown
Mar 07 14:57:40 feng-opensaf-2 osaffmd[71928]: exiting for shutdown
Mar 07 14:57:40 feng-opensaf-2 osafimmd[71940]: exiting for shutdown
Mar 07 14:57:41 feng-opensaf-2 osafrded[71917]: exiting for shutdown
Mar 07 14:57:41 feng-opensaf-2 osaftransportd[71899]: exiting for shutdown
Mar 07 14:57:41 feng-opensaf-2 opensafd[72383]: Starting OpenSAF failed
From: Dheeroj Ram
<[email protected]><mailto:[email protected]>
Sent: Tuesday, March 6, 2018 3:33 AM
To: Feng Xie <[email protected]><mailto:[email protected]>;
[email protected]<mailto:[email protected]>;
[email protected]<mailto:[email protected]>
Subject: RE: Errors in running OpenSaf 5.3 in a Ubuntu VM
Hi Feng,
Please follow the file "00-README.conf" in the Opensaf source code and
configure.
Let me know if you find any difficulties.
You can just try by following the below steps:
1- Modify the file /etc/opensaf/nid.conf
export OPENSAF_MANAGE_TIPC="yes"
TIPC_ETH_IF=<network interface>
TIPC_NET_ID=<tipc net_id value> (ex- 1234)
# The below variables have to be changed to "root"
# if user has built OpenSAF to run as root
export OPENSAF_GROUP=root
export OPENSAF_USER=root
2- edit file "/etc/opensaf/node_name" with node name.
3- edit file "/etc/opensaf/node_type" as controller or Payload.
How many controllers and payloads in your cluster?
4- cd /usr/share/opensaf/immxml/
Generate a config file (nodes.cfg) for a 5 node cluster:
$ ./immxml-clustersize -s 2 -p 3 (for 2 controller and 3 Payloads)
Edit nodes.cfg
The third column in nodes.cfg should be edited to match the short form of
the
hostname (as shown by 'hostname -s') for each host.
$ ./immxml-configure
Copy the generated imm.xml file to the standard OpenSAF configuration directory.
For eg:
$ cp imm.xml.20100217_2201 /etc/opensaf/imm.xml
Then start opensafd.
~ Dheeraj
-----Original Message-----
From: Feng Xie [mailto:[email protected]]
Sent: 06 March 2018 02:50
To:
[email protected]<mailto:[email protected]>;
[email protected]<mailto:[email protected]>
Subject: [users] Errors in running OpenSaf 5.3 in a Ubuntu VM
Hi,
I am new in using OpenSAF. I encountered an error in running the latest
OpenSaf software in a Ubuntu Linux VM. I would appreciate if somebody can
provide some hint on this issue in specific and some references in running
OpenSAF in general. Thanks a lot in advance!
1. Procedures and errors encountered
* Download the latest OpenSAF package opensaf-5.18.02.tar.gz in a Ubuntu
Linux VM (Linux version 4.4.0-116-generic (buildd@lgw01-amd64-021) (gcc version
5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9));
* Use "./configure -enable-tipc", "make" and "make install" to install
the OpenSAF;
* Use "/etc/init.d/opensafd start"
* Errors (output from "journalctl -xe")
Mar 05 12:46:33 feng-opensaf-2 opensafd[57351]: Starting OpenSAF
Services(5.18.02 - 2ed303919c3f0f36859028f47caf1498e882f45a) (Using TCP) Mar 05
12:46:33 feng-opensaf-2 opensafd[57330]: Starting OpenSAF Services (Using
TCP):/usr/local/lib/opensaf/opensafd: error while loading shared libraries:
libopensaf_core.so.0: cannot open shared object file: No such file or directory
Mar 05 12:46:33 feng-opensaf-2 opensafd[57330]: * Mar 05 12:46:33
feng-opensaf-2 opensafd[57675]: Starting OpenSAF failed Mar 05 12:46:33
feng-opensaf-2 systemd[1]: opensafd.service: Control process exited,
code=exited status=127 Mar 05 12:46:33 feng-opensaf-2 systemd[1]: Failed to
start OpenSAF daemon.
-- Subject: Unit opensafd.service has failed
1. I checked /usr/local/lib and I found libopensaf_core.so.0 by "ls -l
/usr/local/lib"
-rwxr-xr-x 1 root root 974 Mar 2 16:29 libopensaf_core.la
lrwxrwxrwx 1 root root 24 Mar 2 16:29 libopensaf_core.so ->
libopensaf_core.so.0.2.0
lrwxrwxrwx 1 root root 24 Mar 2 16:29 libopensaf_core.so.0 ->
libopensaf_core.so.0.2.0
-rwxr-xr-x 1 root root 2816096 Mar 2 16:29 libopensaf_core.so.0.2.0
............
1. Then I modified my $LD_LIBRARY_PATH to include "/usr/local/lib" by adding
it to the .bashrc file and did "source ./bashrc"
root@opensaf-2:/home/xyz# echo $LD_LIBRARY_PATH /usr/local/lib
1. Rerun opensaf by using "/etc/init.d/opensafd start", the same error was
seen.
Feng
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech
sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/opensaf-users
============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary
and confidential and subject to the Tech Mahindra policy statement, you may
review the policy at http://www.techmahindra.com/Disclaimer.html externally
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
============================================================================================================================
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-users