Centos 7 new build list of stuff to do after initial install
Ignore what is not needed
Disable selinux
vi /etc/sysconfig/selinux
selinux=diabled
Disable and turn off firewalld
systemctl disable firewalld
systemctl stop firewalld
reboot
---begin turn off NetworkManager
vi /etc/hostname
make sure your hostname is in there. i use name.domain.com
vi /etc/hosts
make sure your hotname is in there. I both name and name.domain.com
vi /etc/resolv.conf
search yourdomain.com
nameserver 192.168.10.1 or what ever you use for DNS
---begin if you want to use the old eth0 naming convention
vi /etc/default/grub
Search for the line “GRUB_CMDLINE_LINUX” and append the following: net.ifnames=0 biosdevname=0
you can also turn off the screensaver for your console by adding consoleblank=0
My line is now:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_nas/swap rd.lvm.lv=centos_nas/root net.ifnames=0 biosdevname=0 consoleblank=0"
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
mv /etc/sysconfig/network-scripts/ifcfg-enp????? /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
NAME=eth0
DEVICE=eth0
---end if you want to use the old eth0 naming convention
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl stop NetworkManager-wait-online
systemctl disable NetworkManager-wait-online
systemctl enable network
chkconfig network on
systemctl start network
reboot and sanity check
systemctl status NetworkManager
systemctl status network
---end turn off NetworkManager
Create text file /root/list with packge list below in it
do not include the --begin list or the --end list lines in the file
--begin list
bind-utils
traceroute
net-tools
ntp*
gcc
glibc
glibc-common
gd
gd-devel
make
net-snmp
openssl-devel
xinetd
unzip
libtool*
make
patch
perl
bison
flex-devel
gcc-c++
ncurses-devel
flex
libtermcap-devel
autoconf*
automake*
autoconf
libxml2-devel
cmake
sqlite*
wget
ntp*
lm_sensors
ncurses-devel
qt-devel
hmaccalc
zlib-devel
binutils-devel
elfutils-libelf-devel
wget
bc
gzip
uuid*
libuuid-devel
jansson*
libxml2*
sqlite*
openssl*
lsof
NetworkManager-tui
mlocate
yum-utils
kernel-devel
nfs-utils
tcpdump
--end list
yum -y install $(cat list)
yum -y groupinstall "Development Tools"
yum -y update
reboot
---install zfs if needed
cd /root
yum -y localinstall --nogpgcheck https://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum -y localinstall --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release.el7.noarch.rpm
yum -y install kernel-devel zfs
modprobe zfs
lsmod | grep -i zfs
zfs 2179437 3
zcommon 47120 1 zfs
znvpair 80252 2 zfs,zcommon
spl 89796 3 zfs,zcommon,znvpair
zavl 6784 1 zfs
zunicode 323046 1 zfs
vi /etc/sysconfig/modules/zfs.modules
#!/bin/sh
if [ ! -c /dev/zfs ] ; then
exec /sbin/modprobe zfs >/dev/null 2>&1
fi
chmod +x /etc/sysconfig/modules/zfs.modules
reboot
lsmod | grep -i zfs
zfs 2179437 3
zcommon 47120 1 zfs
znvpair 80252 2 zfs,zcommon
spl 89796 3 zfs,zcommon,znvpair
zavl 6784 1 zfs
zunicode 323046 1 zfs
create pool called myraid
this is a 8 drive 4 vdev stripe mirror pool set
zpool create myraid mirror sdb sdc mirror sdd sde mirror sdf sdg mirror sdh sdi
zpool status
zfs mount myraid
echo "zfs mount myraid" >> /etc/rc.local
zfs set compression=lz4 myraid
zfs set sync=disabled myraid
zfs set checksum=fletcher4 myraid
zfs set primarycache=all myraid
zfs set logbias=latency myraid
zfs set recordsize=128k myraid
zfs set atime=off myraid
zfs set dedup=off myraid
vi /etc/modprobe.d/zfs.conf
# disable prefetch
options zfs zfs_prefetch_disable=1
# set arc max to 48GB. I have 64GB in my server
options zfs zfs_arc_max=51539607552
# set size to 128k same as file system block size
options zfs zfs_vdev_cache_size=1310720
options zfs zfs_vdev_cache_max=1310720
options zfs zfs_read_chunk_size=1310720
options zfs zfs_vdev_cache_bshift=17
options zfs zfs_read_chunk_size=1310720
# Set thes to 1 so we get max IO at cost of banwidth
options zfs zfs_vdev_async_read_max_active=1
options zfs zfs_vdev_async_read_min_active=1
options zfs zfs_vdev_async_write_max_active=1
options zfs zfs_vdev_async_write_min_active=1
options zfs zfs_vdev_sync_read_max_active=1
options zfs zfs_vdev_sync_read_min_active=1
options zfs zfs_vdev_sync_write_max_active=1
options zfs zfs_vdev_sync_write_min_active=1
i am using my pool via nfs to my ESXi server for quest images so
i share this on my nas with both the 1Gb and 10Gb networks
vi /etc/exports
/myraid/ 192.168.10.0/24(rw,async,no_root_squash,no_subtree_check)
/myraid/ 192.168.90.0/24(rw,async,no_root_squash,no_subtree_check)
systemctl start rpcbind nfs-server
systemctl enable rpcbind nfs-server
---end install zfs if needed
--install samaba if needed
yum -y install samba
useradd samba -s /sbin/nologin
smbpasswd -a samba
Supply a password
Retype the password
mkdir /myraid
chown -R samba:root /myraid/
vi /etc/samba/smb.conf
[global]
workgroup = WORKGROUP ;use name of your workgroup here
server string = Samba Server Version %v
netbios name = NAS
Add this to botton of /etc/samba/smb.conf file
[NAS]
comment = NAS
path = /myraid
writable = yes
valid users = samba
systemctl start smb
systemctl enable smb
systemctl start nmb
systemctl enable nmb
testparm
--end install samaba if needed
---install plex if needed
visit plex site and get rpm for your version of OS
copy this to /root
yum -y localinstall name.rpm
systemctl enable plexmediaserver
systemctl start plexmediaserver
---end install plex if needed
---install LAMP
yum -y install httpd mariadb-server mariadb php php-mysql
systemctl enable httpd.service
systemctl start httpd.service
systemctl status httpd.service
Make sure it works with:
http://your_server_IP_address/
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb
mysql_secure_installation
vi /var/www/html/info.php
<?php phpinfo(); ?>
http://your_server_IP_address/info.php
---End install LAMP
---Extra goodies
yum -y install epel-release
yum -y install stress htop iftop iotop hddtemp smartmontools iperf3 sysstat mlocate
updatedb **this is to update mlocate db
---End Extra goodies
---tune 10Gb CNA if needed
service irqbalance stop
service cpuspeed stop
chkconfig irqbalance off
chkconfig cpuspeed off
vi /etc/sysconfig/network-scripts/ifcfg-eth???
MTU="9000"
vi /etc/sysctl.conf
# -- tuning -- #
# Increase system file descriptor limit
fs.file-max = 65535
# Increase system IP port range to allow for more concurrent connections
net.ipv4.ip_local_port_range = 1024 65000
# -- 10gbe tuning from Intel ixgb driver README -- #
# turn off selective ACK and timestamps
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
# memory allocation min/pressure/max.
# read buffer, write buffer, and buffer space
net.ipv4.tcp_rmem = 10000000 10000000 10000000
net.ipv4.tcp_wmem = 10000000 10000000 10000000
net.ipv4.tcp_mem = 10000000 10000000 10000000
net.core.rmem_max = 524287
net.core.wmem_max = 524287
net.core.rmem_default = 524287
net.core.wmem_default = 524287
net.core.optmem_max = 524287
net.core.netdev_max_backlog = 300000
reboot and test speed.
on linux client pointing to server with ip 192.168.90.100
# iperf3 -c 192.168.90.100 -p 5201
on linux server with IP 192.168.90.100
iperf3 -s -p 5201 -B 192.168.90.100
---end tune 10Gb CNA if needed
No comments:
Post a Comment