标签:system oca wget current scom -o least ted ima
yum install docker
systemctl start docker
systemctl enable docker
docker pull centos
yum install
等待很漫长。如果报错:Cannot set property TasksAccounting, or unknown propertycp jdk*.tar.gz到容器中,解压
vi /etc/profile
export JAVA_HOME=/usr/local/java8
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -version
#获取 mysql 的yum源
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
#安装上面的yum 源
yum -y install mysql57-community-release-el7-10.noarch.rpm
#yum 安装 mysql
yum -y install mysql-community-server
#开启服务
systemctl start mysqld
mysqld --verbose --help --pid-file=/var/run/mysqld/mysqld.pid | grep -A 1 "Default options"
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
validate_password=OFF
character-set-server=utf8
collation-server=utf8_general_ci
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=utf8
grep "password" /var/log/mysqld.log
#结果:[Note] A temporary password is generated for root@localhost: k:nT<dT,t4sF
#使用这个密码登录mysql
#r.,X_Wj3o3uc
#fGR2hW)tC;.(
# 进入
mysql -u root -p
#更改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '111111';
# 更改 使mysql可以远端访问
update user set host = '%' where user = 'root';
yum install -y https://centos7.iuscommunity.org/ius-release.rpm
yum update
yum install -y python36u python36u-libs python36u-devel python36u-pip
yum install gcc
python3.6 --version
pip3.6 --version
pip3.6 install supervisor
mkdir /etc/supervisor
echo_supervisord_conf > /etc/supervisor/supervisord.conf
minfds= 819200
[include]
files = /etc/supervisor/*.ini
/tmp/supervisor.sock 改成 /var/run/supervisor.sock,
/tmp/supervisord.log 改成 /var/log/supervisor.log,
/tmp/supervisord.pid 改成 /var/run/supervisor.pid
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ;改为serverurl=unix:///var/run/supervisor.sock
chmod 777 /run
chmod 777 /var/log
touch /var/run/supervisor.sock
chmod 777 /var/run/supervisor.sock
unlink /var/run/supervisor.sock
supervisord -c /etc/supervisor/supervisord.conf
#将需要监控的编写ini放到/etc/supervisor文件下
1. touch /usr/lib/systemd/system/supervisord.service
2. vi /usr/lib/systemd/system/supervisord.service
# supervisord service for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecStop=/usr/bin/supervisorctl shutdown
ExecReload=/usr/bin/supervisorctl reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
2. systemctl enable supervisord
3. systemctl is-enabled supervisord
[program:test]
user=root
command = nohup java -Xms3g -Xmx3g -jar test.jar > test.log 2>&1 &
directory=/root/test
startsecs=3
stopwaitsecs=0
autostart=true
autorestart=true
stdout_logfile=/var/log/test.log
stderr_logfile=/var/log/test.err
需要Java环境
mv elasticsearch-7.1.0 /usr/local/elasticsearch
vi /usr/local/elasticsearch/config/elasticsearch.yml
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["127.0.0.1", "[::1]"]
# 7.1 版本即便不是多节点也需要配置一个单节点,否则
#the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
cluster.initial_master_nodes: ["node-1"]
# 配置indices fielddata得内存,超过80%就会释放
indices.fielddata.cache.size: 80%
# request数量使用内存限制,默认为JVM堆的40%。
indices.breaker.request.limit: 80%
root
用户elsearch
来执行elasticsearch脚本。ES不能用root用户启动# elasticsearch can not run elasticsearch as root
adduser elsearch # 会自动建组 test
# 将文件夹以及子文件夹全部该为test用户
chown -R elsearch:elsearch elasticsearch
ll
# drwxr-xr-x 1 elsearch elsearch 4096 May 28 16:54 elasticsearch
目前版本有一个默认的type _doc,使用api对文档操作的时候,也不需要在url上加入 type了,直接index即可,具体的api可以大部分都可以通过在url去掉type进行操作。
可以对index进行analyzer设置,将默认的analyzer设置成keyword就不会拆分了。
----------------------------------------------------------------
设置analyzer:需要先关闭index
1. POST http://server_ip/index_name/_close?pretty
2. PUT : http://server_ip/index_name/_settings?pretty
BODY:
{
"index":{
"analysis" : {
"analyzer" : {
"default" : {
"type" : "keyword"
}
}
}
}
}
3. POST http://server_ip/index_name/_open?pretty
string
这个 column type了。可以换成text
或者keyword
{"track_total_hits":true}
,可以查询出total得总数。不会被限制成10000sudo docker commit -a kane testdocker.io/kane0725/test:v1
# 注,这里为了能够提交到dockerhub上, 命名规则必须为docker.io/dockerhub name/****
docker login
docker push docker.io/kane0725/test:java
# 导出打成本地 tar 包
docker export -o test.tar a404c6c174a2
# 将 tar 包导入成镜像
docker import test.tar test_images
Docker&Java&Mysql&Python3&Supervisor&Elasticsearch安装
标签:system oca wget current scom -o least ted ima
原文地址:https://www.cnblogs.com/primadonna/p/11849939.html