Thursday, October 27, 2016

How to stop/start and disable/enable Firewall on Redhat 7

[root@rhel71 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: active (running) since Fri 2016-10-21 15:05:50 SGT; 6 days ago
 Main PID: 1024 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1024 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Oct 21 15:05:50 rhel71.local.com systemd[1]: Started firewalld - dynamic fir....
Hint: Some lines were ellipsized, use -l to show in full.




[root@rhel71 ~]# service firewalld stop
Redirecting to /bin/systemctl stop  firewalld.service




[root@rhel71 ~]# service firewalld start
Redirecting to /bin/systemctl start  firewalld.service


[root@rhel71 ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'



[root@rhel71 ~]# systemctl enable firewalld
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/basic.target.wants/firewalld.service'



Saturday, July 9, 2016

streams admin

Use startall and stopall


Friday, July 1, 2016

Generate MQ Bindings

If you need to generate MQ bindings, here are the steps:

1. Create a dir

2. Copy JMSAdmin.config to this dir. Make sure the file has the following entries
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file://

3. Create a file intsetup.scp with the following contents:
def qcf(ivtQCF) qmgr(QMOD01) transport(CLIENT) host(119.81.206.86) channel(SYSTEM.DEF.SVRCONN) port(1414)
DEFINE Q(TMMQ) QUEUE(TMMQ) TC(MQ)
DEFINE Q(ODINMQ) QUEUE(ODINMQ) TC(MQ)
DEFINE Q(ODOUTMQ) QUEUE(ODOUTMQ) TC(MQ)
end

4. Create a shell script gen_bindings.sh with the following contents:
export PATH=$PATH:$MQ_ROOT/bin:$MQ_ROOT/java/bin:$MQ_ROOT/samp/bin:$MQ_ROOT/samp/jms/samples:/var/mqm
export CLASSPATH=/opt/mqm/java/lib/com.ibm.mq.allclient.jar:/opt/mqm/java/lib/jms.jar:/opt/mqm/java/lib/providerutil.jar

java com.ibm.mq.jms.admin.JMSAdmin < intsetup.scp

5. The bindings file (.bindings) will be created in this dir 


Note, if you need to regenerate, delete .bindings file first (or you may get an error saying unable to bind)

References:
http://ibmstreams.github.io/streamsx.documentation//docs/4.1/messaging/mq-create-objects-bindings-sample/
http://www.ibm.com/support/knowledgecenter/SSYLSL_9.3.0/com.ibm.help.integ.jms.doc/t_CreatingJMSBindingsInIBMWebSphereMQ.html


Friday, February 12, 2016

OD stuff to take note

You may get the following errors when installing streams (check the logs in the streamsadmin home dir during the installation.. if after installation check in the InfoStreams/log directory:

IS_SELINUX_WARNING=You are installing to target system Red Hat Enterprise Linux Server release 6.5 (Santiago) to directory /home/streamsadmin/InfoSphereStreams. The current SELinux setting is PERMISSIVE. You can continue with the installation, however the following conditions prevent the product from being enabled for SELinux.

1. CDISI3035W The user who installs the product must be the root user.


If you cancel the installation, correct the error conditions and try again. If you continue, you must correct the error conditions after the installation completes and run /home/streamsadmin/InfoSphereStreams/bin/streamsinstallpolicy.sh to enable the product for SELinux. For information on running the product on an SELinux system, see the InfoSphere Streams Information Center.
IS_SYS_CONFIG_WARN=The following warning conditions were detected. You can continue the installation, but the product might not function correctly. If you continue, check the installation summary log file for additional actions.

1. CDISI3044W The system soft limit for the maximum number of processes is low: 1024.


First problem:
Set selinux to disabled (permissive will give the first error)

Second problem:
set /etc/security/limits.d/90-nproc.conf to higher value (soft limit)

-----------------------------------------------------------------------------------------------------------

Other notes:
1. Ensure software binaries are set to a path where there are no spaces because during installation, it will use the tar command which will fail if there are spaces in the path

2. Set in the root .bashrc:
export JAVA_HOME=/apps/ibm/db2/V10.5/java/jdk64
export DETECT_HOME=/home/streamsadmin/OpDetection
. /home/db2inst1/sqllib/db2profile
export PATH=$PATH:$JAVA_HOME/bin

3. Set in the streamsadmin .bashrc:
ulimit -u 10000
ulimit -n 10000
export JAVA_HOME=/apps/ibm/db2/V10.5/java/jdk64
export DETECT_HOME=/home/streamsadmin/OpDetection
source /home/streamsadmin/InfoSphereStreams/bin/streamsprofile.sh
. /home/db2inst1/sqllib/db2profile

4. During installation of streams, you can view the streams installation logs:
/home/streamsadmin/InfoSphereStreams3.2.1.2_InstallDetail.log

Once installation is done, you can view the logs in:
/home/streamsadmin/InfoSphereStreams/logs

Detect logs will be in /root and then moved to the OD install dir/logs

Tuesday, February 9, 2016

Setting ulimits

Read this :-)

Or else:

Linux ulimit settings for InfoSphere Streams

The default Linux ulimit settings might be too small for some Red Hat Enterprise Linux (RHEL), Community Enterprise Operating System (CentOS), or SUSE Linux Enterprise Server (SLES) environments, which can cause processing element (PE) failures.

Operating system ulimit settings

When testing InfoSphere® Streams on RHEL, CentOS, and SLES systems, the following ulimit settings were used:
  • open files value = 100000
  • max user processes value = pending signals value
  • pending signals value = 100000
Notes:
  • The InfoSphere Streams dependency checker script and checkhost command issue a warning message if the max user processes value is less than or equal to 1024, or the open files value is less than 1024.
  • These minimum values might need to be increased based on your InfoSphere Streams applications and environment.

Verifying ulimit settings for InfoSphere Streams

InfoSphere Streams provides the following tools that you can use to verify that the soft ulimit settings for the maximum number of processes and open files are compatible with InfoSphere Streams:
  • Before installing the product, use the dependency checker script.
  • After installing the product, use the streamtool checkhost command.
If the soft ulimit settings for the maximum number of processes and open files are not compatible with InfoSphere Streams, the following messages are displayed in the command output:
Warning:  CDISI3044W The system limit for the maximum number of processes is low: 1021.
Warning:  CDISI3045W The system limit for the open files is low: 1021.

Reviewing ulimit settings

To review the current ulimit settings on an InfoSphere Streams host, enter the following command:
ulimit -aH
To review the ulimit values that are collected in the runtime boot trace file, enter the following command:
streamtool viewlog --service boot -i instance-id

Updating ulimit settings

Attention: Before changing ulimit settings, contact your system administrator.
There are several ways to change ulimit settings. The following examples show one way to change the settings:
  • RHEL and CentOS examples
    • To change the open files value, edit the /etc/security/limits.d/91-nofile.conf file as shown in the following example:
      * - nofile open-files-value
    • To change the max user processes value, edit the /etc/security/limits.d/90-nproc.conf file as shown in the following example:
      * soft nproc max-user-processes-value
  • SLES examples
    • To change the open files value, edit the /etc/security/limits.conf file as shown in the following example:
      * - nofile open-files-value
    • To change the max user processes value, edit the /etc/security/limits.conf file as shown in the following example:
      * soft nproc max-user-processes-value
You must restart your system for the changes to take effect.
To verify the updated settings, enter the following command:
ulimit -aH

Monday, February 8, 2016

Installing telnet client

[root@rhel65dbs selinux]# telnet
bash: telnet: command not found
[root@rhel65dbs selinux]# yum install telnet -y
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
server                                                                                                                                                                                                                | 3.9 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-47.el6_3.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                               Arch                                                  Version                                                             Repository                                             Size
=============================================================================================================================================================================================================================================
Installing:
 telnet                                                x86_64                                                1:0.17-47.el6_3.1                                                   server                                                 58 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install       1 Package(s)

Total download size: 58 k
Installed size: 109 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:telnet-0.17-47.el6_3.1.x86_64                                                                                                                                                                                           1/1
  Verifying  : 1:telnet-0.17-47.el6_3.1.x86_64                                                                                                                                                                                           1/1

Installed:
  telnet.x86_64 1:0.17-47.el6_3.1                                                                                                                                                                                                           

Complete!
[root@rhel65dbs selinux]# telnet localhost 22
Trying ::1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3

Protocol mismatch.
Connection closed by foreign host.
[root@rhel65dbs selinux]#

Setting enforcing mode on RHEL

If you running OD, you need to set enforcing mode to permissive or disabled.
Here's a good link on how to do it.