中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

網(wǎng)站制作 網(wǎng)絡(luò)推廣武漢整站seo數(shù)據(jù)上云

網(wǎng)站制作 網(wǎng)絡(luò)推廣,武漢整站seo數(shù)據(jù)上云,做網(wǎng)站ruby還是python,做的網(wǎng)站怎么打開是白板環(huán)境 centos6.7 虛擬機(jī)兩臺 主:192.168.23.160 從:192.168.23.163 準(zhǔn)備 在兩臺機(jī)器上分別安裝mysql5.6.23,安裝完成后利用臨時(shí)密碼登錄mysql數(shù)據(jù)修改root的密碼;將my.cnf配置文件放至/etc/my.cnf,重啟mysql服務(wù)進(jìn)…

環(huán)境

centos6.7 虛擬機(jī)兩臺

主:192.168.23.160

從:192.168.23.163

準(zhǔn)備

在兩臺機(jī)器上分別安裝mysql5.6.23,安裝完成后利用臨時(shí)密碼登錄mysql數(shù)據(jù)修改root的密碼;將my.cnf配置文件放至/etc/my.cnf,重啟mysql服務(wù)進(jìn)程。

my.cnf 初始內(nèi)容:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.[mysqld]lower_case_table_names=1
skip_name_resolve
character-set-server=utf8
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.innodb_buffer_pool_size = 2G
long_query_time=2
slow_query_log=0
log_queries_not_using_index=1
thread_concurrency=8
thread_cache_size=32
max_connections=500
max_connect_errors=800# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

配置主庫

在主庫的my.cnf配置文件的[mysqld]節(jié)點(diǎn)下增加

server_id=160

log_bin=mysql-bin

log_bin_trust_function_creators=1

重啟mysql服務(wù)后登錄mysql數(shù)據(jù)庫,執(zhí)行 how master status; 查看主庫的狀態(tài)

在這里插入圖片描述

創(chuàng)建同步賬號:grant replication slave on . to ‘sync’@’%’ identified by ‘123456’;

配置從庫

在從庫的my.cnf配置文件的[mysqld]節(jié)點(diǎn)下增加

server_id=163

replicate-ignore-table=dbname.table1,dbname.table2 //需要忽略同步的表

重啟mysql服務(wù)后登錄mysql數(shù)據(jù)庫,執(zhí)行以下命令:

change master to master_host='192.168.23.160', master_port=3306, master_user='sync', master_password='123456', master_log_file='mysql-bin.000004', master_log_pos=425;

master_log_file、master_log_pos為主庫通過“how master status;”命令查詢出來的結(jié)果。

通過show slave status \G;查看從庫的連接狀態(tài)

在這里插入圖片描述

Slave_IO_Running、Slave_SQL_Running狀態(tài)都為“Yes”表示成功。

注意:服務(wù)器直接要開放3306 端口,或者關(guān)閉防火墻!

初次配置可能會有Slave_IO_Running、Slave_SQL_Running狀態(tài)都為“No”的情況,重啟從庫可以解決(保證主、從庫配置正確、網(wǎng)絡(luò)連接正常)。

日志配置

隨著數(shù)據(jù)增多,日志文件會越來越多,需要定時(shí)清理日志,不然日志文件會占滿磁盤。

在my.cnf 添加:expire_logs_days=[days] – 天數(shù),表示在主數(shù)據(jù)庫日志切換的時(shí)候會刪除指定天數(shù)以前的日志;max_binlog_size 可以設(shè)置單個(gè)二進(jìn)制文件的大小。

日志文件目錄修改(主庫)

1、關(guān)閉mysql服務(wù)

2、將原目錄(/var/lib/mysql)下的mysql-bin.*文件移動(dòng)到新的目錄下(/home/mysql-logs),目錄要有可讀寫權(quán)限;修改mysql-bin.index文件中的文件目錄為絕對路徑,如:/home/mysql-logs/mysql-bin.000001。

3、修改配置文件,log_bin=home/mysql-logs/mysql-bin

4、啟動(dòng)mysql服務(wù)

讀寫分離(mysql-proxy)

windows 下配置

[mysql-proxy]
admin-lua-script=D:/tools/mysql-proxy/lib/mysql-proxy/lua/admin.lua
proxy-backend-addresses=192.168.23.160:3306  -- 主庫
proxy-read-only-backend-addresses=192.168.23.163:3306  -- 從庫
proxy-lua-script=D:/tools/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua
log-file=D:/tools/mysql-proxy/log/mysql-proxy.log
log-level=debug
daemon=true
keepalive=true

Linux 下配置

安裝pkg-config

1、編譯mysql-proxy

**注:**0.8.5 不需要編譯,也不需要有安裝pkg-config

用mysql-proxy -V查看mysql-proxy的相關(guān)信息,這里留意下版本信息,將會在第三步配置lua路徑的時(shí)候用到;

2、使用vim /etc/mysql-proxy.cnf命令打開mysqk-proxy的配置文件進(jìn)行編輯:

