1. 程式人生 > >CentOS7完全離線安裝配置NTP、MySQL

CentOS7完全離線安裝配置NTP、MySQL

NTP及依賴 rpm包下載:

MySQL及依賴 rpm包下載:

NTP安裝

# 修改系統時間
[root@10-121-2-96 opt]# timedatectl set-ntp no
[root@10-121-2-96 opt]# timedatectl set-time "2018-07-05 15:06:00"
[root@10-121-2-96 opt]# timedatectl set-timezone Asia/Shanghai
[root@10-121-2-96 opt]# date
Fri Jul  5 15:06:16 CST 2018


# rpm安裝ntp
[root@10
-121-2-96 ~]# cd /opt [root@10-121-2-96 opt]# ls autogen-libopts-5.18-5.el7.x86_64.rpm cloudera-manager-centos7-cm5.13.0_x86_64.tar.gz ntp-4.2.6p5-18.el7.centos.x86_64.rpm ntpdate-4.2.6p5-18.el7.centos.x86_64.rpm soft [root@10-121-2-96 opt]# rpm -ivh autogen-libopts-5.18-5.el7.x86_64.rpm warning: autogen-libopts-5.18
-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:autogen-libopts-5.18-5.el7 ################################# [100%] [root@10-121-2-96 opt]# rpm -ivh ntpdate-4.2.6p5-18.el7.centos.x86_64.rpm
warning: ntpdate-4.2.6p5-18.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:ntpdate-4.2.6p5-18.el7.centos ################################# [100%] [root@10-121-2-96 opt]# rpm -ivh ntp-4.2.6p5-18.el7.centos.x86_64.rpm warning: ntp-4.2.6p5-18.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:ntp-4.2.6p5-18.el7.centos ################################# [100%] # ntp server 10.121.2.106 [root@10-121-2-106 opt]# vi /etc/ntp.conf restrict 10.121.2.106 mask 255.255.255.0 nomodify notrap # 允許內網其他機器同步時間 server 127.127.1.0 # 外部時間伺服器不可用時,以本地時間作為時間服務 fudge 127.127.1.0 stratum 10 [root@10-121-2-106 opt]# service ntpd restart Redirecting to /bin/systemctl restart ntpd.service [root@10-121-2-106 opt]# systemctl disable chronyd.service [root@10-121-2-106 opt]# systemctl enable ntpd.service # 設定開機啟動 [root@10-121-2-106 opt]# ntpstat synchronised to local net at stratum 11 time correct to within 7948 ms polling server every 64 s [root@10-121-2-106 opt]# systemctl status ntpd.service ● ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2018-07-06 09:18:49 CST; 22s ago Process: 12428 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 12429 (ntpd) CGroup: /system.slice/ntpd.service └─12429 /usr/sbin/ntpd -u ntp:ntp -g Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listen and drop on 1 v6wildcard :: UDP 123 Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listen normally on 2 lo 127.0.0.1 UDP 123 Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listen normally on 3 bond0 10.121.2.106 UDP 123 Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listen normally on 4 lo ::1 UDP 123 Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listen normally on 5 bond0 fe80::92ec:baff:fe20:e0f2 UDP 123 Jul 06 09:18:49 adrmbda106 ntpd[12429]: Listening on routing socket on fd #22 for interface updates Jul 06 09:18:49 adrmbda106 ntpd[12429]: 0.0.0.0 c016 06 restart Jul 06 09:18:49 adrmbda106 ntpd[12429]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM Jul 06 09:18:49 adrmbda106 ntpd[12429]: 0.0.0.0 c011 01 freq_not_set Jul 06 09:18:50 adrmbda106 ntpd[12429]: 0.0.0.0 c514 04 freq_mode # ntp client 96-105 [root@10-121-2-96 opt]# vi /etc/ntp.conf server 10.121.2.106 #<--該IP是NTP主機端的IP restrict 10.121.2.106 nomodify notrap noquery # 允許上層時間伺服器主動修改本機時間 [root@10-121-2-96 opt]# ntpdate -u 10.121.2.106 # 手動同步主機端,免得本地時間與主機端相差太大導致無法同步。 6 Jul 03:15:45 ntpdate[3107]: adjust time server 10.121.2.106 offset -0.050032 sec [root@10-121-2-96 opt]# service ntpd restart Redirecting to /bin/systemctl restart ntpd.service [root@10-121-2-96 opt]# systemctl disable chronyd.service [root@10-121-2-96 opt]# systemctl enable ntpd.service # 設定開機啟動 [root@10-121-2-96 opt]# ntpstat synchronised to NTP server (10.121.2.106) at stratum 12 time correct to within 8415 ms polling server every 64 s

