CentOS 7共通環境導入


        /usr/local/  
   systemctl     /usr/lib/systemd/system/  
Centos 7    service,7     systemmctl
      Centos 7.27.0    
         
   :systemctl         ,  after      

 :   JDK(jdk-8u162-linux-x64.tar.gz)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
tar -xvf jdk-8u162-linux-x64.tar.gz -C /usr/local/
vim /etc/profile
####################################################
export JAVA_HOME=/usr/local/jdk1.8.0_162
export JRE_HOME=/usr/local/jdk1.8.0_162/jre
export CLASSPATH=.:$JAVA_HOME/lib$:JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin/$JAVA_HOME:$PATH
#####################################################
     
source /etc/profile
java -version

 :   Mysql  (mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz)
https://downloads.mysql.com/archives/community/
tar -xvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
mv xxx mysql
  mysql       
mkdir /usr/local/mysql/data
groupadd mysql                           
useradd -r -g mysql mysql
          mysql  
cd mysql
chown -R mysql:mysql ./              
     
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/      
         ,    ,        
cd /usr/local/mysql
./bin/mysql_ssl_rsa_setup  --datadir=/usr/local/mysql/data
         /etc/my.cnf 
mkdir -p /var/lib/mysqld
chown mysql:mysql /var/lib/mysqld
vim /etc/profile
#############################################
export PATH=$PATH:/usr/local/mysql/bin
#############################################
     
source /etc/profile
   mysql          
touch /usr/lib/systemd/system/mysql.service
vim /usr/lib/systemd/system/mysql.service
##############################################
[Unit]
Description=MySQL Server
After=network.target remote-fs.target nss-lookup.target

[Service]
User=mysql
Group=mysql
Type=simple
ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
Restart=always
#RestartPreventExitStatus=1
#PrivateTmp=false

[Install]
WantedBy=multi-user.target
##############################################
chmod 777 /usr/lib/systemd/system/mysql.service
systemctl daemon-reload
       systemctl enable mysql.service
    systemctl start mysql.service
     3306
   mysql 
/usr/local/mysql/bin/mysql -uroot -p
    
mysql> set password for root@localhost = password('Zhaoweijun100');
mysql> update mysql.user set host = '%' where user = 'root';
mysql> flush privileges;
mysql> exit;

      ,         ,      ,   。
    
/usr/local/mysql/bin/mysqld --user=mysql
 safe        mysql,           
/usr/local/mysql/bin/mysqld_safe --user=mysql &
  :   mysqld_safe  mysql      ,    mysql    
mysqladmin -h127.0.0.1 -uroot -p shutdown
  :service                 
/var/run/mysqld                ,
   /var/run//var/run/mysqld     ,        mysql。
vim /etc/init.d/mysqld
      
get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
   
get_mysql_option mysqld_safe pid-file "/var/lib/mysql/mysqld.pid"
     ,  
systemctl daemon-reload
https://www.cnblogs.com/ivictor/p/5146247.html

 :   Redis  (redis-4.0.8.tar.gz)
https://redis.io/download
tar -xvf redis-4.0.8.tar.gz -C /usr/local/
mv xxx redis
cd /usr/local/redis
make
cd src
make install
cd /usr/local/redis
mkdir bin
mkdir log
touch ./log/redis.log
cd /usr/local/redis/src
mv mkreleasehdr.sh redis-benchmark redis-check-aof  redis-cli redis-server /usr/local/redis/bin
       /usr/local/redis/redis.conf
daemonize no => yes   #    
bind 0.0.0.0
requirepass weijunZhao
logfile "/usr/local/redis/log/redis.log"
dir  "/usr/local/redis/"
  redis          
notify-keyspace-events "KEA"
   Redis          
touch /usr/lib/systemd/system/redis-server.service
vim /usr/lib/systemd/system/redis-server.service
##############################################
[Unit]
Description=Redis-Server Manager
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
Restart=always
#PrivateTmp=true

[Install]
WantedBy=multi-user.target
##############################################
chmod 777 /usr/lib/systemd/system/redis-server.service
systemctl daemon-reload
       systemctl enable redis-server.service
    systemctl start redis-server.service
      6379

  :        adlist.o    ,     gcc,      
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
      gcc  ,    
rpm -Uvh *.rpm --nodeps --force
  
   redis        make,   TMD   
make        :
make MALLOC=libc
      
  Redis   