在mysql-proxy.cnf中輸入如下內(nèi)容:

[mysql-proxy] 
admin-username=user   #admin用戶名
admin-password=password    admin密碼
admin-lua-script=/usr/lib64/mysql-proxy/lua/admin.lua    #lua位置,參見上面的版本信息
daemon=true   # mysql-proxy以守護(hù)進(jìn)程方式運(yùn)行
keepalive=true    #保持連接啟動(dòng)進(jìn)程會有2個(gè), 一號進(jìn)程用來監(jiān)視二號進(jìn)程
proxy-backend-addresses=10.17.6.210   #目標(biāo)地址,Indb內(nèi)網(wǎng)地址,默認(rèn)端口3306,10.17.6.210是目標(biāo)inDB的ip
log-file=/var/log/mysql-proxy.log    #日志文件存儲路徑
log-level=debug

編輯完之后通過Esc退出編輯,然后用“:wq”保存mysql-proxy.cnf的編輯。

3、用chmod 0660 /etc/mysql-proxy.cnf命令來改變配置文件的權(quán)限,然后用 mysql-proxy --defaults-file=/etc/mysql-proxy.cnf啟動(dòng)mysql-proxy服務(wù):

chmod 0660 /etc/mysql-proxy.cnf
mysql-proxy --defaults-file=/etc/mysql-proxy.cnf

4、用mysql -h$uhost_ip -P4040 -u$User -p$Password測試:

mysql -h106.75.94.37 -P4040 -uroot -p123456

$uhost_ip:UHost的外網(wǎng)IP $User:用戶名 $Password:數(shù)據(jù)庫密碼

注意:打開防火墻的4040端口,MySQL-Proxy默認(rèn)端口為4040,通過訪問4040端口就可以訪問3306端口。

http://www.risenshineclean.com/news/6124.html

相關(guān)文章:

  • asp動(dòng)態(tài)網(wǎng)站開發(fā)畢業(yè)設(shè)計(jì)營銷推廣的平臺
  • 揚(yáng)州服務(wù)器租用seo成都培訓(xùn)
  • 河南企業(yè)網(wǎng)站營銷設(shè)計(jì)網(wǎng)絡(luò)營銷品牌案例
  • 專業(yè)做網(wǎng)站+上海水果店推廣營銷方案
  • 如何利用微博推廣網(wǎng)站so導(dǎo)航 抖音
  • 為了 門戶網(wǎng)站建設(shè)優(yōu)化課程
  • 做收費(fèi)網(wǎng)站成都百度推廣公司聯(lián)系電話
  • 網(wǎng)站建設(shè)與網(wǎng)頁設(shè)計(jì)作業(yè)軟文世界平臺
  • 畢業(yè)設(shè)計(jì)做網(wǎng)站答辯深圳剛剛突然宣布
  • 做返利網(wǎng)站能賺錢么網(wǎng)絡(luò)營銷做得好的企業(yè)有哪些
  • 贛州網(wǎng)站制作培訓(xùn)建網(wǎng)站找哪個(gè)平臺好呢
  • 表情包在線制作網(wǎng)站網(wǎng)絡(luò)搜索關(guān)鍵詞排名
  • 網(wǎng)站站內(nèi)交換鏈接怎么做創(chuàng)建網(wǎng)站
  • 廈門做網(wǎng)頁網(wǎng)站的公司怎么自己制作一個(gè)網(wǎng)站
  • 做網(wǎng)站買二手域名網(wǎng)絡(luò)營銷推廣培訓(xùn)機(jī)構(gòu)
  • 網(wǎng)站欄目模板如何選擇谷歌seo課程
  • 大站網(wǎng)站建設(shè)百度自動(dòng)優(yōu)化
  • 遵義網(wǎng)站建設(shè)中心seo優(yōu)化專員編輯
  • 龍華建設(shè)網(wǎng)站企業(yè)郵箱查詢
  • 如何在路由器上做網(wǎng)站轉(zhuǎn)跳app下載推廣
  • 網(wǎng)站建設(shè)游戲公司免費(fèi)手游推廣代理平臺渠道
  • 深圳做公司網(wǎng)站seo管理
  • dw怎么做網(wǎng)站地圖奶茶店推廣軟文500字
  • 南山網(wǎng)站多少錢什么叫seo
  • 福州營銷型網(wǎng)站建設(shè)公司今日新聞聯(lián)播
  • 公司網(wǎng)站制作企業(yè)建站平臺哪個(gè)比較權(quán)威
  • 中交建設(shè)集團(tuán) 網(wǎng)站營銷型網(wǎng)站有哪些功能
  • 做3dmax的網(wǎng)站國內(nèi)搜索引擎排名第一
  • 網(wǎng)站服務(wù)器有哪些類型有哪些類型有哪些類型有哪些類型百度推廣一年大概需要多少錢
  • 蘭州做網(wǎng)站哪家專業(yè)株洲專業(yè)seo優(yōu)化