log

linux--mysql(MHA高可用架构)

戏子无情 提交于 2020-03-12 10:11:07
MHA高可用架构 注意:一主多从=奇数 在做MHA高可用实验前需要做好gtid主从复制或者半同步复制,此次采用gtid主从复制 gtid主从复制链接: https://blog.csdn.net/Aplox/article/details/104670774 gtid主从复制环节 在3台虚拟机上做好gtid主从复制(基于前次实验做 读写分离 ) systemctl stop mysqld cd / var / lib / mysql / rm - fr * vim / etc / my . cnf 最后写入 server1配置文件写入 server_id=1 gtid_mode=ON enforce_gtid_consistency=ON log_slave_updates=ON 开启主从更换 log_bin=binlog 开启二进制日志 server2配置文件写入 server_id=2 gtid_mode=ON enforce_gtid_consistency=ON log_slave_updates=ON 开启主从更换 log_bin=binlog 开启二进制日志 server3配置文件写入 server_id=3 gtid_mode=ON enforce_gtid_consistency=ON log_slave_updates=ON 开启主从更换 log_bin

Vue基础之数据绑定

自闭症网瘾萝莉.ら 提交于 2020-03-12 07:11:41
我们学习一门新语言或者框架时,第一件事是什么呢,那必然是向世界say Hello。 创建一个Vue应用 话不多说,先上代码,让我们感受一下Vue的核心功能 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <div id="app"> <input type="text" v-model="message"> <h1>{{message}}</h1> // {{message}}模板的输出方式 </div> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script type="text/javascript"> var app = new Vue({ el: '#app', // app是Vue实例的挂在对象 data: { message: "Hello world" // 字面量 } }

js函数(续)