./bin/redis-server /usr/local/redis/redis.conf  
  Redis   
./bin/redis-cli

 :   Zookeeper  (zookeeper-3.4.10.tar.gz)
https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/
tar -xvf zookeeper-3.4.10.tar.gz -C /usr/local/
mv  xxx zookeeper
cd zookeeper
mkdir data
mkdir log
cp ./conf/zoo_sample.cfg ./conf/zoo.cfg
vim ./conf/zoo.cfg
#############################################
tickTime=2000
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/log
clientPort=2181
initLimit=5
syncLimit=2
############################################
     
vim   /etc/profile
############################################
export ZOOKEEPER=/usr/local/zookeeper
export PATH=$ZOOKEEPER/bin:$PATH
############################################
     
source /etc/profile
   zookeeper          
touch /usr/lib/systemd/system/zookeeper.service
vim /usr/lib/systemd/system/zookeeper.service
############################################
[Unit]
Description=Zookeeper Service
After=network.target
ConditionPathExists=/usr/local/zookeeper/conf/zoo.cfg

[Service]
Type=forking
Environment=JAVA_HOME=/usr/local/jdk1.8.0_162
ExecStart=/usr/local/zookeeper/bin/zkServer.sh start
ExecStop=/usr/local/zookeeper/bin/zkServer.sh stop
ExecReload=/usr/local/zookeeper/bin/zkServer.sh restart
Restart=always

[Install]
WantedBy=multi-user.target
############################################
chmod 777 /usr/lib/systemd/system/zookeeper.service
systemctl daemon-reload
       systemctl enable zookeeper.service
    systemctl start zookeeper.service
     2181

      
./bin/zkServer.sh start
./bin/zkServer.sh stop

 :   Kafka  (kafka_2.11-0.10.1.1.tgz)
 http://kafka.apache.org/downloads
tar -xvf  kafka_2.11-0.10.1.1.tgz -C /usr/local/
mv xxx kafka
cd kafka
mkdir log
vim ./config/server.properties
############################################
log.dirs=/usr/local/kafka/log
############################################
  :       kafka        ,      
server.properties
############################################
advertised.listeners=PLAINTEXT://xxx:9092
############################################
   Kafka          
touch /usr/lib/systemd/system/kafka.service
vim /usr/lib/systemd/system/kafka.service
############################################
[Unit]
Description=kafka server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
Environment=JAVA_HOME=/usr/local/jdk1.8.0_162
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh  -daemon /usr/local/kafka/config/server.properties
ExecStop=/usr/local/kafka/bin/kafka-server-stop.sh  /usr/local/kafka/config/server.properties
Restart=always

[Install]
WantedBy=multi-user.target
############################################
chmod 777 /usr/lib/systemd/system/kafka.service
systemctl daemon-reload
       systemctl enable kafka.service
    systemctl start kafka.service
    systemctl stop kafka.service
     9092

      
nohup ./bin/kafka-server-start.sh  ./config/server.properties &

 :   Nginx  (nginx-1.15.2.tar.gz)
  
tar -xvf /usr/local/nginx-1.15.2.tar.gz -C /usr/local/
mv xxx nginx
cd nginx
    (  :/nginx.conf    /conf/nginx.conf)
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf
make
make install
 web      localhost:80    nginx     
     nginx     
   nginx          
touch /usr/lib/systemd/system/nginx.service
vim /usr/lib/systemd/system/nginx.service
########################################
[Unit]
Description=nginx - high performance web server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
Restart=always

[Install]
WantedBy=multi-user.target
########################################
chmod 777 /usr/lib/systemd/system/nginx.service
systemctl daemon-reload
       systemctl enable nginx.service
    systemctl start nginx.service
     80

      
./sbin/nginx -c ./conf/nginx.conf
     nginx           
./sbin/nginx -s reload

        (   )
  Ubuntu  
sudo apt-get update
sudo apt-get install nginx
/usr/sbin/nginx:   
/etc/nginx:      
/usr/share/nginx:      
/var/log/nginx:    
  centos  
sudo yum install -y nginx
  :nginx -c nginx.conf
          
/usr/share/nginx/html
        
/etc/nginx/conf.d/default.conf
   Nginx          
/etc/nginx/conf.d/
Nginx    
/etc/nginx/nginx.conf
     
    :
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
        :
    rpm -qa pcre
