ndd on Solaris 10

Posted by user12620111 on Oracle Blogs See other posts from Oracle Blogs or by user12620111
Published on Thu, 7 Jun 2012 16:09:38 +0000 Indexed on 2012/06/07 22:45 UTC
Read the original article Hit count: 241

Filed under:

This is mostly a repost of LaoTsao's Weblog with some tweaks. Last time that I tried to cut & paste directly off of his page, some of the XML was messed up.

I run this from my MacBook. It should also work from your windows laptop if you use cygwin.

================
If not already present, create a ssh key on you laptop
================

# ssh-keygen -t rsa

================
Enable passwordless ssh from my laptop.
Need to type in the root password for the remote machines.
Then, I no longer need to type in the password when I ssh or scp from my laptop to servers.
================

#!/usr/bin/env bash

for server in `cat servers.txt`
do
  echo root@$server
  cat ~/.ssh/id_rsa.pub | ssh root@$server "cat >> .ssh/authorized_keys"
done


================
servers.txt
================

testhost1
testhost2

================
etc_system_addins
================

set rpcmod:clnt_max_conns=8
set zfs:zfs_arc_max=0x1000000000
set nfs:nfs3_bsize=131072
set nfs:nfs4_bsize=131072


================
ndd-nettune.txt
================

#!/sbin/sh
#
# ident   "@(#)ndd-nettune.xml    1.0     01/08/06 SMI"

. /lib/svc/share/smf_include.sh
. /lib/svc/share/net_include.sh

# Make sure that the libraries essential to this stage of booting  can be found.
LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
echo "Performing Directory Server Tuning..." >> /tmp/smf.out
#
# Standard SuperCluster Tunables
#
/usr/sbin/ndd -set /dev/tcp tcp_max_buf 2097152
/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1048576
/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1048576

# Reset the library path now that we are past the critical stage
unset LD_LIBRARY_PATH


================
ndd-nettune.xml
================

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!-- ident "@(#)ndd-nettune.xml 1.0 04/09/21 SMI" -->
<service_bundle type='manifest' name='SUNWcsr:ndd'>
  <service name='network/ndd-nettune' type='service' version='1'>
    <create_default_instance enabled='true' />
    <single_instance />
    <dependency name='fs-minimal' type='service' grouping='require_all' restart_on='none'>
      <service_fmri value='svc:/system/filesystem/minimal' />
    </dependency>
    <dependency name='loopback-network' grouping='require_any' restart_on='none' type='service'>
      <service_fmri value='svc:/network/loopback' />
    </dependency>
    <dependency name='physical-network' grouping='optional_all' restart_on='none' type='service'>
      <service_fmri value='svc:/network/physical' />
    </dependency>
    <exec_method type='method' name='start' exec='/lib/svc/method/ndd-nettune' timeout_seconds='3' > </exec_method>
    <exec_method type='method' name='stop'  exec=':true'                       timeout_seconds='3' > </exec_method>
    <property_group name='startd' type='framework'>
      <propval name='duration' type='astring' value='transient' />
    </property_group>
    <stability value='Unstable' />
    <template>
      <common_name>
    <loctext xml:lang='C'> ndd network tuning </loctext>
      </common_name>
      <documentation>
    <manpage title='ndd' section='1M' manpath='/usr/share/man' />
      </documentation>
    </template>
  </service>
</service_bundle>


================
system_tuning.sh
================

#!/usr/bin/env bash

for server in `cat servers.txt`
do
  cat etc_system_addins | ssh root@$server "cat >> /etc/system"

  scp ndd-nettune.xml root@${server}:/var/svc/manifest/site/ndd-nettune.xml
  scp ndd-nettune.txt root@${server}:/lib/svc/method/ndd-nettune
  ssh root@$server chmod +x /lib/svc/method/ndd-nettune
  ssh root@$server svccfg validate /var/svc/manifest/site/ndd-nettune.xml
  ssh root@$server svccfg import /var/svc/manifest/site/ndd-nettune.xml
done





© Oracle Blogs or respective owner

Related posts about /Sun