github.com/maenmax/kairep@v0.0.0-20210218001208-55bf3df36788/configs/generate_config.sh (about) 1 #!/bin/bash 2 3 #endpoint_hostname = "maen" 4 #endpoint_port = 8082 5 #debug = false 6 #cass_address = "172.31.78.130,172.31.1.243,172.31.6.210,172.31.69.146,172.31.24.152,172.31.27.215" 7 #keyspace = "autopush" 8 #statsd_host = "3.208.185.178" 9 #statsd_port = 8125 10 #max_msg_length = 4096 11 12 # max_msg: The maximum number of messages per UAID. Set to Zero in order to disable message limitation. 13 # Disabling message limitation(setting it to Zero) means that the is no need to connect to RedisDB. So connection will not be established to Redis. 14 #max_msg = 5 15 16 #[Redis] 17 # Host = "172.31.54.10:7000,172.31.54.10:7000,172.31.54.10:7000,172.31.54.10:7000,172.31.54.10:7000,172.31.54.10:7000" 18 # Table_Prefix = "counterdb" 19 # Max_Redirects = 16 20 21 #Maximum number of socket connections. 22 #PoolSize applies per cluster node and not for the whole cluster 23 # Connection_Pool_Size = 10 24 25 26 27 rm /data/autopush/configs/autopush_endpoint.conf 28 target_file=/data/autopush/configs/autopush_endpoint.conf 29 30 31 if [ "x" != "x${ENDPOINT_HOSTNAME}" ]; then 32 echo >>${target_file} "endpoint_hostname = \"${ENDPOINT_HOSTNAME}\"" 33 else 34 echo >>${target_file} "endpoint_hostname = \"localhost\"" 35 fi 36 37 echo endpoint_port = 8082 >> ${target_file} 38 echo debug = false >> ${target_file} 39 40 if [ "x" != "x${ROUTER_TABLE}" ]; then 41 echo >>${target_file} "router_table_name=\"${ROUTER_TABLE}\"" 42 else 43 echo >>${target_file} "router_table_name=router" 44 fi 45 46 if [ "x" != "x${CASS_ADDRESS}" ]; then 47 echo >>${target_file} "cass_address = \"${CASS_ADDRESS}\"" 48 else 49 echo >>${target_file} "cass_address = \"localhost\"" 50 fi 51 52 echo keyspace = \"autopush\" >> ${target_file} 53 54 if [ "x" != "x${STATSD_HOST}" ]; then 55 echo >>${target_file} "statsd_host = \"${STATSD_HOST}\"" 56 else 57 echo >>${target_file} "statsd_host = \"localhost\"" 58 fi 59 echo statsd_port = 8125 >> ${target_file} 60 echo max_msg_length = 4096 >> ${target_file} 61 62 if [ "x" != "x${MAX_MSG}" ]; then 63 echo >>${target_file} "max_msg=${MAX_MSG}" 64 else 65 echo >>${target_file} "max_msg=100" 66 fi 67 68 echo max_payload = 1000000 >> ${target_file} 69 70 if [ "x" != "x${MESSAGE_TABLE}" ]; then 71 echo >>${target_file} "message_tablename= \"${MESSAGE_TABLE}\"" 72 fi 73 74 echo [Redis] >> ${target_file} 75 76 if [ "x" != "x${REDIS_ADDRESS}" ]; then 77 echo -e >>${target_file} ' \t'"Host = \"${REDIS_ADDRESS}\"" 78 else 79 echo -e >>${target_file} ' \t'"Host = \"localhost\"" 80 fi 81 echo -e ' \t 'Table_Prefix = \"counterdb\" >> ${target_file} 82 echo -e ' \t 'Max_Redirects = 16 >> ${target_file} 83 echo -e ' \t' Connection_Pool_Size = 10 >>${target_file} 84 85 if [ "x" != "x${EFK_ADDRESS}" ]; then 86 echo >>/etc/rsyslog.conf local3.* @@${EFK_ADDRESS}:514 87 else 88 echo >>/etc/rsyslog.conf local3.* @@127.0.0.1:514 89 fi 90