MySQL安裝

[[email protected]10-121-2-97 opt]# rpm -qa|grep -i mysql
[[email protected]10-121-2-97 opt]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[[email protected]10-121-2-97 opt]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
[[email protected]10-121-2-97 opt]# rpm -ivh net-tools-2.0-0.22.20131004git.el7.x86_64.rpm 
warning: net-tools-2.0-0.22.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:net-tools-2.0-0.22.20131004git.el################################# [100%]
[[email protected]10-121-2-97 opt]# rpm -ivh MySQL-server-5.6.31-1.el6.x86_64.rpm MySQL-client-5.6.31-1.el6.x86_64.rpm MySQL-devel-5.6.31-1.el6.x86_64.rpm
warning: MySQL-server-5.6.31-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-devel-5.6.31-1.el6         ################################# [ 33%]
   2:MySQL-client-5.6.31-1.el6        ################################# [ 67%]
   3:MySQL-server-5.6.31-1.el6        ################################# [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
...

[[email protected]10-121-2-97 opt]# vi /root/.mysql_secret
[[email protected]10-121-2-97 opt]# mysql -uroot -p6TJB64cHxR4V62SK
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[[email protected]10-121-2-97 opt]# service mysql start
Starting MySQL. SUCCESS! 
[[email protected]10-121-2-97 opt]# mysql -uroot -p6TJB64cHxR4V62SK
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.31

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update user set password=PASSWORD('xxx') where USER='root';
ERROR 1046 (3D000): No database selected
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> set password=password('xxx');
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD('xxx') where USER='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 4  Changed: 3  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye


[[email protected]10-121-2-97 opt]# chkconfig mysql on
[[email protected]10-121-2-97 opt]# mysql -uroot -pxxx
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

相關推薦

CentOS7完全離線安裝配置NTPMySQL

NTP及依賴 rpm包下載: MySQL及依賴 rpm包下載: NTP安裝 # 修改系統時間 [root@10-121-2-96 opt]# timedatectl set-ntp no [root@10-121-2-96 opt]#

Centos6.5 安裝配置 TomcatMySQL環境

一、Centos 配置JRE tar -zxvf jre-8u144-linux-x64.tar.gz 3、解壓後配置環境變數,在最後增加: vi /etc/profile ex

Centos7安裝配置Apache+PHP+Mysql+phpmyadmin

css isa roo awk perm mha pack 操作 req 轉載自: Centos7安裝配置Apache+PHP+Mysql+phpmyadmin 一、安裝Apache yum install httpd 安裝成功後,Apache操作命令: systemc

CentOS7.4 系統安裝配置LAMP(Apache+PHP5+MySQL)伺服器環境

準備篇: 1、配置防火牆,開啟80埠、3306埠 CentOS7是用firewalld管理防火牆,和以前iptables的方式有較大區別,網上文章很多,這裡就不詳述了。 安裝篇: 一、安裝Apache yum install httpd #根據提示,輸入Y安裝即可成功安裝 /etc

Ubuntu16.04完全離線安裝mysql

申明:本部落格的行文思路和大致內容轉載自http://www.cnblogs.com/JasonTech0713/p/6690949.html  與轉載部落格的區別在於,本部落格屬於在完全無網路下安裝及配置mysql,包括依賴包的安裝和相關包的下載連結 一、在官網下載mys

CentOS7.0 MariaDB 安裝配置後使用遠端工具SQLyog 錯誤1130(遠端連線mysql 授權)

LAMP安裝配置好服務後,windows遠端操作mariadb。 windows上下載HeidiSQL,在firewall開啟MySQL服務開啟3306埠; 連接出現1130錯誤,經過錯誤查詢,1130是由於登陸賬戶禁止本機localhost

