systemctl status firewalld 查看防火墙详细状态信息
firewall-cmd --state 查看防火墙运行状态
systemctl stop/start firewalld.service 关闭/启动 防火墙
systemctl diable/enable firewalld.service 禁止/允许 开机启动
cd /etc
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.back #建议备份或者改名
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache #生成缓存
yum -y install wget
vi /etc/profile
export JAVA_HOME=/usr/local/jdk1.8/jdk1.8.0_201
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -versoin
yum -y install gcc #在线安装gcc
yum -y install gcc-c++ #在线安装gcc-c++
sudo yum remove docker\
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
#卸载旧版本
yum install -y yum-utils device-mapper-persistent-data lvm2
yum -config -manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#推荐用这个:yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#查看版本:
yum list docker-ce --showduplicates | sort -r
#安装指定版本:
sudo yum -y install docker-ce-17.12.0.ce-1.el7.centos
#安装最新版:
yum -y install docker-ce docker-ce-cli containerd.io
#配置docker的加速镜像
#在etc 新建一个docker
#(新版的里面,没有该文件)
vi /etc/docker/daemon.json
#添加
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
systemctl enable docker
systemctl start docker
systemctl start docker #启动docker
docker version #查看docker的版本
docker info #显示全系统信息
5.1 运行此命令以下载Docker Compose的当前稳定版本:(太慢不建议使用)
#sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#国内镜像
curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose
要安装不同版本的Compose,请替换1.24.0 为要使用的Compose版本。
遇到问题可以参考的文档:https://docs.docker.com/compose/install/#alternative-install-options
5.2 对二进制文件应用可执行权限:
sudo chmod +x /usr/local/bin/docker-compose
注意:如果docker-compose安装后命令失败,请检查您的路径。您还可以创建/usr/bin路径中的符号链接或任何其他目录。
例如:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
3、验证安装:docker-compose --version
cd /usr/local
mkdir redis
cd redis
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar -zxvf xx.gz #解压
mv #重命名一下
#因为是C语言写的程序,所以需要make编译一下,所以需要先安装gcc、gcc-c++
yum -y install gcc
yum -y install gcc-c++
cd redis #进入解压后的目录
make #编译
make install PREFIX=/usr/local/redis #默认是/usr/local/bin ,安装到指定目录下的bin文件夹下(bin自动创建)
cd ../bin #进入bin目录
./redis-server #启动(默认在前台启动)
#新开一个窗口连接,启动客户端连接 ./redis-cli
#配置文件参考之前的服务器
https://www.cnblogs.com/daemon-/p/9009360.html
rpm -qa | grep mysql
返回空值的话,就说明没有安装 MySQL 。
注意:在新版本的CentOS7中,默认的数据库已更新为了Mariadb,而非 MySQL,所以执行 yum install mysql 命令只是更新Mariadb数据库,并不会安装 MySQL 。
2. 查看已安装的 Mariadb 数据库版本。
rpm -qa|grep -i mariadb
rpm -qa|grep mariadb|xargs rpm -e --nodeps
rpm -qa|grep -i mariadb
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
tar -xvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/
mv /usr/local/mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql
mkdir /usr/local/mysql/data
groupadd mysql
useradd mysql -g mysql
chown -R mysql.mysql /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
如果出现以下错误:
2018-07-14 06:40:32 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2018-07-14 06:40:32 [ERROR] Child process: /usr/local/mysql/bin/mysqldterminated prematurely with errno= 32
2018-07-14 06:40:32 [ERROR] Failed to execute /usr/local/mysql/bin/mysqld --bootstrap --datadir=/usr/local/mysql/data --lc-messages-dir=/usr/local/mysql/share --lc-messages=en_US --basedir=/usr/local/mysql
– server log begin –
– server log end –
则使用以下命令:
/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data --initialize
如果出现以下错误:
/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
则执行以下命令:
yum -y install numactl
/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data --initialize
[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
socket=/tmp/mysql.sock
user=mysql
port=3306
character-set-server=utf8
skip-grant-tables
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
7、开启服务
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
service mysql start
8、设置密码
/usr/local/mysql/bin/mysql -u root -p
use mysql;
update user set authentication_string=password('你的密码') where user='root';
update user set authentication_string=password('') where user='root';
flush privileges;
exit;
忘记密码的解决办法:
vim /etc/my.cnf
在mysqld下加上:skip-grant-tables
启动mysql: service mysqld start
登录mysql: mysql
修改密码(重点):
mysql5.7不建议用update去修改密码:
update mysql.user set password=password(‘root’) where user=‘root’
这样修改的话,会报错,mysql5.7密码的字段不叫password,应该用命令:
update mysql.user set authentication_string=password(‘123456’) where user=‘root’
这样修改也能成功,但是后面操作数据库的话会报错。
此处两个问题:
第一:密码应该为:小写字母,大写字母,符号,数字,字符数>8
第二:修改密码应该用命令:ALTER USER ‘root’@‘localhost’IDENTIFIED BY ‘aaBBcc11%22&33’
如果设置允许远程登录,可以用:ALTER USER ‘root’@’%’ IDENTIFIED BY ‘aaBBcc11%22&33’
修改好之后flush privileges刷新一下
然后将my.cnf里面的配置改回来,重启mysql:service mysqld restart
/usr/local/mysql/bin/mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '修改后的密码';
exit;
/usr/local/mysql/bin/mysql -u root -p
use mysql;
update user set host='%' where user = 'root';
flush privileges;
eixt;
方案三
自己创建表,把字段一个个的创建了,再导入数据即可
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y openssl openssl-devel
wget http://nginx.org/download/nginx-1.14.0.tar.gz
#nginx-1.14.0.tar.gz包拷贝到“/usr/local/src”下。然后解压。
cd /usr/local/src/nginx
./configure --prefix=/usr/local/nginx
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
#进入/usr/local/nginx中查看
sbin/nginx #启动
sbin/nginx –s reload #刷新配置重启
sbin/nginx –t #检查配置
https://www.wandouip.com/t5i369427/
一、使用docker安装:
docker run --name solr -p 8983:8983 -d solr
二、solr core的创建
进入solr容器
docker exec -it 实例id /bin/bash
#复制配置文件到core文件夹【-r:递归复制,用于目录的复制操作】
cp -r server/solr/configsets/_default/conf /var/solr/data/test1
#自己的:
cp -r server/solr/configsets/_default/conf /opt/solr/server/solr/product-core
#再到solr页面创建core
三、solr的中文分词和配置文件
solr最新docker版:分词器目录:
/opt/solr/server/solr-webapp/webapp/WEB-INF/lib
#配置文件目录:
/opt/solrhome/product-core/conf/managed-schema
#1.拉取镜像
docker pull rabbitmq:management
#2.编写启动脚本
vim start.sh
docker rm -f rabbitmq
docker run -d -e RABBITMQ_DEFAULT_USER=rabbit -e RABBITMQ_DEFAULT_PASS=123456 -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
#3.脚本授权
chmod 777 start.sh
#4.启动
./start.sh
#1.安装rabbitmq
yum install -y rabbitmq-server-3.6.8-1.el7.noarch.rpm
#2.修改文件
vi /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbit@localhost
#3.启动服务
service rabbitmq-server start
#4.查看RabbitMQ启动状态
rabbitmqctl status
#5.创建用户
rabbitmqctl add_user rabbit 123456
#6分配权限
rabbitmqctl set_permissions -p "/" rabbit ".*" ".*" ".*"
#7.查看用户列表
rabbitmqctl list_users
#8.设置为管理员
rabbitmqctl set_user_tags rabbit administrator
#9.打开管理工具
rabbitmq-plugins enable rabbitmq_management
#10.打开防火墙(安全组)
#11.关闭服务
service rabbitmq-server stop
docker pull elasticsearch:7.2.0
docker run -it --name elasticsearch -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.2.0
docker pull kibana:7.2.0
docker run --name kibana -p 5601:5601 -d kibana:7.2.0
docker exec -it kibana /bin/bash
cd config
vi kibana.yml
exit
docker restart kibana