随笔分类 -  Linux

摘要:装机 装机之后执行 sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.0/repo/oss openSUSE-Aliyun-OSSsudo zypper ar -fc https://mirrors 阅读全文
posted @ 2019-03-05 22:50 匠人先生 阅读(1292) 评论(0) 推荐(0)
摘要:1 下载iso opensuse 下载: http://download.opensuse.org/distribution/openSUSE-stable/iso/openSUSE-Leap-15.0-DVD-x86_64.iso 以c盘为例,将iso拷贝到c盘根目录,同时将iso中的两个文件放到 阅读全文
posted @ 2019-03-05 21:01 匠人先生 阅读(791) 评论(0) 推荐(0)
摘要:CentOS6服务用chkconfig控制,CentOS7改为systemd控制 1 systemd systemd is a suite of basic building blocks for a Linux system. It provides a system and service ma 阅读全文
posted @ 2019-03-02 17:30 匠人先生 阅读(593) 评论(0) 推荐(0)
摘要:docker经常需要挂载文件到容器中,比如启动nginx # docker run -d --name test_nginx -v /tmp/nginx.conf:/etc/nginx/nginx.conf nginx 然后就有修改配置文件然后刷新的功能,如果直接用vi编辑宿主机文件 # vi /t 阅读全文
posted @ 2019-02-23 22:19 匠人先生 阅读(3111) 评论(0) 推荐(0)
摘要:#!/bin/sh 1 取脚本参数 $# 参数个数$0 当前脚本名$1 第1个参数$n 第n个参数$* 所有参数$@ 所有参数$? 上个命令的状态$$ 当前pid 取当前目录 $(cd `dirname $0`; pwd) 2 日期 $ dateWed Mar 27 17:27:18 CST 201 阅读全文
posted @ 2019-02-22 11:13 匠人先生 阅读(485) 评论(0) 推荐(0)
摘要:1 在一个能访问远程repo的服务器上执行,下载ansible及相关依赖的rpm包 # mkdir ansible# yum install --downloadonly --downloaddir=ansible ansible 2 将ansible目录拷贝到离线服务器上,通过yum locali 阅读全文
posted @ 2019-02-20 17:39 匠人先生 阅读(926) 评论(0) 推荐(0)
摘要:服务器集群之间忽然ssh跳转不通 # ssh 192.168.0.1The authenticity of host '192.168.0.1 (192.168.0.1)' can't be established.RSA1 key fingerprint is 07:e4:54:79:62:60: 阅读全文
posted @ 2019-02-13 13:56 匠人先生 阅读(7464) 评论(0) 推荐(1)
摘要:1 查看哪些硬盘没有挂载 # fdisk -l Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physi 阅读全文
posted @ 2019-02-12 16:51 匠人先生 阅读(514) 评论(0) 推荐(1)
摘要:1 磁盘、cpu、内存相关 查看全部设备信息 # lspci 查看整体磁盘空间占用情况 # df -h 查看磁盘分区及文件系统 # df -T 查看整体磁盘inode占用情况 # df -i 查看文件详细信息 # ls -l $path 查看文件inode信息 # ls -i $path# stat 阅读全文
posted @ 2019-01-30 11:39 匠人先生 阅读(354) 评论(0) 推荐(1)
摘要:格式 ssh -L <local port>:<remote host>:<remote port> <SSH servername> 示例 # ssh -L 3307:$server2:3306 user@$server1 实现的效果是使用user登录$server1之后建立本地3307端口到远程 阅读全文
posted @ 2019-01-28 18:36 匠人先生 阅读(1757) 评论(0) 推荐(0)
摘要:keepalived 2.0.12 官方:http://www.keepalived.org/ 一 简介 Keepalived is a routing software written in C. The main goal of this project is to provide simple 阅读全文
posted @ 2019-01-28 18:16 匠人先生 阅读(4420) 评论(0) 推荐(0)
摘要:iptables 1.4.21 官方:https://www.netfilter.org/projects/iptables/index.html iptables is the userspace command line program used to configure the Linux 2 阅读全文
posted @ 2019-01-27 13:16 匠人先生 阅读(928) 评论(0) 推荐(1)
摘要:redhat6自带glibc-2.12,升级到glibc-2.14过程 # strings /lib64/libc.so.6 |grep GLIBC_GLIBC_2.2.5GLIBC_2.2.6GLIBC_2.3GLIBC_2.3.2GLIBC_2.3.3GLIBC_2.3.4GLIBC_2.4GL 阅读全文
posted @ 2019-01-24 17:15 匠人先生 阅读(4375) 评论(0) 推荐(2)
摘要:redhat6系统默认安装的glibc-2.12,有的软件依赖的是glibc-2.14,这时需要升级glibc,下载安装 http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz # ./configure --prefix=/usr --disable-prof 阅读全文
posted @ 2019-01-24 17:11 匠人先生 阅读(6033) 评论(1) 推荐(3)
摘要:1 添加、删除用户 # useradd $user# userdel $user 2 设置用户密码 # passwd $user /etc/passwd 3 查看$user的用户和组信息 # id $user 4 将用户$user添加到组$group # usermod -G $group $use 阅读全文
posted @ 2019-01-22 14:15 匠人先生 阅读(476) 评论(0) 推荐(1)
摘要:http请求过程如下: # curl -v http://www.baidu.com % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 阅读全文
posted @ 2019-01-16 21:34 匠人先生 阅读(535) 评论(0) 推荐(1)
摘要:sudo允许用户以其他用户的身份(比如root)执行命令,比如切换用户、执行命令、读写文件等; 配置 sudo配置在:/etc/sudoers ## Sudoers allows particular users to run various commands as## the root user, 阅读全文
posted @ 2019-01-15 16:00 匠人先生 阅读(442) 评论(0) 推荐(1)
摘要:官方:https://www.ssh.com/ssh/ The SSH protocol uses encryption to secure the connection between a client and a server. All user authentication, commands 阅读全文
posted @ 2019-01-15 14:23 匠人先生 阅读(1238) 评论(0) 推荐(1)
摘要:官方:http://ambari.apache.org/ The Apache Ambari project is aimed at making Hadoop management simpler by developing software for provisioning, managing, 阅读全文
posted @ 2019-01-15 12:26 匠人先生 阅读(5948) 评论(2) 推荐(1)
摘要:linux服务器通常都是远程登录的,执行命令或者脚本时,如果连接断掉(执行时间较长或者网络不稳定时),那么进程也就没了,这时只能重新连接重新执行,这时可以使用后台执行: 1 nohup 命令 nohup $command $args & 这时会生成一个nohup.out文件,内容是命令执行的控制台输 阅读全文
posted @ 2019-01-14 12:56 匠人先生 阅读(338) 评论(0) 推荐(1)