CentOS7 Cloudera Manager6 完全離線安裝 CDH6 叢集

本文是在CentOS7.4 下進行CDH6叢集的完全離線部署。CDH5叢集與CDH6叢集的部署區別比較大。 說明:本文內容所有操作都是在root使用者下進行的。 檔案下載 首先一些安裝CDH6叢集的必須檔案要先在外網環境先下載好。 Cloudera Manager 6.3.0 CM6 RPM:https://

001-docker安裝【nginxmysql

瀏覽器 配置 操作 nbsp emctl mct lac 這就是 systemctl 一、 1、系統配置要求   操作系統:64位操作系統和3.10或者更高版本的內核:uname -r   Docker-v1.12 及更高版本   Docker Compose-v1

centos6.5安裝配置NTP,集群各機器間時間同步

rest tar 6.2 border 平滑 n) correct restrict net 試驗環境 提君博客原創 >>提君博客原創 http://www.cnblogs.com/tijun/ << IP 主機名 角色

Ubuntu安裝配置JDKTomcatSVN服務器

ubunt jdk tomcat svn 摘要:本文主要介紹了如何在ubuntu下安裝與配置jdk、tomcat、及svn服務器 環境:VMware + Ubuntu14.04一、配置jdk1、下載JDKhttp://www.oracle.com/technetwork/j

centos7 下Neo4j 安裝配置備份

oca ucc reload check 備份 success 地址 doc des 安裝1、先安裝jdk,這裏安裝jdk82、添加yum源安裝Vim /etc/yum.repos.d/neo4j.repo [neo4j] name=Neo4j Yum Repo baseu

k8s 1.9.1 centos7 install 離線安裝

article sudo -a blog .net 密碼 persist per star 參考 http://blog.csdn.net/acxlm/article/details/79069468遇到的問題及解決:1. 直接用aliyun docker 可以用最新的,

java基礎 第一章上(安裝 配置java簡單dos命令)

目錄 環境 文件中 blog 命令 下載安裝 path 屏幕 java基礎 一、安裝 配置java 下載安裝 1.java官網下載jdk(32位或者64位根據自己電腦而定)。 2.雙擊jdk.exe文件安裝。 環境變

mysql安裝配置 (單個mysql安裝

AD data datadir 設置 安裝配置 nbsp c盤 啟動 mda mysql安裝於 c盤因為有註冊文件 和註冊表 1.為了防止mysql數據表變大和sql日誌增加 改變C:\ProgramData\MySQL\MySQL Server 5.7\my.ini

Linux安裝java jdkmysqltomcat

ref app 1.0 重置密碼 esc 啟動mysql TP mar des 安裝javajdk 1.8 檢查是否安裝 rpm -qa | grep jdk rpm方式安裝 下載java1.8 jdk http://download.oracle.com/otn-pub/

centOS7下Spark安裝配置

節點 bin scala www. emp 讓其 slave park exec 環境說明: 操作系統: centos7 64位 3臺 centos7-1 192.168.190.130 master centos7-

centos7離線安裝rabbitMQ3.6.1

管理 tags follow start href gin -- admin 裝包 強制不檢查依賴,安裝所有rpm包rpm -ivh 01_rabbitMQ3.6.1/* --nodeps --force#關閉防火墻systemctl disable firewalld.s

開啟運維之路之第 4 篇——常見軟體安裝:JREMySQLTomcat安裝

1、JRE安裝:在正式環境裡 我們可以不安裝jdk ,僅僅安裝Java執行環境 jre即可。 ①下載jre:JRE官網下載地址 開啟連結,勾選協議,下載Linux版本64位的 ②上傳jre到/home/data/下:使用FTP工具上傳。 如果上傳過程遇到下面的問題:連線到

centos7離線安裝MongoDB3.2.8叢集

1.自啟動指令碼/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/master.conf/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/confs/slave1.conf/usr/loca

centos7離線安裝MongoDB3.2.8集群

baidu 啟動 config 離線安裝 離線 host -- ember 自啟動腳本 1.自啟動腳本/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/master.conf/usr/local/mongodb/bin/