Skip to content

Commit

Permalink
Site updated: 2024-12-07 13:10:46
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingchao committed Dec 7, 2024
1 parent a0a6ab4 commit 33511d7
Show file tree
Hide file tree
Showing 417 changed files with 120,198 additions and 0 deletions.
77 changes: 77 additions & 0 deletions 2015/02/23/new-start/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<script src="/js/less.min.js"></script>



<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/prettify/tomorrow.css">


<script src="/js/jquery-2.1.4.min.js"></script>


<script src="/js/raphael-min.js"></script>


<script src="/js/underscore-min.js"></script>


<script src="/js/sequence-diagram-min.js"></script>


<script src="/js/flowchart-latest.js"></script>


<script src="/prettify/prettify.js"></script>


<script src="/js/common.js"></script>


<script src="/js/gitment.browser.js"></script>


<link rel="stylesheet" href="/css/default.css">


<link rel="stylesheet" href="/lib/fancybox/dist/jquery.fancybox.css">



<script src="/lib/fancybox/dist/jquery.fancybox.js"></script>



<link rel="stylesheet" href="/css/style.css">




<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-71897482-1', 'auto');
ga('send', 'pageview');
</script>


<title>新的启程</title>
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=no">
<meta name="generator" content="Hexo 6.3.0"></head>
<body>

<h4 id="2015年正月初五,试图寻找真实的自己,Mark!"><a href="#2015年正月初五,试图寻找真实的自己,Mark!" class="headerlink" title="2015年正月初五,试图寻找真实的自己,Mark!"></a>2015年正月初五,试图寻找真实的自己,Mark!</h4>



</body>
</html>
539 changes: 539 additions & 0 deletions 2015/02/28/hint-fiction/index.html

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions 2015/03/16/mysql-forget-the-root-password/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<script src="/js/less.min.js"></script>



<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/prettify/tomorrow.css">


<script src="/js/jquery-2.1.4.min.js"></script>


<script src="/js/raphael-min.js"></script>


<script src="/js/underscore-min.js"></script>


<script src="/js/sequence-diagram-min.js"></script>


<script src="/js/flowchart-latest.js"></script>


<script src="/prettify/prettify.js"></script>


<script src="/js/common.js"></script>


<script src="/js/gitment.browser.js"></script>


<link rel="stylesheet" href="/css/default.css">


<link rel="stylesheet" href="/lib/fancybox/dist/jquery.fancybox.css">



<script src="/lib/fancybox/dist/jquery.fancybox.js"></script>



<link rel="stylesheet" href="/css/style.css">




<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-71897482-1', 'auto');
ga('send', 'pageview');
</script>


<title>Linux下mysql忘记root密码</title>
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=no">
<meta name="generator" content="Hexo 6.3.0"></head>
<body>