https://centos.pkgs.org/7/centos-x86_64/pcre-devel-8.32-17.el7.x86_64.rpm.html
    rpm -ivh pcre-devel-8.32-17.el7.x86_64.rpm
    rpm -qa zlib
https://centos.pkgs.org/7/centos-x86_64/zlib-devel-1.2.7-17.el7.x86_64.rpm.html
    rpm -ivh zlib-devel-1.2.7-17.el7.x86_64.rpm
            
rpm -ivh pcre-devel-8.32-17.el7.x86_64.rpm --nodeps --force 
rpm -ivh zlib-devel-1.2.7-17.el7.x86_64.rpm --nodeps --force

 :   Tomcat  (apache-tomcat-8.5.11.tar.gz)
http://tomcat.apache.org/download-80.cgi
tar -xvf apache-tomcat-8.5.11.tar.gz -C /usr/tomcat/
mv xxx tomcat
cd tomcat
vim ./bin/setclasspath.sh
#######################################
export JAVA_HOME=/usr/local/jdk1.8.0_121
export JRE_HOME=/usr/local/jdk1.8.0_121/jre
#######################################
          
      
/usr/local/tomcat/webapps/
      
./conf/server.xml
   tomcat          
touch /usr/lib/systemd/system/tomcat.service
vim /usr/lib/systemd/system/tomcat.service
########################################
[Unit]
Description=Tomcat Service
After=syslog.target network.target

[Service]
Type=forking
Environment=JAVA_HOME=/usr/local/jdk
#PIDFile=/usr/local/tomcat/tomcat.pid
ExecStart=/usr/local/tomcat/bin/startup.sh
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target
########################################
chmod 777 /usr/lib/systemd/system/tomcat.service
systemctl daemon-reload
       systemctl enable tomcat.service
    systemctl start tomcat.service
       8080

      
./bin/startup.sh


 :   Go  (go1.10.1.linux-amd64.tar.gz)
https://blog.csdn.net/zxs9999/article/details/78874807
tar -xvf  go1.10.1.linux-amd64.tar.gz -C /usr/local/
mv xxx go
cd /
mkdir ws_go
vim /etc/profile
##############################################
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/ws_go
##############################################
         /usr/local/  ,     GOROOT
##############################################
export GOROOT=/usr/go
export PATH=$PATH:$GOROOT/bin
##############################################
source /etc/profile
  
go version

 :   MongoDB
https://www.mongodb.com/download-center#production
tar –zxvf mongodb-linux-x86_64-rhel62-3.2.4.gz -C /usr/local/
mv xxx mongodb
vim /etc/profile
##############################################
export MONGODB_HOME=/usr/local/mongodb  
export PATH=$PATH:$MONGODB_HOME/bin
#############################################
source /etc/profile
cd mongodb
mkdir db          
touch mongodb.conf        conf   
mkdir   logs          
touch mongodb.log
   logs   db    
  
./bin/mongod  --config ./mongodb.conf
waiting for...    
   mongodb 
./mongo
/usr/local/mongodb/mongodb.conf     conf      
###################################################
port=27017 #   
dbpath=/usr/local/mongodb/db #       
logpath=/usr/local/mongodb/logs/mongodb.log #        
logappend=true #           
pidfilepath=/usr/local/mongodb/mongo.pid
fork=true #      
shardsvr=true
#auth=true #    
#noauth=true #     
bind_ip=0.0.0.0  #      
#########################################################
       
touch /usr/lib/systemd/system/mongodb.service
mongodb.service     :
#################################################
[Unit]
Description=mongodb
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongodb.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/usr/local/mongodb/bin/mongod --shutdown -f /usr/local/mongodb/mongodb.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target
#####################################################
chmod 777 /usr/lib/systemd/system/mongodb.service
systemctl daemon-reload
        systemctl enable mongodb.service
   systemctl start mongodb.service 

      , stop
/usr/local/mongodb/mongodb.conf         
auth=true (      ,    ,         )
use admin  // admin  
db.createUser({
    user:"root",pwd:"rootzwj",roles:["root"]})//    
db.auth("root","rootzwj")//      
     27017 

 :   Rar,Zip    (rarlinux-x64-5.5.0.tar.gz)
https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
tar -zxvf rarlinux-x64-5.5.0.tar.gz -C /usr/local/
cd rar 
make
  
    
  rar      rar x bb.rar

  :java    
   jar       /usr/service/test/test.jar
      :test-start.sh
################################################
#!/bin/sh

