Linux命令日志记录

原创
01/29 09:12
阅读数 83

AWK文本编辑软件
which awk    // 查看awk路径
yum install gawk // 安装awk
which awk// 再次执行 显示awk路径
last -n 5  //举例显示最近5条登陆信息
last -n 5 | awk '{print$1}' //打印前五条第一列
 
 
 
Access denied 错误
sudo vim /etc/ssh/sshd_config
 
 redis 安装
 gcc -v  
 
 tar xzf redis-4.0.14.tar.gz
 mv redis-4.0.14 redis
 mv /usr/local/redis
 cd redis 
 make
 cd srcr
 make test
 vim redis.conf
 protected-mode no
 daemonize yes
 logfile "/usr/local/redis/redis-4.0.12/logs/redis.log"  # 需要先创建文件加跟文件
 requirepass foobared
 
redis-cd  redis.conf
kill - 9 pid
cd /

mkdir /etc/redis/

mv redis.conf /etc/redis/
redis-server redis.conf
ubuntu18.04安装 网络配置
sudo passwd root 修改root密码
cd /etc/netplan
network:
    ethernets: 
        enp1s0:
            dhcp4: no
            addresses: [172.18.103.118/24]
            gateway4: 172.18.103.1
    version: 2
配置DNS
vim /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
安装openssh-server
vi/etc/ssh/sshd_config
修改 port 去掉#
添加
PermitRootLogin yes

ubuntu 权限 
sudo apt-get install gedit  安装命令

无法上传 sudo chmod -R 777 /home
sudo tar -zxvf jdk 
sudo mv jdk1.8.0_191/ /usr/local/lib
sudo tar -zxvf redis-5.0.5.tar.gz
sudo mv redis-5.0.5 redis
sudo mv redis /usr/local/lib
sudo tar -zxvf mongodb-linux-x86_64-3.0.6.tgz
sudo apt install gcc

cd /usr/local/redis/
make  编译
sudo apt install make 安装make

sudo make MALLOC=libc 重新编译
cd src  ./redis-server
make test
下载(缺少tcl)
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
cd unix
./configure 
make
make install  tcl 安装完成
cd /src
make test
 vim redis.conf
 protected-mode no
 daemonize yes
 dir /usr/local/redis-5.0.5/data
 logfile "/usr/local/redis/redis-4.0.12/logs/redis.log"  # 需要先创建文件加跟文件
 requirepass foobared
 
cd /

mkdir /etc/redis/
mv redis.conf /etc/redis/
redis-server redis.conf

find -name redis-server
./redis-server /etc/redis/redis.conf

mysql  启动命令 118
service mysql restart


mongodb 安装
mkdir -p /data/db
mkdir -p /logs/mongodb.log
export PATH=/usr/local/mongodb3.0.6/bin:$PATH

vim mongodb.conf
dbpath = /data/db/
logpath= /logs/mongodb.log
logappend= true
port = 27017
fork = true
root@qianlima:/usr/local/mongodb3.0.6/bin#  ./mongod -f /usr/local/mongodb3.0.6/mongodb.conf

成功后

about to fork child process, waiting until server is ready for connections.
forked process: 8914
child process started successfully, parent exiting


jdk 安装

 sudo gedit ~/.bashrc
 
JAVA_HOME=/home/apneng/jdk1.8.0_171

JRE_HOME=${JAVA_HOME}/jre

CLASSPATH=${JAVA_HOME}/lib: ${JRE_HOME}/lib

PATH=${JAVA_HOME}/bin: ${JRE_HOME}/bin:$PATH

export JAVA_HOME JRE_HOME CLASSPATH PATH
正确配置
vim /etc/profile
export JAVA_HOME=/usr/lib/jdk/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre    
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib    
export PATH=${JAVA_HOME}/bin:$PATH 
source /etc/profile 

时间同步
设定时区:dpkg-reconfigure tzdata

           选择Asia -> 再选择Shanghai -> OK
apt install ntpdate 安装
ntpdate cn.pool.ntp.org  同步


elasticsearch 7.5.1 安装配置

tar -zxvf elasticsearch-7.5.0-linux-x86_64.tar.gz
tar -zxvf kibana-7.5.0-linux-x86_64.tar.gz

mv elasticsearch-7.5.0 /usr/local/kibana

mv kibana-7.5.0-linux-x86_64 /usr/local/kibana


编辑 elasticsearch 启动文件
#使用ES内置的jdk
export JAVA_HOME=/usr/local/elasticsearch-7.5.0/jdk
export PATH=$JAVA_HOME/bin:$PATH


#判断使用jdk
if [ -x "$JAVA_HOME/bin/java" ]; then
        JAVA="/usr/local/elasticsearch-7.5.0/jdk/bin/java"

else
        JAVA= `which java`
fi

添加  账户 
 groupadd elsearch useradd -g elsearch -p qianlima
 
#添加组
groupadd elsearch
#添加用户
useradd -g elsearch elsearch
#设置密码
passwd qianlima

 设置内存
 
 vi /etc/sysctl.conf
 vm.max_map_count=262144
 sysctl -p
 
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate 
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12 
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12 
xpack.license.self_generated.type: basic
http.cors.enabled: true
http.cors.allow-origin: "*"
 
 ./elasticsearch-plugin install analysis-icu
./elasticsearch-plugin install analysis-smartcn
./elasticsearch-plugin install  https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.5.0/elasticsearch-analysis-pinyin-7.5.0.zip
 
 ./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.5.0/elasticsearch-analysis-ik-7.5.0.zip
 分析器(Analysis)
 ik_smart
 ik_max_word
 
 下载hanlp 代码修改版本打包  https://github.com/AnyListen/elasticsearch-analysis-hanlp
  ./elasticsearch-plugin install http://192.168.117.118:8080/elasticsearch-analysis-hanlp-7.5.0.zip
 分析器(Analysis) 
hanlp_index:细粒度切分
hanlp_smart:常规切分
hanlp_nlp:命名实体识别
hanlp_per:感知机分词
hanlp_crf:CRF分词
hanlp:自定义
 
  #x-pack  安全
 ./elasticsearch-certutil cert -out /usr/local/elasticsearch-7.5.0/config/elastic-certificates.p12 -pass ""
 
  ps -ef |grep elasticsearch

./elasticsearch -d -p pid
//设置密码
 ./elasticsearch-setup-passwords interactive


Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]
以上密码是 qianlima


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

rocketmq 安装编译启动
cd rocketmq4.2

mvn -Prelease-all -DskipTests clean install -U
cd /usr/local/rocket4.2/distribution/target/apache-rocketmq

nohup sh bin/mqnamesrv -n 192.168.117.118:9876 &
nohup sh bin/mqbroker -n 192.168.117.118:9876 -c conf/broker.conf  autoCreateTopicEnable=true>borker.out &

/usr/local/rocket4.2/tools/rocketmq-console#
nohup java -jar rocketmq-console-ng-2.0.0.jar >rocketmq-console.log &


 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部