<h3 id="Linux下mysql忘记root密码"><a href="#Linux下mysql忘记root密码" class="headerlink" title="Linux下mysql忘记root密码"></a>Linux下mysql忘记root密码</h3><p>/etc/my.conf的[mysqld]段加上skip-grant-tables</p>
<pre><code>[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
skip-grant-tables
</code></pre><p>重启mysql服务就可以更新user标里面的password了<br>update mysql.user set password = password(‘root’) where user=root<br>就可以,然后还原/etc/my.conf</p>




</body>
</html>
141 changes: 141 additions & 0 deletions 2015/03/16/rsync-backup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<script src="/js/less.min.js"></script>



<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/prettify/tomorrow.css">


<script src="/js/jquery-2.1.4.min.js"></script>


<script src="/js/raphael-min.js"></script>


<script src="/js/underscore-min.js"></script>


<script src="/js/sequence-diagram-min.js"></script>


<script src="/js/flowchart-latest.js"></script>


<script src="/prettify/prettify.js"></script>


<script src="/js/common.js"></script>


<script src="/js/gitment.browser.js"></script>


<link rel="stylesheet" href="/css/default.css">


<link rel="stylesheet" href="/lib/fancybox/dist/jquery.fancybox.css">



<script src="/lib/fancybox/dist/jquery.fancybox.js"></script>



<link rel="stylesheet" href="/css/style.css">




<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-71897482-1', 'auto');
ga('send', 'pageview');
</script>


<title>rsync实现Linux服务器之间增量备份</title>
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=no">
<meta name="generator" content="Hexo 6.3.0"></head>
<body>

<h3 id="rsync实现Linux服务器之间增量备份"><a href="#rsync实现Linux服务器之间增量备份" class="headerlink" title="rsync实现Linux服务器之间增量备份"></a>rsync实现Linux服务器之间增量备份</h3><p>可以用于线上服务器同步代码。</p>
<h4 id="主服务器"><a href="#主服务器" class="headerlink" title="主服务器"></a>主服务器</h4><p>rsync为C/S架构,一台主服务器,可以有多台从服务器</p>
<p>1.主服务器(需要备份的服务器):配置好yum源,安装rsync服务端</p>
<pre><code>#yum install rsync
</code></pre><p>2.创建rsync 同步目录/data,此目录里面的内容将被同步到从服务器上</p>
<pre><code>#mkdir /data
</code></pre><p>3.创建权限认证文件,此文件用于存放从服务器验证身份,格式为“username:password”,该用户与操作系统上面的用户没有一点关系,所以系统上不需要创建此用户。文件可使用任意名称,最好容易识别</p>
<pre><code>#vim /etc/rsyncd.pass
wujingchao:123456
</code></pre><p>安全起见密码文件权限需修改为600</p>
<pre><code>#chmod 600 /etc/rsyncd.pass
</code></pre><p>4.创建 rsync 配置文件/etc/rsyncd.conf,默认是没有这个文件的</p>
<pre><code>uid=root #该选项指定当该模块传输文件时守护进程应该具有的uid,配合gid选项使用可以确定rsync具有访问那些文件夹的权限,默认值是&quot;nobody&quot;,我们可以根据相应的需要进行配置。
gid=root #该选项指定当该模块传输文件时守护进程应该具有的gid,默认值是”nobody”。
use chroot=no #不使用chroot
max connections=20 #设置最大连接数,默认为0,即无限制。这里设置为20.
strict mode =yes #设置是否检查口令文件的权限
pid file=/var/run/rsyncd.pid #指定rysnc进程的pid文件位置
lock file=/var/lock/rsync.lock #指定支持max connections的锁文件
log file=/var/log/rsyncd.log #指定 rsync日志输出路径
[your_model_name] #*模块名,可使用任意名称*
path=/data/ #*源目录路径*
comment=Test rsync #模块描述
ignore errors #出现I/O错误时可忽略。
read only=no #是否只读,设置为no时客户端可上传文件。
write only=no #设置为no 时客户端可下载文件。
hosts allow=192.168.0.100 #*允许访问主机*
hosts deny=* #拒绝访问的主机,*表示所有主机。
list=false #设置客户端请求时是否列出该模块,false为隐藏。
auth users=wujingchao #设置连接时使用的用户,即密码文件里面定义的用户名。
secrets file=/etc/rsyncd.pass #指定密码文件位置


</code></pre><p>1.启动rsync守护进程</p>
<p>启动服务</p>
<p>手动方式(–config用于指定rsyncd.conf的位置,如果在/etc下可以不写)</p>
<pre><code>#/usr/bin/rsync --daemon --config=/etc/rsyncd.conf
</code></pre><p>xinetd方式</p>
<p>如果没有安装xinet,请先安装,</p>
<pre><code>#yum install xinet
</code></pre><p>在rsync默认安装完成后,安装程序会自动在建立/etc/xinetd.d/rsync文件,但是默认情况是disable = yes,需要修改disable=no 即可然后,我们通过xinet启动rsync:</p>
<pre><code>#service xinetd start/restart
</code></pre><p>好了这样主服务器就配置好了,启动之后可以看一下873是否处于监听状态</p>
<pre><code>#netstat -tnlp
</code></pre><p>如果该端口被防火墙作用:</p>
<p>开启873端口</p>
<pre><code>#iptables -I INPUT -p tcp --dport 873 -j ACCEPT
</code></pre><h4 id="从服务器"><a href="#从服务器" class="headerlink" title="从服务器"></a>从服务器</h4><p>1.安装rsync</p>
<p>2.配置权限认证文件里面写入与主服务器相同的密码,不需要再写username</p>
<pre><code> #vim /etc/rsyncd.pass
123456
</code></pre><p>3.创建备份的文件夹</p>
<pre><code> #mkdir /backup
</code></pre><p>4.执行同步命令</p>
<pre><code> #/usr/bin/rsync -avzP --delete --progress --exclude-from=/etc/exclude.conf --password-file=/etc/rsyncd.pass [email protected]::your_model_name /backup
</code></pre><pre><code>--exclude-from 表示要排除上传哪些文件或者那些后缀的文件execlude.conf示例文件如下

admin/doAddProFromcsv/
site_data/
.dat
.log
.txt
.xml
add_admin.php
</code></pre>



</body>
</html>
Loading

0 comments on commit 33511d7

Please sign in to comment.