export JAVA_HOME=/usr/local/jdk1.8.0_162
export PATH=$JAVA_HOME/bin:$PATH

nohup java -jar /usr/service/test/test.jar > /usr/service/test/test.log 2>&1 &
echo $! > /var/run/test.pid
################################################
      :test-stop.sh
################################################
#!/bin/sh

PID=$(cat /var/run/test.pid)
kill -9 $PID
rm -fr /var/run/test.pid
################################################
touch /usr/lib/systemd/system/java-test.service
###############################################
[Unit]
Description=TestJava
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/service/test/start.sh
ExecStop=/usr/service/test/stop.sh
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target
###############################################
chmod 777 /usr/lib/systemd/system/java-test.service
systemctl daemon-reload
  :      jar       
chmod -R 777 /usr/service/
        systemctl enable java-test.service
   systemctl start java-test.service
   systemctl stop java-test.service
  : win Linux          
vim xxx.sh         
:set ff
Linux    
:set ff=unix
  
  :   supervisord    java    ,   supervisor         JAVA_HOME
    start.sh   stop.sh,    
conf    
#######################################################
[program:java-test]
command = java -jar /usr/service/test/test.jar
autostart=true
startsecs=3
startretries=3
autorestart=true
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
redirect_stderr=false
stdout_logfile=/usr/service/logstash/log-info-java-test.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
stdout_capture_maxbytes=0
stdout_events_enabled=true
stderr_logfile=/usr/service/logstash/log-error-yum-java-test.log
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=1
stderr_capture_maxbytes=0
stderr_events_enabled=false
#######################################################
   supervisor   


  :   supervisor (    go,java   )
   supervisord      /data/go/supervisor/supervisord
      :startup.sh
#################################################
#!/bin/sh

export JAVA_HOME=/usr/local/jdk1.8.0_162
export PATH=$JAVA_HOME/bin:$PATH

nohup /usr/service/supervisor/supervisord -c=/usr/service/supervisor/supervisor.conf > /usr/service/logstash/log_supervisord.log 2>&1 &
echo $! > /var/run/supervisord.pid
#################################################
      :stop.sh
#################################################
#!/bin/sh

PID=$(cat /var/run/supervisord.pid)
kill -9 $PID
rm -fr /var/run/supervisord.pid
#################################################
       :
touch /usr/lib/systemd/system/supervisord.service
supervisord.service     :
#################################################
[Unit]
Description=supervisord
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
# Environment=JAVA_HOME=/usr/local/jdk1.8.0_162
ExecStart=/usr/service/supervisor/startup.sh
ExecStop=/usr/service/supervisor/stop.sh
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target
#####################################################
chmod 777 /usr/lib/systemd/system/supervisord.service
systemctl daemon-reload
        systemctl enable supervisord.service
chmod -R 777 /usr/service
   systemctl start supervisord.service 
   systemctl stop supervisord.service 
  :supervisord/conf      
java           ,      ,  :
[program:user]
directory = /usr/service/user/
command = java -jar ./user.jar

  :   ZeroMQ
wget http://download.zeromq.org/zeromq-4.0.4.tar.gz
tar zvxf zeromq-4.0.4.tar.gz -C /usr/local/
mv zeromq-4.0.4 zeromq
cd zeromq
   GCC, G++
sudo yum install gcc
sudo yum install gcc-c++
    
./configure
    

  :   EMQTT(         )
http://www.emqtt.com/downloads
emqx     
emqttd     
chmod -R 777 /usr/local/emqttd
      
       :
touch /usr/lib/systemd/system/emqttd.service
vim /usr/lib/systemd/system/emqttd.service
emqttd.service     :
#################################################
[Unit]
Description=emqttd
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
Environment=HOME=/usr/local/emqttd
ExecStart=/usr/local/emqttd/bin/emqttd start
ExecReload=/usr/local/emqttd/bin/emqttd reboot
ExecStop=/usr/local/emqttd/bin/emqttd stop
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/emqttd.service
systemctl daemon-reload
        systemctl enable emqttd.service
   emqttd          
   systemctl start emqttd.service 

      
./bin/emqttd start
     


  :   Logstash(java,      500M  )
https://www.elastic.co/downloads/logstash
2019-04-11      logstash-7.0.0.tar.gz   
   
cd  /usr/local/logstash
       ./config/logstash.yml ,  
