亚欧色一区w666天堂,色情一区二区三区免费看,少妇特黄A片一区二区三区,亚洲人成网站999久久久综合,国产av熟女一区二区三区

  • 發布文章
  • 消息中心
點贊
收藏
評論
分享
原創

linux主機初始化步驟

2023-10-17 06:46:07
17
0
  • 主機初始化

 

  • 數據盤掛載到/app目錄,參考如下(注意:/dev/sdb替換為對應的數據盤)

sudo mkfs.xfs -f -i attr=2 -l lazy-count=1,sectsize=4096 -b size=4096 -d sectsize=4096 -n ftype=1 /dev/sdb

sudo mkdir -p /app

sudo chmod 777 /app

sudo mount /dev/sdb /app

echo "UUID="`blkid /dev/sdb|cut -d '"' -f2`"   /app  xfs  defaults   0   0"  | sudo tee -a /etc/fstab

  • jdk解壓到/app下,并且/etc/profile與/etc/bashrc中配置jdk環境變量

sudo tar -zxvf /tmp/jdk-8u221-linux-x64.tar.gz -C /app

echo 'export JAVA_HOME=/app/jdk1.8.0_221' | sudo tee -a /etc/profile

echo 'export JRE_HOME=$''JAVA_HOME/jre' | sudo tee -a /etc/profile

echo 'export CLASSPATH=.:$''JAVA_HOME/jre/lib/rt.jar:$''JAVA_HOME/lib/dt.jar:$''JAVA_HOME/lib/tools.jar' | sudo tee -a /etc/profile

echo 'export PATH=$''PATH:$''JAVA_HOME/bin:$''JRE_HOME/bin:.' | sudo tee -a /etc/profile

echo 'export JAVA_HOME=/app/jdk1.8.0_221' | sudo tee -a /etc/bashrc

echo 'export JRE_HOME=$''JAVA_HOME/jre' | sudo tee -a /etc/bashrc

echo 'export CLASSPATH=.:$''JAVA_HOME/jre/lib/rt.jar:$''JAVA_HOME/lib/dt.jar:$''JAVA_HOME/lib/tools.jar' | sudo tee -a /etc/bashrc

echo 'export PATH=$''PATH:$''JAVA_HOME/bin:$''JRE_HOME/bin:.' | sudo tee -a /etc/bashrc

  • 新增用戶teledb,并添加sudo權限

sudo useradd teledb

echo '1qaz@WSX' | sudo passwd --stdin teledb

echo "teledb        ALL=(ALL)       NOPASSWD: ALL" | sudo tee -a /etc/sudoers

  • 配置用戶的ulimit

echo 'root - nofile 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - core 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - nproc 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - stack 65536' | sudo tee -a /etc/security/limits.conf

echo 'teledb  soft  core  1024000' | sudo tee -a /etc/security/limits.conf

echo 'teledb  hard  core  1024000' | sudo tee -a /etc/security/limits.conf

echo 'teledb  soft  stack  10240' | sudo tee -a /etc/security/limits.conf

echo 'teledb  hard  stack  10240' | sudo tee -a /etc/security/limits.conf

echo 'teledb      -       nofile  65535' | sudo tee -a /etc/security/limits.conf

echo 'teledb      -       nproc   65535' | sudo tee -a /etc/security/limits.conf

  • 配置系統內核參數

echo 'kernel.sem = 250 32000 100 128' | sudo tee -a /etc/sysctl.conf

echo 'fs.file-max = 6553600' | sudo tee -a /etc/sysctl.conf

echo 'net.core.netdev_max_backlog = 32768' | sudo tee -a /etc/sysctl.conf

echo 'net.core.rmem_default = 8388608' | sudo tee -a /etc/sysctl.conf

echo 'net.core.rmem_max = 16777216' | sudo tee -a /etc/sysctl.conf

echo 'net.core.somaxconn = 32768' | sudo tee -a /etc/sysctl.conf

echo 'net.core.wmem_default = 8388608' | sudo tee -a /etc/sysctl.conf

echo 'net.core.wmem_max = 16777216' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.ip_local_port_range = 10000 65000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_fin_timeout = 30' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_intvl = 15' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_probes = 3' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_time = 1200' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_orphans = 3276800' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_syn_backlog = 65536' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_tw_buckets = 6000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_mem = 94500000 91500000 92700000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_retries2 = 5' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_rmem = 32768 436600 873200' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_syn_retries = 2' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_synack_retries = 2' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_syncookies = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_tw_recycle = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_tw_reuse = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_wmem = 8192 436600 873200' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_background_ratio = 50' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_ratio = 50' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_writeback_centisecs = 360000' | sudo tee -a /etc/sysctl.conf

echo 'vm.drop_caches = 1' | sudo tee -a /etc/sysctl.conf

echo 'vm.max_map_count = 655360' | sudo tee -a /etc/sysctl.conf

echo 'vm.min_free_kbytes = 1024000' | sudo tee -a /etc/sysctl.conf

echo 'vm.overcommit_memory = 1' | sudo tee -a /etc/sysctl.conf

echo 'vm.swappiness = 5' | sudo tee -a /etc/sysctl.conf

sudo sysctl -p

0條評論
0 / 1000
鄧****華
2文章數
0粉絲數
鄧****華
2 文章 | 0 粉絲
鄧****華
2文章數
0粉絲數
鄧****華
2 文章 | 0 粉絲
原創