亡梦爱人 提交于 2020-03-12 04:43:23
一、全局变量和局部变量 全局变量:当前js页面中均可使用的变量【 声明 在函数外面的变量】,整个js页面中均可以使用。 局部变量: 声明 在函数内部的变量,只能在函数内部使用。 eg: var a = 1; console.log(a); function test(){ console.log(a); //1 var b = 2 // c = 3; //c变量为全局变量,它的声明提前了【在页面的开始声明】 console.log(b); //2 } console.log(b); //错误提示:b is not defined 二、函数的使用 函数作为函数的参数使用:(可以作为 回调函数 使用) eg: function test(fun){ var msg = '我是test()函数中的变量msg'; fun(msg); } //函数test的调用 test(function(param){ console.log(param); //输出:我是test()函数中的变量msg }); 函数作为返回结果来使用: eg: function test(){ return function(){ console.log('我是test()函数的返回函数中的输出语句'); }; } //函数test的调用 test(); //test();的返回值为:function(){console

javascript里面什么是变量

非 Y 不嫁゛ 提交于 2020-03-12 02:51:07
什么是变量,从字面意思来讲,变量就是可变的量;从编程角度来讲,变量是用来存储某种/某些数值的存储器,举例2个盒子,为区分它们,其中一个用box1表示,另外一个用box2,当然你也可以用任意的名称来区分,这个box1就是盒子名字也就是所谓变量的名字。 变量如何定义?语法如下: 1 var 变量名 //定义变量使用关键字var 变量命名注意事项,需要遵从以下命名规则: 变量必须使用字母、下划线_或者美元符$开始; 可以使用多个英文字母、数字、下划线_或者美元符$组成 不能使用javascript关键词与javascript保留字 拓展:不能使用JavaScript关键词与JavaScript保留字,是什么意思? 1 关键字和保留字的区别是:关键字属于语言设计中的一部分,保留字是语言设计尚未用到,但将来可能会用到;不能使用javascript中的关键字,比如var if else等等,这些关键字不能被设计成变量,否则在程序运行中,无法分辨其是你定义的变量,还是语言中的语法规范,所以尽量不要使用关键字或者保留字去定义变量; 2 js中的关键词和保留字如下:break case catch continue default delete do else finally for function if in instanceof new return switch this throw try

Git Log 用法

夙愿已清 提交于 2020-03-11 17:59:14
git log 查看 提交历史 在提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,可以使用 git log 命令查看。 接下来的例子会用我专门用于演示的 simplegit 项目,运行下面的命令获取该项目源代码: git clone git://github.com/schacon/simplegit-progit.git 然后在此项目中运行 git log ,应该会看到下面的输出: $ git log commit ca82a6dff817ec66f44342007202690a93763949 Author: Scott Chacon <schacon@gee-mail.com> Date: Mon Mar 17 21:52:11 2008 -0700 changed the version number commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7 Author: Scott Chacon <schacon@gee-mail.com> Date: Sat Mar 15 16:40:33 2008 -0700 removed unnecessary test code commit a11bef06a3f659402fe7563abf99ad00de2209e6 Author: Scott Chacon

mongoose连接指定数据库

非 Y 不嫁゛ 提交于 2020-03-11 16:47:43
承认自己初学mongoose,根据网上代码和操作写了代码, 但是一直不理解怎么连接指定的数据库 首先正常写mongoose的代码 const Koa = require ( 'koa' ) const router = require ( 'koa-router' ) const mongoose = require ( 'mongoose' ) const DBURL = 'mongodb://127.0.0.1:27017/platform' mongoose . Promise = require ( 'bluebird' ) mongoose . connect ( DBURL , { useNewUrlParser : true , useNewUrlParser : true , useUnifiedTopology : true } ) //let db = client.db('platform') mongoose . connection . on ( 'connected' , function ( ) { console . log ( 'Mongoose connection open to ' + DBURL ) ; } ) ; const regist = require ( './mongo/regist' ) let app = new Koa (

js 原型链

邮差的信 提交于 2020-03-11 16:32:04
console.log(typeof Object)//null var o = {} ,var obj = new Object, new Dog() console.log(typeof Function) console.log(typeof Number) console.log(typeof Boolean) console.log(typeof String) //除了undefined js 其余5中类型的封装类型本质都是函数 console.log(typeof undefined) console.log(typeof Date) console.log(typeof Array) console.log(Date.prototype) console.log(Object.prototype) console.log(Function.prototype)//function(){} 上面是迷惑你的,下面才是干货: function Father(){ this.p = 'p' } var f = new Father function Son(){ } //Son 构造函数的原型对象 指向了f //这样就继承了f 的p 属性 Son.prototype = f //Son 的实例中有一个__proto__记录了 原型对象 Son.prototype 也就是

原型和原型链

↘锁芯ラ 提交于 2020-03-11 16:31:05
1:参照此文理解js的静态方法与实例方法 https://www.cnblogs.com/faithZZZ/p/7045323.html 以下是我结合jquery设计的原理的一些理解 var Fn=function(){        //【注意】用this定义出来的属性和方法是在prototype里的          this.a=10;          this.add=function(){          console.log('add');          }        } //给Fn添加静态属性和方法,这些静态属性和方法只有Fn才能引用到 //jquery的$就是一个类似Fn的方法,$.trim()就是$的一个静态方法。 Fn.age=18; Fn.trim=function(){ console.log('trim'); } console.log(Fn.trim); //给Fn添加实例属性和方法,这些实例的属性和方法只有实例出来的对象(new出来的对象)才有 //jquery中的addClass也是这样添加的,$('span') 调用$方法,传参'span'会返回一个实例对象出来 Fn.prototype.name='penny'; Fn.prototype.addClass=function(){ console.log('addClass'); }

js 原型链

我只是一个虾纸丫 提交于 2020-03-11 16:30:46
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script type="text/javascript"> var person = function (name) { this.name = name; }; person.prototype.getName = function() { return this.name; }; var student = new person('jerome'); console.log(student); // person { name: 'jerome' } console.log(student.prototype); //undefined, 对象原型没有prototype console.log(student.__proto__); // person {} console.log(person); // function person(name) console.log(person.prototype); // person {} console.log(person.__proto__); // function Empty() console.log(person

原型链

故事扮演 提交于 2020-03-11 16:29:34
1.首选写几个函数 // 构造函数function Person(name, age, job) { this.name = name this.age = age this.job = job this.sayName = function () { alert(this.name) }}console.log(Person)var person1 = new Person('zhaojie', 55, 'leader');var person2 = new Person('zhou', 20, 'player');console.log(person1)console.log(person2)console.log(person1.constructor == Person);console.log(person2.constructor == Person);// 原型对象function Person() { Person.prototype.name = 'zhouyi' Person.prototype.age = '26' Person.prototype.job = 'engineer' Person.prototype.sayName = function () { alert(this.name) }}let person6=new Person();