====================================
http.host: 0.0.0.0
#      ,      
node.name: cpy04.dev.xjh.com
#  logstash            
path.data: /usr/local/logstash/data
#          
config.reload.automatic: true
#            
config.reload.interval: 10s
http.host: "0.0.0.0"
log.level: info
path.logs: /usr/local/logstash/logs
========================================
       logstash.conf(        )
========================================
input {
    file {
     path => ["/usr/service/logstash"]
     type => "service_log"
     start_position => "beginning"
    }
}

filter {

}

output {
    elasticsearch {
    hosts => ["http://106.12.78.98:9200"]
    index => "sz01-106.12.73.138"
  }
}
=========================================
            (  )
      
/usr/local/logstash/bin/system-install
chmod -R 777 /usr/local/logstash  
/usr/local/logstash/config/startup.options systemd
     /etc/systemd/system/logstash.service    
        logstash     ,   logstash.service
       conf  
logstash.service     :
##########################################
[Unit]
Description=logstash

[Service]
Type=forking
User=root
Group=root
Environment=JAVA_HOME=/usr/local/jdk1.8.0_162
ExecStart=/usr/local/logstash/bin/logstash -f /usr/local/logstash/logstash.conf
Restart=always

[Install]
WantedBy=multi-user.target
##########################################
chmod 777 /etc/systemd/system/logstash.service
systemctl daemon-reload
systemctl enable logstash.service
systemctl start logstash.service
systemctl status logstash.service
      
9600

      
    bin/logstash -f logstash.conf
     nohup ./bin/logstash -f logstash.conf &


  :Elastic APM-Server
    :jdk
    :
https://www.elastic.co/cn/downloads/apm
  
    
mv xxx  apm-server
   apm-server.yml     
apm-server:
        host: "0.0.0.0:8200"   #           localhost    
rum:
        enabled: true
output.elasticsearch:
        hosts: ["xxx:9200"]
Linux   
nohup ./apm-server &
   8200
           
touch /usr/lib/systemd/system/apm-server.service
apm-server.service     :
#################################################
[Unit]
Description=apm-server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
ExecStart=/usr/local/apm-server/apm-server -e -c /usr/local/apm-server/apm-server.yml

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/apm-server.service
systemctl daemon-reload
        systemctl enable apm-server.service
   systemctl start apm-server.service
   systemctl stop apm-server.service


  :   Elsearch(java,      1.3G   )
https://www.elastic.co/downloads/elasticsearch
      
mv xxx elasticsearch
mkdir /usr/local/elasticsearch/data
mkdir /usr/local/elasticsearch/logs
    config/elasticsearch.yml     
cluster.name: aliyun-elastic
node.name: node-1
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["node-1"]
 Linux ,           root    
         
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch
chown -R elsearch:elsearch /usr/local/elasticsearch
    
su  elsearch
cd /usr/local/elasticsearch
./bin/elasticsearch
nohup ./bin/elasticsearch &
      9200   9300
      
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
 root   ,  /etc/sysctl.conf        
vm.max_map_count=262144
     sysctl  -p
        
sysctl -a|grep vm.max_map_count
   elasticsearch   
       :
touch /usr/lib/systemd/system/elastic.service
elastic.service     :
#################################################
[Unit]
Description=elastic
After=network.target remote-fs.target nss-lookup.target

[Service]
#       simple
Type=simple
User=elsearch
Group=elsearch
Environment=ES_HOME=/usr/local/elasticsearch
Environment=ES_PATH_CONF=/usr/local/elasticsearch/config
Environment=PID_DIR=/usr/local/elasticsearch
# EnvironmentFile=/etc/sysconfig/elasticsearch
# WorkingDirectory=/opt/elasticsearch

ExecStart=/usr/local/elasticsearch/bin/elasticsearch

StandardOutput=journal
StandardError=inherit
LimitNOFILE=65536
LimitNPROC=4096
LimitAS=infinity
LimitFSIZE=infinity
TimeoutStopSec=0
KillSignal=SIGTERM
KillMode=process
SendSIGKILL=no
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/elastic.service
systemctl daemon-reload
        systemctl enable elastic.service
   systemctl start elastic.service
   systemctl stop elastic.service


  :   kibana
https://www.elastic.co/downloads/kibana
   kibana.yml     ,  
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://xxxx:9200"]    #      localhost      
Linux    
nohup ./bin/kibana &
   5601
           
touch /usr/lib/systemd/system/kibana.service
kibana.service     :
#################################################
[Unit]
Description=kibana
After=network.target remote-fs.target nss-lookup.target