linux主機初始化步驟

2023-10-17 06:46:07
17
0
  • 主機初始化

 

  • 數據盤掛載到/app目錄,參考如下(注意:/dev/sdb替換為對應的數據盤)

sudo mkfs.xfs -f -i attr=2 -l lazy-count=1,sectsize=4096 -b size=4096 -d sectsize=4096 -n ftype=1 /dev/sdb

sudo mkdir -p /app

sudo chmod 777 /app

sudo mount /dev/sdb /app

echo "UUID="`blkid /dev/sdb|cut -d '"' -f2`"   /app  xfs  defaults   0   0"  | sudo tee -a /etc/fstab

  • jdk解壓到/app下,并且/etc/profile與/etc/bashrc中配置jdk環境變量

sudo tar -zxvf /tmp/jdk-8u221-linux-x64.tar.gz -C /app

echo 'export JAVA_HOME=/app/jdk1.8.0_221' | sudo tee -a /etc/profile

echo 'export JRE_HOME=$''JAVA_HOME/jre' | sudo tee -a /etc/profile

echo 'export CLASSPATH=.:$''JAVA_HOME/jre/lib/rt.jar:$''JAVA_HOME/lib/dt.jar:$''JAVA_HOME/lib/tools.jar' | sudo tee -a /etc/profile

echo 'export PATH=$''PATH:$''JAVA_HOME/bin:$''JRE_HOME/bin:.' | sudo tee -a /etc/profile

echo 'export JAVA_HOME=/app/jdk1.8.0_221' | sudo tee -a /etc/bashrc

echo 'export JRE_HOME=$''JAVA_HOME/jre' | sudo tee -a /etc/bashrc

echo 'export CLASSPATH=.:$''JAVA_HOME/jre/lib/rt.jar:$''JAVA_HOME/lib/dt.jar:$''JAVA_HOME/lib/tools.jar' | sudo tee -a /etc/bashrc

echo 'export PATH=$''PATH:$''JAVA_HOME/bin:$''JRE_HOME/bin:.' | sudo tee -a /etc/bashrc

  • 新增用戶teledb,并添加sudo權限

sudo useradd teledb

echo '1qaz@WSX' | sudo passwd --stdin teledb

echo "teledb        ALL=(ALL)       NOPASSWD: ALL" | sudo tee -a /etc/sudoers

  • 配置用戶的ulimit

echo 'root - nofile 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - core 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - nproc 65536' | sudo tee -a /etc/security/limits.conf

echo 'root - stack 65536' | sudo tee -a /etc/security/limits.conf

echo 'teledb  soft  core  1024000' | sudo tee -a /etc/security/limits.conf

echo 'teledb  hard  core  1024000' | sudo tee -a /etc/security/limits.conf

echo 'teledb  soft  stack  10240' | sudo tee -a /etc/security/limits.conf

echo 'teledb  hard  stack  10240' | sudo tee -a /etc/security/limits.conf

echo 'teledb      -       nofile  65535' | sudo tee -a /etc/security/limits.conf

echo 'teledb      -       nproc   65535' | sudo tee -a /etc/security/limits.conf

  • 配置系統內核參數

echo 'kernel.sem = 250 32000 100 128' | sudo tee -a /etc/sysctl.conf

echo 'fs.file-max = 6553600' | sudo tee -a /etc/sysctl.conf

echo 'net.core.netdev_max_backlog = 32768' | sudo tee -a /etc/sysctl.conf

echo 'net.core.rmem_default = 8388608' | sudo tee -a /etc/sysctl.conf

echo 'net.core.rmem_max = 16777216' | sudo tee -a /etc/sysctl.conf

echo 'net.core.somaxconn = 32768' | sudo tee -a /etc/sysctl.conf

echo 'net.core.wmem_default = 8388608' | sudo tee -a /etc/sysctl.conf

echo 'net.core.wmem_max = 16777216' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.ip_local_port_range = 10000 65000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_fin_timeout = 30' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_intvl = 15' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_probes = 3' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_keepalive_time = 1200' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_orphans = 3276800' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_syn_backlog = 65536' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_max_tw_buckets = 6000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_mem = 94500000 91500000 92700000' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_retries2 = 5' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_rmem = 32768 436600 873200' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_syn_retries = 2' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_synack_retries = 2' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_syncookies = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_tw_recycle = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_tw_reuse = 1' | sudo tee -a /etc/sysctl.conf

echo 'net.ipv4.tcp_wmem = 8192 436600 873200' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_background_ratio = 50' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_ratio = 50' | sudo tee -a /etc/sysctl.conf

echo 'vm.dirty_writeback_centisecs = 360000' | sudo tee -a /etc/sysctl.conf

echo 'vm.drop_caches = 1' | sudo tee -a /etc/sysctl.conf

echo 'vm.max_map_count = 655360' | sudo tee -a /etc/sysctl.conf

echo 'vm.min_free_kbytes = 1024000' | sudo tee -a /etc/sysctl.conf

echo 'vm.overcommit_memory = 1' | sudo tee -a /etc/sysctl.conf

echo 'vm.swappiness = 5' | sudo tee -a /etc/sysctl.conf

sudo sysctl -p

文章來自個人專欄
文章 | 訂閱
0條評論
0 / 1000
請輸入你的評論
0
0