码迷,mamicode.com
首页 > 其他好文 > 详细

Centos 安装配置

时间:2018-10-08 11:22:34      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:scripts   start   mysql-bin   cron   bootproto   network   soc   name   registry   

VirtualBox install CentOS

 

Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法

问题:

CentOS7安装完毕,重新开机启动后显示:

Initial setup of CentOS Linux 7 (core)

1) [x] Creat user 2) [!] License information

(no user will be created) (license not accepted)

Please make your choice from above [‘q‘ to quit | ‘c‘ to continue | ‘r‘ to refresh]:

解决方法:

输入1”,按Enter

输入2”,按Enter

输入q",按Enter

输入yes”,按Enter

 

CentOS设置静态IP地址

vi /etc/sysconfig/network-scripts/ifcfg-enp0s8

 

BOOTPROTO=static #dhcp改为static

IPADDR=172.31.44.100 #静态IP

GATEWAY=172.31.44.1 #默认网关

NETMASK=255.255.255.0 #子网掩码

DNS1=172.28.4.103 #DNS 配置

 

CentOS 7 修改主机名

hostname

hostnamectl set-hostname "Registry"

hostname

 

关防火墙

/etc/init.d/iptables stop

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

systemctl restart network #重启网络 service network restart

 

打开端口号

vim /etc/sysconfig/iptables

centos防火墙开启端口--22端口后添加一行

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

service iptables restart

 

Centos7设置成开机默认命令行模式

1,命令模式

systemctl set-default multi-user.target

2,图形模式

systemctl set-default graphical.target

 

ssh root@172.31.46.32

 

如何开启Centos7系统的SSH服务

1、登录Centos7系统。

示例:使用root用户登录。

注:若为非root用户登录,输入执行某些命权限不够时需加sudo

 

2、查看SSH是否安装。

输入命令:rpm -qa | grep ssh

注:若没安装SSH则可输入:yum install openssh-server安装。

 

3、启动SSH服务。

输入命令:service sshd restart  重启SSH服务。

  命令:service sshd start 启动服务 |  命令:service sshd stop 停止服务  

  重启后可输入:netstat -antp | grep sshd 查看是否启动22端口(可略)。

 

4、如何设置SSH服务为开机启动?

输入命令:chkconfig sshd on 即可。

注:若是chkconfig sshd off则禁止SSH开机启动。

 

5、远程访问连接Centos7系统。

Windows下使用:puttySecureCRT可远程连接SSH服务。

Linux下直接使用命令:ssh ip(如:ssh 192.168.1.11)。

 

配置Java环境变量

vim /etc/profile

 

export JAVA_HOME=/root/Java/jdk1.7.0_79

export PATH=$JAVA_HOME/bin:$PATH

 

export MAVEN_HOME=/root/Java/apache-maven-3.3.9

export PATH=$MAVEN_HOME/bin:$PATH

 

source /etc/profile

 

cron

http://blog.csdn.net/yq495/article/details/7399277

1yum install vixie-cron

2vi backup.sh

#!/bin/sh

# file:/home/mysql/backup.sh

today=`date +%Y%m%d`

echo $today

mysqldump -uroot -pYunluqwe -h 127.0.0.1 yunlu > /home/mysql/backup/$today.sql

3crontab -e

33 3 * * * /home/mysql/backup/backup.sh

4/sbin/service crond restart

 

Centos6.5下安装Memcached完整示例

http://www.tuicool.com/articles/qYJBVb

 

我的ZenTao禅道的安装(windowslinux下都试过)

http://blog.csdn.net/lwx2615/article/details/6124125

 

安装mysql 

http://www.cnblogs.com/hb_cattle/archive/2011/10/16/2213825.html

卸载老版本

yum remove mysql-libs-5.1.71-1.el6.x86_64

rpm -qa | grep mysql

yum -y install perl

yum install libaio

rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm

rpm -ivh MySQL-server-5.5.39-2.rhel5.x86_64.rpm

rpm -ivh MySQL-client-5.5.39-2.rhel5.x86_64.rpm

rpm -ivh MySQL-devel-5.5.39-2.rhel5.x86_64.rpm

 

修改 mysql 字符集

cp /usr/share/doc/mysql-server-5.1.61/my-medium.cnf /etc/my.cnf

vi /etc/my.cnf

[client]

default-character-set=utf8

 

[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci

init-connect = ‘set names utf8‘

 

flush privileges;

 

Centos mysql 配置主从

 

Master

# The MySQL server

[mysqld]

user = mysql

pid-file = /var/lib/mysql/mysqld.pid

socket = /var/lib/mysql/mysqld.sock

port = 3306

basedir = /usr

datadir = /var/lib/mysql

tmpdir = /tmp

log-bin = master-bin

log-bin-index = master-bin.index

server-id = 1

 

CREATE USER repl_user;

GRANT REPLICATION SLAVE ON *.* TO repl_user IDENTIFIED BY ‘YUNLU!@#qwe‘;

 

Slave

# The MySQL server

[mysqld]

user = mysql

pid-file = /var/lib/mysql/mysqld.pid

socket = /var/lib/mysql/mysqld.sock

port = 3306

basedir = /usr

datadir = /var/lib/mysql

tmpdir = /tmp

server-id = 2

relay-log-index = slave-relay-bin.index

relay-log = slave-relay-bin

log-bin=mysql-bin

?

注释掉下面的

#server-id = 1

 

CHANGE MASTER TO MASTER_HOST = ‘60.194.51.21‘, MASTER_PORT = 3306, MASTER_USER = ‘repl_user‘, MASTER_PASSWORD = ‘YUNLU!@#qwe‘;

 

START SLAVE;

 

停止主从复制

slave stop;

reset slave;

flush privileges;

 

http://blog.csdn.net/shaobingj126/article/details/8128287

 

Centos 安装配置

标签:scripts   start   mysql-bin   cron   bootproto   network   soc   name   registry   

原文地址:https://www.cnblogs.com/pizhiyun/p/9752988.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!