[Service]
#       simple
Type=simple
ExecStart=/usr/local/kibana/bin/kibana

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/kibana.service
systemctl daemon-reload
        systemctl enable kibana.service
   systemctl start kibana.service
   systemctl stop kibana.service


  :   filebeat(go)
    
https://www.elastic.co/cn/downloads/beats/filebeat
    
filebeat.yml
  
nohup ./filebeat -c filebeat.yml  &
  
ps -aux | grep filebeat
    :
enabled: true
paths:
    - /usr/service/logstash/*.log*
tags: ["SH002-"]
output.elasticsearch:
  hosts: ["localhost:9200"]
       :
touch /usr/lib/systemd/system/filebeat.service
filebeat.service     :
#################################################
[Unit]
Description=filebeat
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
ExecStart=/usr/local/filebeat/filebeat -e -c /usr/local/filebeat/filebeat.yml

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/filebeat.service
systemctl daemon-reload
        systemctl enable filebeat.service
        :
chmod go-w /usr/local/filebeat/filebeat.yml
   systemctl start filebeat.service 
   systemctl stop filebeat.service 

  :   telnet
  
rpm -q telnet 
rpm -q telnet-server
rpm -q xinetd
    
http://rpmfind.net/linux/rpm2html/search.php?query=telnet(x86-64)
http://www.rpmfind.net/linux/rpm2html/search.php?query=telnet-server(x86-64)
http://rpm.pbone.net/index.php3/stat/4/idpl/35493746/dir/centos_7/com/xinetd-2.3.15-13.el7.x86_64.rpm.html
       :
telnet-0.17-64.el7.x86_64.rpm
telnet-server-0.17-64.el7.x86_64.rpm
xinetd-2.3.15-13.el7.x86_64.rpm
       :
rpm -Uvh *.rpm --nodeps --force
    /etc/xinetd.d/telnet     
disable = yes   disable = no
       ,  
touch /etc/xinetd.d/telnet
vim /etc/xinetd.d/telnet
############################################
# default: yes    
# description: The telnet server servestelnet sessions; it uses \   
# unencrypted username/password pairs for authentication.  
service telnet         
{  
  flags = REUSE  
  socket_type = stream  
  wait = no  
  user = root  
  server =/usr/sbin/in.telnetd  
  log_on_failure += USERID  
  disable = no   
}  
############################################
systemctl restart xinetd.service
systemctl enable xinetd.service
systemctl enable telnet.socket


  :OSS       (Minio)
       
https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x OSS
   ,      secret   key,       ,          
./OSS server /data
   ctrl + c

      
touch /usr/lib/systemd/system/oss.service
vim /usr/lib/systemd/system/oss.service
#################################################
[Unit]
Description=oss
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
Environment=MINIO_ACCESS_KEY=BA3IZ8XP9THSFLQFPK82
Environment=MINIO_SECRET_KEY=Orwg3UaZj71v8he0dEfdmfILYYV1wLfIk+77yi1F
#ExecStart=/usr/local/oss/OSS server --address 127.0.0.1:80 /upload
ExecStart=/usr/local/oss/OSS server  /upload
Restart=always

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/oss.service
systemctl daemon-reload
systemctl enable oss.service
   systemctl start oss.service 
      9000

   :     mycat(1.6.5-release  )
  :   jdk
mysql       
    :
https://github.com/MyCATApache/Mycat-download
  
      
vim /etc/profile
export MYCAT_HOME=/usr/local/mycat/
source /etc/profile
       mycat/conf/  
       wrapper.conf ,   java   
wrapper.java.command=/usr/local/jdk1.8.0_162/bin/java
       server.xml,           
(      ,     )
       schema.xml
writeHost   readHost,        writeHost
      
touch /usr/lib/systemd/system/mycat.service
vim /usr/lib/systemd/system/mycat.service
#################################################
[Unit]
Description=mycat
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/local/mycat/bin/mycat start
ExecStop=/usr/local/mycat/bin/mycat stop
Restart=always

[Install]
WantedBy=multi-user.target
################################################
chmod 777 /usr/lib/systemd/system/mycat.service
systemctl daemon-reload
systemctl enable mycat.service
   systemctl start mycat.service 
      8066

    
mysql -uroot -P8066 -p123456 -h127.0.0.1

      
./bin/mycat start
./bin/mycat stop